summaryrefslogtreecommitdiff
path: root/lib/Analysis/DIBuilder.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2011-09-14 23:13:28 +0000
committerDevang Patel <dpatel@apple.com>2011-09-14 23:13:28 +0000
commit734a67cda5a02be1654a2f89b811d7b6cbe3f5e5 (patch)
tree83b5bea9bdbcc35df956099082956a8fb33c3163 /lib/Analysis/DIBuilder.cpp
parente1d58a6556fe8b00d119373aeefbbecc9b86a1c5 (diff)
downloadllvm-734a67cda5a02be1654a2f89b811d7b6cbe3f5e5.tar.gz
llvm-734a67cda5a02be1654a2f89b811d7b6cbe3f5e5.tar.bz2
llvm-734a67cda5a02be1654a2f89b811d7b6cbe3f5e5.tar.xz
Add support to emit debug info for C++0x nullptr type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DIBuilder.cpp')
-rw-r--r--lib/Analysis/DIBuilder.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Analysis/DIBuilder.cpp b/lib/Analysis/DIBuilder.cpp
index cce8d96854..fd56d369a6 100644
--- a/lib/Analysis/DIBuilder.cpp
+++ b/lib/Analysis/DIBuilder.cpp
@@ -146,6 +146,26 @@ DIEnumerator DIBuilder::createEnumerator(StringRef Name, uint64_t Val) {
return DIEnumerator(MDNode::get(VMContext, Elts));
}
+/// createNullPtrType - Create C++0x nullptr type.
+DIType DIBuilder::createNullPtrType(StringRef Name) {
+ assert(!Name.empty() && "Unable to create type without name");
+ // nullptr is encoded in DIBasicType format. Line number, filename,
+ // ,size, alignment, offset and flags are always empty here.
+ Value *Elts[] = {
+ GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_type),
+ NULL, //TheCU,
+ MDString::get(VMContext, Name),
+ NULL, // Filename
+ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
+ ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Size
+ ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Align
+ ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Offset
+ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags;
+ ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Encoding
+ };
+ return DIType(MDNode::get(VMContext, Elts));
+}
+
/// createBasicType - Create debugging information entry for a basic
/// type, e.g 'char'.
DIType DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits,