Rename these methods to match the style guide.
[oota-llvm.git] / lib / Transforms / Instrumentation / DebugIR.cpp
index b5bdc7560b6b0a1fc5185d572ddd6f5ee97251aa..9ad6c472b9bac4f173ed9a31b5976a3026a378d9 100644 (file)
 #define DEBUG_TYPE "debug-ir"
 
 #include "llvm/ADT/ValueMap.h"
-#include "llvm/Assembly/AssemblyAnnotationWriter.h"
-#include "llvm/DebugInfo.h"
+#include "DebugIR.h"
 #include "llvm/DIBuilder.h"
-#include "llvm/InstVisitor.h"
+#include "llvm/DebugInfo.h"
+#include "llvm/IR/AssemblyAnnotationWriter.h"
 #include "llvm/IR/DataLayout.h"
 #include "llvm/IR/Instruction.h"
+#include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
-#include "llvm/Transforms/Instrumentation.h"
-#include "llvm/Transforms/Utils/Cloning.h"
+#include "llvm/InstVisitor.h"
 #include "llvm/Support/Debug.h"
-#include "llvm/Support/ToolOutputFile.h"
-#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Path.h"
-
-#include "DebugIR.h"
-
+#include "llvm/Support/ToolOutputFile.h"
+#include "llvm/Transforms/Instrumentation.h"
+#include "llvm/Transforms/Utils/Cloning.h"
 #include <string>
 
 #define STR_HELPER(x) #x
@@ -220,7 +219,7 @@ public:
         DICompileUnit(CUNode), F.getName(), MangledName, DIFile(FileNode), Line,
         Sig, Local, IsDefinition, ScopeLine, FuncFlags, IsOptimized, &F);
     assert(Sub.isSubprogram());
-    DEBUG(dbgs() << "create subprogram mdnode " << Sub << ": "
+    DEBUG(dbgs() << "create subprogram mdnode " << *Sub << ": "
                  << "\n");
 
     SubprogramDescriptors.insert(std::make_pair(&F, Sub));
@@ -289,9 +288,9 @@ private:
           "LLVM Version " STR(LLVM_VERSION_MAJOR) "." STR(LLVM_VERSION_MINOR);
     }
 
-    Builder.createCompileUnit(dwarf::DW_LANG_C99, Filename, Directory, Producer,
-                              IsOptimized, Flags, RuntimeVersion);
-    CUNode = Builder.getCU();
+    CUNode =
+        Builder.createCompileUnit(dwarf::DW_LANG_C99, Filename, Directory,
+                                  Producer, IsOptimized, Flags, RuntimeVersion);
 
     if (CUToReplace)
       CUToReplace->replaceAllUsesWith(const_cast<MDNode *>(CUNode));
@@ -401,7 +400,7 @@ private:
       Type *PointeeTy = T->getPointerElementType();
       if (!(N = getType(PointeeTy)))
         N = Builder.createPointerType(
-            getOrCreateType(PointeeTy), Layout.getPointerSizeInBits(),
+            getOrCreateType(PointeeTy), Layout.getPointerTypeSizeInBits(T),
             Layout.getPrefTypeAlignment(T), getTypeName(T));
     } else if (T->isArrayTy()) {
       SmallVector<Value *, 1> Subrange;