summaryrefslogtreecommitdiff
path: root/lib/IR
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-08-16 20:42:14 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-08-16 20:42:14 +0000
commit692062f18023979c0f8d5a155c14cf1f1616a2b0 (patch)
treebc6d241a8e3eec18f4b3c12caf1482b2038dd145 /lib/IR
parent9bb6c81683393363ed1ff8c66397f2d944c0966b (diff)
downloadllvm-692062f18023979c0f8d5a155c14cf1f1616a2b0.tar.gz
llvm-692062f18023979c0f8d5a155c14cf1f1616a2b0.tar.bz2
llvm-692062f18023979c0f8d5a155c14cf1f1616a2b0.tar.xz
DebugInfo: Allow the addition of other (such as static data) members to a record type after construction
Plus a type cleanup & minor fix to enumerate members of declarations. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188577 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/IR')
-rw-r--r--lib/IR/DIBuilder.cpp9
-rw-r--r--lib/IR/DebugInfo.cpp4
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/IR/DIBuilder.cpp b/lib/IR/DIBuilder.cpp
index e36d028899..665e16ea8a 100644
--- a/lib/IR/DIBuilder.cpp
+++ b/lib/IR/DIBuilder.cpp
@@ -844,7 +844,7 @@ DIDescriptor DIBuilder::createUnspecifiedParameter() {
/// createForwardDecl - Create a temporary forward-declared type that
/// can be RAUW'd if the full type is seen.
-DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
+DICompositeType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
DIDescriptor Scope, DIFile F,
unsigned Line, unsigned RuntimeLang,
uint64_t SizeInBits,
@@ -863,11 +863,12 @@ DIType DIBuilder::createForwardDecl(unsigned Tag, StringRef Name,
DIDescriptor::FlagFwdDecl),
NULL,
DIArray(),
- ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang)
+ ConstantInt::get(Type::getInt32Ty(VMContext), RuntimeLang),
+ NULL
};
MDNode *Node = MDNode::getTemporary(VMContext, Elts);
- DIType RetTy(Node);
- assert(RetTy.isType() &&
+ DICompositeType RetTy(Node);
+ assert(RetTy.isCompositeType() &&
"createForwardDecl result should be a DIType");
return RetTy;
}
diff --git a/lib/IR/DebugInfo.cpp b/lib/IR/DebugInfo.cpp
index 0f7ddb5961..cffc2ac1f2 100644
--- a/lib/IR/DebugInfo.cpp
+++ b/lib/IR/DebugInfo.cpp
@@ -647,7 +647,7 @@ void DICompositeType::setTypeArray(DIArray Elements, DIArray TParams) {
DbgNode = N;
}
-void DICompositeType::addMember(DISubprogram S) {
+void DICompositeType::addMember(DIDescriptor D) {
SmallVector<llvm::Value *, 16> M;
DIArray OrigM = getTypeArray();
unsigned Elements = OrigM.getNumElements();
@@ -656,7 +656,7 @@ void DICompositeType::addMember(DISubprogram S) {
M.reserve(Elements + 1);
for (unsigned i = 0; i != Elements; ++i)
M.push_back(OrigM.getElement(i));
- M.push_back(S);
+ M.push_back(D);
setTypeArray(DIArray(MDNode::get(DbgNode->getContext(), M)));
}