aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/DebugInfo.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-12-07 23:25:47 +0000
committerDevang Patel <dpatel@apple.com>2010-12-07 23:25:47 +0000
commit746660fc7bcd0ba4b2a4663aa00225c7ef3f6f02 (patch)
tree404a70e8e8d784e1eed041a007e51a2856320e9f /llvm/lib/Analysis/DebugInfo.cpp
parentc5f5f0a166afdaf5ac60684e7908864af46b47c6 (diff)
downloadllvm-746660fc7bcd0ba4b2a4663aa00225c7ef3f6f02.zip
llvm-746660fc7bcd0ba4b2a4663aa00225c7ef3f6f02.tar.gz
llvm-746660fc7bcd0ba4b2a4663aa00225c7ef3f6f02.tar.bz2
Add support to create variables, structs etc.. using DIBuilder.
This is still work in progress. llvm-svn: 121205
Diffstat (limited to 'llvm/lib/Analysis/DebugInfo.cpp')
-rw-r--r--llvm/lib/Analysis/DebugInfo.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/DebugInfo.cpp b/llvm/lib/Analysis/DebugInfo.cpp
index 5532cf5..1b732a2 100644
--- a/llvm/lib/Analysis/DebugInfo.cpp
+++ b/llvm/lib/Analysis/DebugInfo.cpp
@@ -308,7 +308,8 @@ bool DIType::Verify() const {
unsigned Tag = getTag();
if (!isBasicType() && Tag != dwarf::DW_TAG_const_type &&
Tag != dwarf::DW_TAG_volatile_type && Tag != dwarf::DW_TAG_pointer_type &&
- Tag != dwarf::DW_TAG_restrict_type && getFilename().empty())
+ Tag != dwarf::DW_TAG_reference_type && Tag != dwarf::DW_TAG_restrict_type
+ && getFilename().empty())
return false;
return true;
}
@@ -960,7 +961,6 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
return DICompositeType(Node);
}
-
/// CreateTemporaryType - Create a temporary forward-declared type.
DIType DIFactory::CreateTemporaryType() {
// Give the temporary MDNode a tag. It doesn't matter what tag we
@@ -972,6 +972,19 @@ DIType DIFactory::CreateTemporaryType() {
return DIType(Node);
}
+/// CreateTemporaryType - Create a temporary forward-declared type.
+DIType DIFactory::CreateTemporaryType(DIFile F) {
+ // Give the temporary MDNode a tag. It doesn't matter what tag we
+ // use here as long as DIType accepts it.
+ Value *Elts[] = {
+ GetTagConstant(DW_TAG_base_type),
+ F.getCompileUnit(),
+ NULL,
+ F
+ };
+ MDNode *Node = MDNode::getTemporary(VMContext, Elts, array_lengthof(Elts));
+ return DIType(Node);
+}
/// CreateCompositeType - Create a composite type like array, struct, etc.
DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag,