Mark artificial types as such in the annotated debug output.
[oota-llvm.git] / lib / IR / DIBuilder.cpp
index b3bbde86c543a2a4f9e9eaa01b78ef7f4183153b..9fd0cd8683c584ccec084f81f1ed63977e79821f 100644 (file)
 
 #include "llvm/DIBuilder.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/Constants.h"
 #include "llvm/DebugInfo.h"
-#include "llvm/IntrinsicInst.h"
-#include "llvm/Module.h"
+#include "llvm/IR/Constants.h"
+#include "llvm/IR/IntrinsicInst.h"
+#include "llvm/IR/Module.h"
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Dwarf.h"
 
@@ -229,6 +229,24 @@ DIType DIBuilder::createPointerType(DIType PointeeTy, uint64_t SizeInBits,
   return DIType(MDNode::get(VMContext, Elts));
 }
 
+DIType DIBuilder::createMemberPointerType(DIType PointeeTy, DIType Base) {
+  // Pointer types are encoded in DIDerivedType format.
+  Value *Elts[] = {
+    GetTagConstant(VMContext, dwarf::DW_TAG_ptr_to_member_type),
+    NULL, //TheCU,
+    NULL,
+    NULL, // Filename
+    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
+    ConstantInt::get(Type::getInt64Ty(VMContext), 0),
+    ConstantInt::get(Type::getInt64Ty(VMContext), 0),
+    ConstantInt::get(Type::getInt64Ty(VMContext), 0), // Offset
+    ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Flags
+    PointeeTy,
+    Base
+  };
+  return DIType(MDNode::get(VMContext, Elts));
+}
+
 /// createReferenceType - Create debugging information entry for a reference
 /// type.
 DIType DIBuilder::createReferenceType(unsigned Tag, DIType RTy) {