summaryrefslogtreecommitdiff
path: root/lib/IR/DIBuilder.cpp
diff options
context:
space:
mode:
authorManman Ren <manman.ren@gmail.com>2013-09-06 18:27:00 +0000
committerManman Ren <manman.ren@gmail.com>2013-09-06 18:27:00 +0000
commit5930eabe0fdc48c02c5af500aa5b1c5b732848b1 (patch)
tree5e40e3fa4a6139447f8372b585de3379cc4a0e3a /lib/IR/DIBuilder.cpp
parent28da141d44cd67b96085d7bb0ae7dfac554a0c10 (diff)
downloadllvm-5930eabe0fdc48c02c5af500aa5b1c5b732848b1.tar.gz
llvm-5930eabe0fdc48c02c5af500aa5b1c5b732848b1.tar.bz2
llvm-5930eabe0fdc48c02c5af500aa5b1c5b732848b1.tar.xz
Debug Info: Move a helper function getTypeIdentifier from DIBuilder to be part
of DIType. Implement DIType::generateRef to return a type reference. This function will be used in setContaintingType and in DIBuilder to generete the type reference. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190188 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR/DIBuilder.cpp')
-rw-r--r--lib/IR/DIBuilder.cpp14
1 files changed, 1 insertions, 13 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index 2ff10b593e..d58a9dcd7a 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -75,18 +75,6 @@ void DIBuilder::finalize() {
DIType(TempImportedModules).replaceAllUsesWith(IMs);
}
-/// Use the type identifier instead of the actual MDNode if possible,
-/// to help type uniquing. This function returns the identifier if it
-/// exists for the given type, otherwise returns the MDNode.
-static Value *getTypeIdentifier(DIType T) {
- if (!T.isCompositeType())
- return T;
- DICompositeType DTy(T);
- if (!DTy.getIdentifier())
- return T;
- return DTy.getIdentifier();
-}
-
/// getNonCompileUnitScope - If N is compile unit return NULL otherwise return
/// N.
static MDNode *getNonCompileUnitScope(MDNode *N) {
@@ -334,7 +322,7 @@ DIDerivedType DIBuilder::createMemberPointerType(DIType PointeeTy,
ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Offset
ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
PointeeTy,
- getTypeIdentifier(Base)
+ Base.generateRef()
};
return DIDerivedType(MDNode::get(VMContext, Elts));
}