diff options
Diffstat (limited to 'include/llvm/IR/DIBuilder.h')
-rw-r--r-- | include/llvm/IR/DIBuilder.h | 73 |
1 files changed, 39 insertions, 34 deletions
diff --git a/include/llvm/IR/DIBuilder.h b/include/llvm/IR/DIBuilder.h index aeec39541154c..0f2f67f5feaf6 100644 --- a/include/llvm/IR/DIBuilder.h +++ b/include/llvm/IR/DIBuilder.h @@ -15,8 +15,6 @@ #ifndef LLVM_IR_DIBUILDER_H #define LLVM_IR_DIBUILDER_H -#include "llvm/ADT/ArrayRef.h" -#include "llvm/ADT/StringRef.h" #include "llvm/IR/DebugInfo.h" #include "llvm/IR/TrackingMDRef.h" #include "llvm/IR/ValueHandle.h" @@ -31,6 +29,7 @@ namespace llvm { class Constant; class LLVMContext; class StringRef; + template <typename T> class ArrayRef; class DIBuilder { Module &M; @@ -52,7 +51,11 @@ namespace llvm { bool AllowUnresolvedNodes; /// Each subprogram's preserved local variables. - DenseMap<MDNode *, std::vector<TrackingMDNodeRef>> PreservedVariables; + /// + /// Do not use a std::vector. Some versions of libc++ apparently copy + /// instead of move on grow operations, and TrackingMDRef is expensive to + /// copy. + DenseMap<MDNode *, SmallVector<TrackingMDNodeRef, 1>> PreservedVariables; DIBuilder(const DIBuilder &) = delete; void operator=(const DIBuilder &) = delete; @@ -68,7 +71,6 @@ namespace llvm { /// If \c AllowUnresolved, collect unresolved nodes attached to the module /// in order to resolve cycles during \a finalize(). explicit DIBuilder(Module &M, bool AllowUnresolved = true); - enum DebugEmissionKind { FullDebug=1, LineTablesOnly }; /// Construct any deferred debug info descriptors. void finalize(); @@ -93,22 +95,13 @@ namespace llvm { /// out into. /// \param Kind The kind of debug information to generate. /// \param DWOId The DWOId if this is a split skeleton compile unit. - /// \param EmitDebugInfo A boolean flag which indicates whether - /// debug information should be written to - /// the final output or not. When this is - /// false, debug information annotations will - /// be present in the IL but they are not - /// written to the final assembly or object - /// file. This supports tracking source - /// location information in the back end - /// without actually changing the output - /// (e.g., when using optimization remarks). DICompileUnit * createCompileUnit(unsigned Lang, StringRef File, StringRef Dir, StringRef Producer, bool isOptimized, StringRef Flags, unsigned RV, StringRef SplitName = StringRef(), - DebugEmissionKind Kind = FullDebug, uint64_t DWOId = 0, - bool EmitDebugInfo = true); + DICompileUnit::DebugEmissionKind Kind = + DICompileUnit::DebugEmissionKind::FullDebug, + uint64_t DWOId = 0); /// Create a file descriptor to hold debugging information /// for a file. @@ -154,7 +147,8 @@ namespace llvm { /// \param Class Type for which this pointer points to members of. DIDerivedType *createMemberPointerType(DIType *PointeeTy, DIType *Class, uint64_t SizeInBits, - uint64_t AlignInBits = 0); + uint64_t AlignInBits = 0, + unsigned Flags = 0); /// Create debugging information entry for a c++ /// style reference or rvalue reference type. @@ -200,6 +194,22 @@ namespace llvm { uint64_t OffsetInBits, unsigned Flags, DIType *Ty); + /// Create debugging information entry for a bit field member. + /// \param Scope Member scope. + /// \param Name Member name. + /// \param File File where this member is defined. + /// \param LineNo Line number. + /// \param SizeInBits Member size. + /// \param AlignInBits Member alignment. + /// \param OffsetInBits Member offset. + /// \param StorageOffsetInBits Member storage offset. + /// \param Flags Flags to encode member attribute. + /// \param Ty Parent type. + DIDerivedType *createBitFieldMemberType( + DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNo, + uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits, + uint64_t StorageOffsetInBits, unsigned Flags, DIType *Ty); + /// Create debugging information entry for a /// C++ static data member. /// \param Scope Member scope. @@ -381,8 +391,9 @@ namespace llvm { /// includes return type at 0th index. /// \param Flags E.g.: LValueReference. /// These flags are used to emit dwarf attributes. + /// \param CC Calling convention, e.g. dwarf::DW_CC_normal DISubroutineType *createSubroutineType(DITypeRefArray ParameterTypes, - unsigned Flags = 0); + unsigned Flags = 0, unsigned CC = 0); /// Create an external type reference. /// \param Tag Dwarf TAG. @@ -413,9 +424,9 @@ namespace llvm { uint64_t AlignInBits = 0, unsigned Flags = DINode::FlagFwdDecl, StringRef UniqueIdentifier = ""); - /// Retain DIType* in a module even if it is not referenced + /// Retain DIScope* in a module even if it is not referenced /// through debug info anchors. - void retainType(DIType *T); + void retainType(DIScope *T); /// Create unspecified parameter type /// for a subroutine type. @@ -535,17 +546,6 @@ namespace llvm { bool isOptimized = false, DITemplateParameterArray TParams = nullptr, DISubprogram *Decl = nullptr); - /// FIXME: this is added for dragonegg. Once we update dragonegg - /// to call resolve function, this will be removed. - DISubprogram *createFunction(DIScopeRef Scope, StringRef Name, - StringRef LinkageName, DIFile *File, - unsigned LineNo, DISubroutineType *Ty, - bool isLocalToUnit, bool isDefinition, - unsigned ScopeLine, unsigned Flags = 0, - bool isOptimized = false, - DITemplateParameterArray TParams = nullptr, - DISubprogram *Decl = nullptr); - /// Create a new descriptor for the specified C++ method. /// See comments in \a DISubprogram* for descriptions of these fields. /// \param Scope Function scope. @@ -558,7 +558,11 @@ namespace llvm { /// \param isDefinition True if this is a function definition. /// \param Virtuality Attributes describing virtualness. e.g. pure /// virtual function. - /// \param VTableIndex Index no of this method in virtual table. + /// \param VTableIndex Index no of this method in virtual table, or -1u if + /// unrepresentable. + /// \param ThisAdjustment + /// MS ABI-specific adjustment of 'this' that occurs + /// in the prologue. /// \param VTableHolder Type that holds vtable. /// \param Flags e.g. is this function prototyped or not. /// This flags are used to emit dwarf attributes. @@ -568,8 +572,9 @@ namespace llvm { createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File, unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit, bool isDefinition, unsigned Virtuality = 0, - unsigned VTableIndex = 0, DIType *VTableHolder = nullptr, - unsigned Flags = 0, bool isOptimized = false, + unsigned VTableIndex = 0, int ThisAdjustment = 0, + DIType *VTableHolder = nullptr, unsigned Flags = 0, + bool isOptimized = false, DITemplateParameterArray TParams = nullptr); /// This creates new descriptor for a namespace with the specified |