[C++11] Pass unique_ptr by value instead of &&.
[oota-llvm.git] / include / llvm / DIBuilder.h
index 924aab586fbe3bad989a51d3d3651101233bc98b..ba7bca7ac5d979d44806a26f5a75f6e88837ff22 100644 (file)
@@ -55,7 +55,7 @@ namespace llvm {
   class DIBuilder {
     private:
     Module &M;
-    LLVMContext & VMContext;
+    LLVMContext &VMContext;
 
     MDNode *TempEnumTypes;
     MDNode *TempRetainTypes;
@@ -72,8 +72,9 @@ namespace llvm {
     SmallVector<TrackingVH<MDNode>, 4> AllRetainTypes;
     SmallVector<Value *, 4> AllSubprograms;
     SmallVector<Value *, 4> AllGVs;
-    SmallVector<Value *, 4> AllImportedModules;
+    SmallVector<TrackingVH<MDNode>, 4> AllImportedModules;
 
+    // Private use for multiple types of template parameters.
     DITemplateValueParameter
     createTemplateValueParameter(unsigned Tag, DIDescriptor Scope,
                                  StringRef Name, DIType Ty, Value *Val,
@@ -86,6 +87,7 @@ namespace llvm {
     public:
     explicit DIBuilder(Module &M);
     enum ComplexAddrKind { OpPlus=1, OpDeref };
+    enum DebugEmissionKind { FullDebug=1, LineTablesOnly };
 
     /// finalize - Construct any deferred debug info descriptors.
     void finalize();
@@ -95,8 +97,8 @@ namespace llvm {
     /// @param Lang     Source programming language, eg. dwarf::DW_LANG_C99
     /// @param File     File name
     /// @param Dir      Directory
-    /// @param Producer String identify producer of debugging information.
-    ///                 Usuall this is a compiler version string.
+    /// @param Producer Identify the producer of debugging information and code.
+    ///                 Usually this is a compiler version string.
     /// @param isOptimized A boolean flag which indicates whether optimization
     ///                    is ON or not.
     /// @param Flags    This string lists command line options. This string is
@@ -110,7 +112,8 @@ namespace llvm {
                                     StringRef Dir, StringRef Producer,
                                     bool isOptimized, StringRef Flags,
                                     unsigned RV,
-                                    StringRef SplitName = StringRef());
+                                    StringRef SplitName = StringRef(),
+                                    DebugEmissionKind Kind = FullDebug);
 
     /// createFile - Create a file descriptor to hold debugging information
     /// for a file.
@@ -415,10 +418,13 @@ namespace llvm {
         StringRef UniqueIdentifier = StringRef());
 
     /// createSubroutineType - Create subroutine type.
-    /// @param File           File in which this subroutine is defined.
-    /// @param ParameterTypes An array of subroutine parameter types. This
-    ///                       includes return type at 0th index.
-    DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes);
+    /// @param File            File in which this subroutine is defined.
+    /// @param ParameterTypes  An array of subroutine parameter types. This
+    ///                        includes return type at 0th index.
+    /// @param Flags           E.g.: LValueReference.
+    ///                        These flags are used to emit dwarf attributes.
+    DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes,
+                                         unsigned Flags = 0);
 
     /// createArtificialType - Create a new DIType with "artificial" flag set.
     DIType createArtificialType(DIType Ty);
@@ -439,7 +445,7 @@ namespace llvm {
     /// through debug info anchors.
     void retainType(DIType T);
 
-    /// createUnspecifiedParameter - Create unspeicified type descriptor
+    /// createUnspecifiedParameter - Create unspecified type descriptor
     /// for a subroutine type.
     DIDescriptor createUnspecifiedParameter();
 
@@ -542,7 +548,7 @@ namespace llvm {
     /// @param File          File where this variable is defined.
     /// @param LineNo        Line number.
     /// @param Ty            Function type.
-    /// @param isLocalToUnit True if this function is not externally visible..
+    /// @param isLocalToUnit True if this function is not externally visible.
     /// @param isDefinition  True if this is a function definition.
     /// @param ScopeLine     Set to the beginning of the scope this starts
     /// @param Flags         e.g. is this function prototyped or not.