Add a field to the compile unit of where we plan on splitting out
authorEric Christopher <echristo@gmail.com>
Fri, 22 Feb 2013 23:50:04 +0000 (23:50 +0000)
committerEric Christopher <echristo@gmail.com>
Fri, 22 Feb 2013 23:50:04 +0000 (23:50 +0000)
the debug info for -gsplit-dwarf so we can encode that location
in the skeleton cu.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175933 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/DIBuilder.h
include/llvm/DebugInfo.h
lib/IR/DIBuilder.cpp

index 3de75ffd2d3d63e094f924bf1889f6d34169a720..5efbb9ef5b0f6941b0c60c537b4ea81b0c7eec8a 100644 (file)
@@ -91,9 +91,12 @@ namespace llvm {
     ///                 by a tool analyzing generated debugging information.
     /// @param RV       This indicates runtime version for languages like 
     ///                 Objective-C.
+    /// @param SplitName The name of the file that we'll split debug info out
+    ///                  into.
     void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir, 
-                           StringRef Producer,
-                           bool isOptimized, StringRef Flags, unsigned RV);
+                           StringRef Producer, bool isOptimized,
+                           StringRef Flags, unsigned RV,
+                           StringRef SplitName = StringRef());
 
     /// createFile - Create a file descriptor to hold debugging information
     /// for a file.
index a281f22ff875f5b2693c7e65aadb2158a212ec33..c557a7afb34bc8b2bda6ce44ccabb09effb6fa93 100644 (file)
@@ -203,6 +203,8 @@ namespace llvm {
     DIArray getSubprograms() const;
     DIArray getGlobalVariables() const;
 
+    StringRef getSplitDebugFilename() const { return getStringField(14); }
+
     /// Verify - Verify that a compile unit is well formed.
     bool Verify() const;
   };
index 3b691194b400440d709bbf5b5edaf0565cea8ba7..bab30e4ef14c87b56c1e531ac04fb6fd387c5407 100644 (file)
@@ -76,7 +76,7 @@ static MDNode *getNonCompileUnitScope(MDNode *N) {
 void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
                                   StringRef Directory, StringRef Producer,
                                   bool isOptimized, StringRef Flags,
-                                  unsigned RunTimeVer) {
+                                  unsigned RunTimeVer, StringRef SplitName) {
   assert(((Lang <= dwarf::DW_LANG_Python && Lang >= dwarf::DW_LANG_C89) ||
           (Lang <= dwarf::DW_LANG_hi_user && Lang >= dwarf::DW_LANG_lo_user)) &&
          "Invalid Language tag");
@@ -106,7 +106,8 @@ void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
     TempEnumTypes,
     TempRetainTypes,
     TempSubprograms,
-    TempGVs
+    TempGVs,
+    MDString::get(VMContext, SplitName)
   };
   TheCU = DICompileUnit(MDNode::get(VMContext, Elts));