2012-06-29 10:32:07 +02:00
|
|
|
//===--- llvm/DIBuilder.h - Debug Information Builder -----------*- C++ -*-===//
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2013-04-19 22:37:09 +02:00
|
|
|
// This file defines a DIBuilder that is useful for creating debugging
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
// information entries in LLVM IR form.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-10 01:45:19 +01:00
|
|
|
#ifndef LLVM_DIBUILDER_H
|
|
|
|
#define LLVM_DIBUILDER_H
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-04-24 12:11:03 +02:00
|
|
|
#include "llvm/ADT/ArrayRef.h"
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2013-09-07 01:54:23 +02:00
|
|
|
#include "llvm/DebugInfo.h"
|
2012-12-03 18:02:12 +01:00
|
|
|
#include "llvm/Support/DataTypes.h"
|
2013-08-30 01:17:54 +02:00
|
|
|
#include "llvm/Support/ValueHandle.h"
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
|
|
|
namespace llvm {
|
2010-12-08 00:25:47 +01:00
|
|
|
class BasicBlock;
|
|
|
|
class Instruction;
|
|
|
|
class Function;
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
class Module;
|
2010-12-08 00:25:47 +01:00
|
|
|
class Value;
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
class LLVMContext;
|
|
|
|
class MDNode;
|
|
|
|
class StringRef;
|
2013-02-12 01:40:41 +01:00
|
|
|
class DIBasicType;
|
2013-07-19 02:51:47 +02:00
|
|
|
class DICompileUnit;
|
2013-02-18 07:41:57 +01:00
|
|
|
class DICompositeType;
|
|
|
|
class DIDerivedType;
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
class DIDescriptor;
|
|
|
|
class DIFile;
|
|
|
|
class DIEnumerator;
|
|
|
|
class DIType;
|
2010-12-08 00:25:47 +01:00
|
|
|
class DIArray;
|
|
|
|
class DIGlobalVariable;
|
2013-05-07 23:35:53 +02:00
|
|
|
class DIImportedEntity;
|
2010-12-08 00:25:47 +01:00
|
|
|
class DINameSpace;
|
|
|
|
class DIVariable;
|
2010-12-08 02:50:15 +01:00
|
|
|
class DISubrange;
|
2011-10-12 00:59:11 +02:00
|
|
|
class DILexicalBlockFile;
|
2010-12-08 02:50:15 +01:00
|
|
|
class DILexicalBlock;
|
2013-04-22 08:12:31 +02:00
|
|
|
class DIScope;
|
2010-12-08 21:42:44 +01:00
|
|
|
class DISubprogram;
|
2011-02-02 22:38:25 +01:00
|
|
|
class DITemplateTypeParameter;
|
2011-02-02 23:35:53 +01:00
|
|
|
class DITemplateValueParameter;
|
2012-02-04 01:59:25 +01:00
|
|
|
class DIObjCProperty;
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
|
|
|
class DIBuilder {
|
|
|
|
private:
|
|
|
|
Module &M;
|
2014-02-27 01:15:44 +01:00
|
|
|
LLVMContext &VMContext;
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-08-17 00:09:43 +02:00
|
|
|
MDNode *TempEnumTypes;
|
|
|
|
MDNode *TempRetainTypes;
|
|
|
|
MDNode *TempSubprograms;
|
|
|
|
MDNode *TempGVs;
|
2013-04-22 08:12:31 +02:00
|
|
|
MDNode *TempImportedModules;
|
2011-08-17 00:09:43 +02:00
|
|
|
|
2010-12-08 00:25:47 +01:00
|
|
|
Function *DeclareFn; // llvm.dbg.declare
|
|
|
|
Function *ValueFn; // llvm.dbg.value
|
|
|
|
|
2011-08-17 00:09:43 +02:00
|
|
|
SmallVector<Value *, 4> AllEnumTypes;
|
2013-08-30 01:17:54 +02:00
|
|
|
/// Use TrackingVH to collect RetainTypes, since they can be updated
|
|
|
|
/// later on.
|
|
|
|
SmallVector<TrackingVH<MDNode>, 4> AllRetainTypes;
|
2011-08-17 00:09:43 +02:00
|
|
|
SmallVector<Value *, 4> AllSubprograms;
|
|
|
|
SmallVector<Value *, 4> AllGVs;
|
2013-04-22 08:12:31 +02:00
|
|
|
SmallVector<Value *, 4> AllImportedModules;
|
2011-08-17 00:09:43 +02:00
|
|
|
|
2014-02-27 01:04:54 +01:00
|
|
|
// Private use for multiple types of template parameters.
|
2013-06-22 20:59:11 +02:00
|
|
|
DITemplateValueParameter
|
|
|
|
createTemplateValueParameter(unsigned Tag, DIDescriptor Scope,
|
|
|
|
StringRef Name, DIType Ty, Value *Val,
|
|
|
|
MDNode *File = 0, unsigned LineNo = 0,
|
|
|
|
unsigned ColumnNo = 0);
|
|
|
|
|
2012-09-17 09:16:40 +02:00
|
|
|
DIBuilder(const DIBuilder &) LLVM_DELETED_FUNCTION;
|
|
|
|
void operator=(const DIBuilder &) LLVM_DELETED_FUNCTION;
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit DIBuilder(Module &M);
|
2011-02-19 00:28:53 +01:00
|
|
|
enum ComplexAddrKind { OpPlus=1, OpDeref };
|
2014-02-27 02:24:56 +01:00
|
|
|
enum DebugEmissionKind { FullDebug=1, LineTablesOnly };
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-08-16 01:00:00 +02:00
|
|
|
/// finalize - Construct any deferred debug info descriptors.
|
|
|
|
void finalize();
|
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createCompileUnit - A CompileUnit provides an anchor for all debugging
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
/// information generated during this instance of compilation.
|
2010-11-08 19:28:34 +01:00
|
|
|
/// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
|
|
|
|
/// @param File File name
|
|
|
|
/// @param Dir Directory
|
2014-02-27 00:54:42 +01:00
|
|
|
/// @param Producer Identify the producer of debugging information and code.
|
|
|
|
/// Usually this is a compiler version string.
|
2010-11-08 19:28:34 +01:00
|
|
|
/// @param isOptimized A boolean flag which indicates whether optimization
|
|
|
|
/// is ON or not.
|
2013-04-19 22:37:09 +02:00
|
|
|
/// @param Flags This string lists command line options. This string is
|
2010-11-08 19:28:34 +01:00
|
|
|
/// directly embedded in debug info output which may be used
|
|
|
|
/// by a tool analyzing generated debugging information.
|
2013-04-19 22:37:09 +02:00
|
|
|
/// @param RV This indicates runtime version for languages like
|
2010-11-08 19:28:34 +01:00
|
|
|
/// Objective-C.
|
2013-02-23 00:50:04 +01:00
|
|
|
/// @param SplitName The name of the file that we'll split debug info out
|
|
|
|
/// into.
|
2013-07-19 02:51:47 +02:00
|
|
|
DICompileUnit createCompileUnit(unsigned Lang, StringRef File,
|
|
|
|
StringRef Dir, StringRef Producer,
|
|
|
|
bool isOptimized, StringRef Flags,
|
|
|
|
unsigned RV,
|
2014-02-27 02:24:56 +01:00
|
|
|
StringRef SplitName = StringRef(),
|
|
|
|
DebugEmissionKind Kind = FullDebug);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createFile - Create a file descriptor to hold debugging information
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
/// for a file.
|
2011-02-22 19:56:12 +01:00
|
|
|
DIFile createFile(StringRef Filename, StringRef Directory);
|
2013-04-19 22:37:09 +02:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createEnumerator - Create a single enumerator value.
|
2013-06-24 19:34:33 +02:00
|
|
|
DIEnumerator createEnumerator(StringRef Name, int64_t Val);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2013-06-28 00:50:59 +02:00
|
|
|
/// \brief Create a DWARF unspecified type.
|
|
|
|
DIBasicType createUnspecifiedType(StringRef Name);
|
|
|
|
|
|
|
|
/// \brief Create C++11 nullptr type.
|
|
|
|
DIBasicType createNullPtrType();
|
2011-09-15 01:13:28 +02:00
|
|
|
|
2013-04-19 22:37:09 +02:00
|
|
|
/// createBasicType - Create debugging information entry for a basic
|
2010-11-08 19:28:34 +01:00
|
|
|
/// type.
|
|
|
|
/// @param Name Type name.
|
|
|
|
/// @param SizeInBits Size of the type.
|
|
|
|
/// @param AlignInBits Type alignment.
|
|
|
|
/// @param Encoding DWARF encoding code, e.g. dwarf::DW_ATE_float.
|
2013-02-12 01:40:41 +01:00
|
|
|
DIBasicType createBasicType(StringRef Name, uint64_t SizeInBits,
|
|
|
|
uint64_t AlignInBits, unsigned Encoding);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createQualifiedType - Create debugging information entry for a qualified
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
/// type, e.g. 'const int'.
|
2010-11-08 19:28:34 +01:00
|
|
|
/// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
|
|
|
|
/// @param FromTy Base Type.
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType createQualifiedType(unsigned Tag, DIType FromTy);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createPointerType - Create debugging information entry for a pointer.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param PointeeTy Type pointed by this pointer.
|
|
|
|
/// @param SizeInBits Size.
|
|
|
|
/// @param AlignInBits Alignment. (optional)
|
|
|
|
/// @param Name Pointer type name. (optional)
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType
|
|
|
|
createPointerType(DIType PointeeTy, uint64_t SizeInBits,
|
|
|
|
uint64_t AlignInBits = 0, StringRef Name = StringRef());
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2013-01-07 06:51:15 +01:00
|
|
|
/// \brief Create debugging information entry for a pointer to member.
|
|
|
|
/// @param PointeeTy Type pointed to by this pointer.
|
|
|
|
/// @param Class Type for which this pointer points to members of.
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
|
2013-01-07 06:51:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createReferenceType - Create debugging information entry for a c++
|
2012-05-19 03:36:37 +02:00
|
|
|
/// style reference or rvalue reference type.
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType createReferenceType(unsigned Tag, DIType RTy);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createTypedef - Create debugging information entry for a typedef.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Ty Original type.
|
|
|
|
/// @param Name Typedef name.
|
|
|
|
/// @param File File where this type is defined.
|
|
|
|
/// @param LineNo Line number.
|
2011-06-03 19:04:51 +02:00
|
|
|
/// @param Context The surrounding context for the typedef.
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType createTypedef(DIType Ty, StringRef Name, DIFile File,
|
|
|
|
unsigned LineNo, DIDescriptor Context);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createFriend - Create debugging information entry for a 'friend'.
|
2013-06-07 20:35:53 +02:00
|
|
|
DIDerivedType createFriend(DIType Ty, DIType FriendTy);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createInheritance - Create debugging information entry to establish
|
2010-11-08 19:28:34 +01:00
|
|
|
/// inheritance relationship between two types.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Ty Original type.
|
|
|
|
/// @param BaseTy Base type. Ty is inherits from base.
|
|
|
|
/// @param BaseOffset Base offset.
|
2013-04-19 22:37:09 +02:00
|
|
|
/// @param Flags Flags to describe inheritance attribute,
|
2010-12-08 00:25:47 +01:00
|
|
|
/// e.g. private
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType createInheritance(DIType Ty, DIType BaseTy,
|
|
|
|
uint64_t BaseOffset, unsigned Flags);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createMemberType - Create debugging information entry for a member.
|
2011-06-25 00:00:39 +02:00
|
|
|
/// @param Scope Member scope.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @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 Flags Flags to encode member attribute, e.g. private
|
|
|
|
/// @param Ty Parent type.
|
2013-02-18 07:41:57 +01:00
|
|
|
DIDerivedType
|
2013-09-08 08:02:56 +02:00
|
|
|
createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
|
2013-02-18 07:41:57 +01:00
|
|
|
unsigned LineNo, uint64_t SizeInBits, uint64_t AlignInBits,
|
|
|
|
uint64_t OffsetInBits, unsigned Flags, DIType Ty);
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
|
2013-01-16 02:22:23 +01:00
|
|
|
/// createStaticMemberType - Create debugging information entry for a
|
|
|
|
/// C++ static data member.
|
|
|
|
/// @param Scope Member scope.
|
|
|
|
/// @param Name Member name.
|
|
|
|
/// @param File File where this member is declared.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Type of the static member.
|
|
|
|
/// @param Flags Flags to encode member attribute, e.g. private.
|
|
|
|
/// @param Val Const initializer of the member.
|
2013-06-07 20:35:53 +02:00
|
|
|
DIDerivedType
|
|
|
|
createStaticMemberType(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIFile File, unsigned LineNo, DIType Ty,
|
|
|
|
unsigned Flags, llvm::Value *Val);
|
2013-01-16 02:22:23 +01:00
|
|
|
|
2011-04-16 02:11:51 +02:00
|
|
|
/// createObjCIVar - Create debugging information entry for Objective-C
|
|
|
|
/// instance variable.
|
|
|
|
/// @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 Flags Flags to encode member attribute, e.g. private
|
|
|
|
/// @param Ty Parent type.
|
2012-06-02 12:20:22 +02:00
|
|
|
/// @param PropertyName Name of the Objective C property associated with
|
2011-04-16 02:11:51 +02:00
|
|
|
/// this ivar.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param PropertyGetterName Name of the Objective C property getter
|
|
|
|
/// selector.
|
|
|
|
/// @param PropertySetterName Name of the Objective C property setter
|
|
|
|
/// selector.
|
2011-04-16 02:11:51 +02:00
|
|
|
/// @param PropertyAttributes Objective C property attributes.
|
2013-06-07 20:35:53 +02:00
|
|
|
DIDerivedType createObjCIVar(StringRef Name, DIFile File,
|
|
|
|
unsigned LineNo, uint64_t SizeInBits,
|
|
|
|
uint64_t AlignInBits, uint64_t OffsetInBits,
|
|
|
|
unsigned Flags, DIType Ty,
|
|
|
|
StringRef PropertyName = StringRef(),
|
|
|
|
StringRef PropertyGetterName = StringRef(),
|
|
|
|
StringRef PropertySetterName = StringRef(),
|
|
|
|
unsigned PropertyAttributes = 0);
|
2011-04-16 02:11:51 +02:00
|
|
|
|
2012-02-06 18:49:43 +01:00
|
|
|
/// createObjCIVar - Create debugging information entry for Objective-C
|
|
|
|
/// instance variable.
|
|
|
|
/// @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 Flags Flags to encode member attribute, e.g. private
|
|
|
|
/// @param Ty Parent type.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param PropertyNode Property associated with this ivar.
|
2013-06-07 20:35:53 +02:00
|
|
|
DIDerivedType createObjCIVar(StringRef Name, DIFile File,
|
|
|
|
unsigned LineNo, uint64_t SizeInBits,
|
|
|
|
uint64_t AlignInBits, uint64_t OffsetInBits,
|
|
|
|
unsigned Flags, DIType Ty,
|
|
|
|
MDNode *PropertyNode);
|
2012-02-06 18:49:43 +01:00
|
|
|
|
2012-02-04 01:59:25 +01:00
|
|
|
/// createObjCProperty - Create debugging information entry for Objective-C
|
|
|
|
/// property.
|
|
|
|
/// @param Name Property name.
|
2012-03-29 10:42:56 +02:00
|
|
|
/// @param File File where this property is defined.
|
|
|
|
/// @param LineNumber Line number.
|
2012-02-04 01:59:25 +01:00
|
|
|
/// @param GetterName Name of the Objective C property getter selector.
|
|
|
|
/// @param SetterName Name of the Objective C property setter selector.
|
|
|
|
/// @param PropertyAttributes Objective C property attributes.
|
2012-03-29 10:42:56 +02:00
|
|
|
/// @param Ty Type.
|
|
|
|
DIObjCProperty createObjCProperty(StringRef Name,
|
2012-07-19 02:01:00 +02:00
|
|
|
DIFile File, unsigned LineNumber,
|
|
|
|
StringRef GetterName,
|
|
|
|
StringRef SetterName,
|
|
|
|
unsigned PropertyAttributes,
|
|
|
|
DIType Ty);
|
2013-04-19 22:37:09 +02:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createClassType - Create debugging information entry for a class.
|
2010-12-08 21:18:20 +01:00
|
|
|
/// @param Scope Scope in which this class is defined.
|
|
|
|
/// @param Name class name.
|
|
|
|
/// @param File File where this member is defined.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param LineNumber Line number.
|
2010-12-08 21:18:20 +01:00
|
|
|
/// @param SizeInBits Member size.
|
|
|
|
/// @param AlignInBits Member alignment.
|
|
|
|
/// @param OffsetInBits Member offset.
|
|
|
|
/// @param Flags Flags to encode member attribute, e.g. private
|
|
|
|
/// @param Elements class members.
|
|
|
|
/// @param VTableHolder Debug info of the base class that contains vtable
|
2013-04-19 22:37:09 +02:00
|
|
|
/// for this type. This is used in
|
2010-12-08 21:18:20 +01:00
|
|
|
/// DW_AT_containing_type. See DWARF documentation
|
|
|
|
/// for more info.
|
2011-02-02 22:38:25 +01:00
|
|
|
/// @param TemplateParms Template type parameters.
|
2013-08-28 01:06:40 +02:00
|
|
|
/// @param UniqueIdentifier A unique identifier for the class.
|
2013-03-27 00:46:39 +01:00
|
|
|
DICompositeType createClassType(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIFile File, unsigned LineNumber,
|
|
|
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
|
|
|
uint64_t OffsetInBits, unsigned Flags,
|
|
|
|
DIType DerivedFrom, DIArray Elements,
|
2013-11-19 00:33:32 +01:00
|
|
|
DIType VTableHolder = DIType(),
|
2013-08-28 01:06:40 +02:00
|
|
|
MDNode *TemplateParms = 0,
|
|
|
|
StringRef UniqueIdentifier = StringRef());
|
2010-12-08 21:18:20 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createStructType - Create debugging information entry for a struct.
|
2010-12-08 02:50:15 +01:00
|
|
|
/// @param Scope Scope in which this struct is defined.
|
|
|
|
/// @param Name Struct name.
|
|
|
|
/// @param File File where this member is defined.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param LineNumber Line number.
|
2010-12-08 02:50:15 +01:00
|
|
|
/// @param SizeInBits Member size.
|
|
|
|
/// @param AlignInBits Member alignment.
|
|
|
|
/// @param Flags Flags to encode member attribute, e.g. private
|
|
|
|
/// @param Elements Struct elements.
|
|
|
|
/// @param RunTimeLang Optional parameter, Objective-C runtime version.
|
2013-08-28 01:06:40 +02:00
|
|
|
/// @param UniqueIdentifier A unique identifier for the struct.
|
2013-02-25 02:07:18 +01:00
|
|
|
DICompositeType createStructType(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIFile File, unsigned LineNumber,
|
|
|
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
|
|
|
unsigned Flags, DIType DerivedFrom,
|
|
|
|
DIArray Elements, unsigned RunTimeLang = 0,
|
2013-11-19 00:33:32 +01:00
|
|
|
DIType VTableHolder = DIType(),
|
2013-08-28 01:06:40 +02:00
|
|
|
StringRef UniqueIdentifier = StringRef());
|
2010-12-08 00:25:47 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createUnionType - Create debugging information entry for an union.
|
2010-12-08 02:50:15 +01:00
|
|
|
/// @param Scope Scope in which this union is defined.
|
|
|
|
/// @param Name Union name.
|
|
|
|
/// @param File File where this member is defined.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param LineNumber Line number.
|
2010-12-08 02:50:15 +01:00
|
|
|
/// @param SizeInBits Member size.
|
|
|
|
/// @param AlignInBits Member alignment.
|
|
|
|
/// @param Flags Flags to encode member attribute, e.g. private
|
|
|
|
/// @param Elements Union elements.
|
|
|
|
/// @param RunTimeLang Optional parameter, Objective-C runtime version.
|
2013-08-28 01:06:40 +02:00
|
|
|
/// @param UniqueIdentifier A unique identifier for the union.
|
2013-02-18 07:41:57 +01:00
|
|
|
DICompositeType createUnionType(
|
|
|
|
DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
|
|
|
|
uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
|
2013-08-28 01:06:40 +02:00
|
|
|
DIArray Elements, unsigned RunTimeLang = 0,
|
|
|
|
StringRef UniqueIdentifier = StringRef());
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createTemplateTypeParameter - Create debugging information for template
|
2011-02-02 22:38:25 +01:00
|
|
|
/// type parameter.
|
2011-02-02 23:35:53 +01:00
|
|
|
/// @param Scope Scope in which this type is defined.
|
2011-02-02 22:38:25 +01:00
|
|
|
/// @param Name Type parameter name.
|
|
|
|
/// @param Ty Parameter type.
|
|
|
|
/// @param File File where this type parameter is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param ColumnNo Column Number.
|
|
|
|
DITemplateTypeParameter
|
2011-02-22 19:56:12 +01:00
|
|
|
createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
|
2011-02-02 22:38:25 +01:00
|
|
|
MDNode *File = 0, unsigned LineNo = 0,
|
|
|
|
unsigned ColumnNo = 0);
|
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createTemplateValueParameter - Create debugging information for template
|
2011-02-02 23:35:53 +01:00
|
|
|
/// value parameter.
|
|
|
|
/// @param Scope Scope in which this type is defined.
|
|
|
|
/// @param Name Value parameter name.
|
|
|
|
/// @param Ty Parameter type.
|
2013-05-11 21:14:10 +02:00
|
|
|
/// @param Val Constant parameter value.
|
2011-02-02 23:35:53 +01:00
|
|
|
/// @param File File where this type parameter is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param ColumnNo Column Number.
|
|
|
|
DITemplateValueParameter
|
2013-05-10 23:52:07 +02:00
|
|
|
createTemplateValueParameter(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIType Ty, Value *Val, MDNode *File = 0,
|
|
|
|
unsigned LineNo = 0, unsigned ColumnNo = 0);
|
2013-06-22 20:59:11 +02:00
|
|
|
|
|
|
|
/// \brief Create debugging information for a template template parameter.
|
|
|
|
/// @param Scope Scope in which this type is defined.
|
|
|
|
/// @param Name Value parameter name.
|
|
|
|
/// @param Ty Parameter type.
|
|
|
|
/// @param Val The fully qualified name of the template.
|
|
|
|
/// @param File File where this type parameter is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param ColumnNo Column Number.
|
|
|
|
DITemplateValueParameter
|
|
|
|
createTemplateTemplateParameter(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIType Ty, StringRef Val, MDNode *File = 0,
|
|
|
|
unsigned LineNo = 0, unsigned ColumnNo = 0);
|
|
|
|
|
|
|
|
/// \brief Create debugging information for a template parameter pack.
|
|
|
|
/// @param Scope Scope in which this type is defined.
|
|
|
|
/// @param Name Value parameter name.
|
|
|
|
/// @param Ty Parameter type.
|
|
|
|
/// @param Val An array of types in the pack.
|
|
|
|
/// @param File File where this type parameter is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param ColumnNo Column Number.
|
|
|
|
DITemplateValueParameter
|
|
|
|
createTemplateParameterPack(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIType Ty, DIArray Val, MDNode *File = 0,
|
|
|
|
unsigned LineNo = 0, unsigned ColumnNo = 0);
|
2011-02-02 23:35:53 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createArrayType - Create debugging information entry for an array.
|
2010-12-08 02:50:15 +01:00
|
|
|
/// @param Size Array size.
|
|
|
|
/// @param AlignInBits Alignment.
|
|
|
|
/// @param Ty Element type.
|
|
|
|
/// @param Subscripts Subscripts.
|
2013-02-18 07:41:57 +01:00
|
|
|
DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
|
|
|
|
DIType Ty, DIArray Subscripts);
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createVectorType - Create debugging information entry for a vector type.
|
2010-12-08 02:50:15 +01:00
|
|
|
/// @param Size Array size.
|
|
|
|
/// @param AlignInBits Alignment.
|
|
|
|
/// @param Ty Element type.
|
|
|
|
/// @param Subscripts Subscripts.
|
2013-06-07 05:13:46 +02:00
|
|
|
DICompositeType createVectorType(uint64_t Size, uint64_t AlignInBits,
|
|
|
|
DIType Ty, DIArray Subscripts);
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2013-04-19 21:56:02 +02:00
|
|
|
/// createEnumerationType - Create debugging information entry for an
|
2010-12-08 02:50:15 +01:00
|
|
|
/// enumeration.
|
2013-04-19 21:56:02 +02:00
|
|
|
/// @param Scope Scope in which this enumeration is defined.
|
|
|
|
/// @param Name Union name.
|
|
|
|
/// @param File File where this member is defined.
|
|
|
|
/// @param LineNumber Line number.
|
|
|
|
/// @param SizeInBits Member size.
|
|
|
|
/// @param AlignInBits Member alignment.
|
|
|
|
/// @param Elements Enumeration elements.
|
|
|
|
/// @param UnderlyingType Underlying type of a C++11/ObjC fixed enum.
|
2013-08-28 01:06:40 +02:00
|
|
|
/// @param UniqueIdentifier A unique identifier for the enum.
|
2013-04-19 22:37:09 +02:00
|
|
|
DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
|
2013-08-28 01:06:40 +02:00
|
|
|
DIFile File, unsigned LineNumber, uint64_t SizeInBits,
|
|
|
|
uint64_t AlignInBits, DIArray Elements, DIType UnderlyingType,
|
|
|
|
StringRef UniqueIdentifier = StringRef());
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createSubroutineType - Create subroutine type.
|
2013-12-18 22:48:19 +01:00
|
|
|
/// @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);
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createArtificialType - Create a new DIType with "artificial" flag set.
|
|
|
|
DIType createArtificialType(DIType Ty);
|
2010-12-08 00:25:47 +01:00
|
|
|
|
2012-09-13 01:36:19 +02:00
|
|
|
/// createObjectPointerType - Create a new DIType with the "object pointer"
|
|
|
|
/// flag set.
|
|
|
|
DIType createObjectPointerType(DIType Ty);
|
|
|
|
|
2012-02-08 01:22:26 +01:00
|
|
|
/// createForwardDecl - Create a temporary forward-declared type.
|
2013-08-16 22:42:14 +02:00
|
|
|
DICompositeType createForwardDecl(unsigned Tag, StringRef Name,
|
|
|
|
DIDescriptor Scope, DIFile F,
|
|
|
|
unsigned Line, unsigned RuntimeLang = 0,
|
|
|
|
uint64_t SizeInBits = 0,
|
2013-08-28 01:06:40 +02:00
|
|
|
uint64_t AlignInBits = 0,
|
|
|
|
StringRef UniqueIdentifier = StringRef());
|
2012-02-08 01:22:26 +01:00
|
|
|
|
2013-04-19 22:37:09 +02:00
|
|
|
/// retainType - Retain DIType in a module even if it is not referenced
|
2010-12-08 02:50:15 +01:00
|
|
|
/// through debug info anchors.
|
2011-02-22 19:56:12 +01:00
|
|
|
void retainType(DIType T);
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2014-02-25 20:57:42 +01:00
|
|
|
/// createUnspecifiedParameter - Create unspecified type descriptor
|
2010-12-08 02:50:15 +01:00
|
|
|
/// for a subroutine type.
|
2011-02-22 19:56:12 +01:00
|
|
|
DIDescriptor createUnspecifiedParameter();
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// getOrCreateArray - Get a DIArray, create one if required.
|
2011-04-24 12:11:03 +02:00
|
|
|
DIArray getOrCreateArray(ArrayRef<Value *> Elements);
|
2010-12-08 00:25:47 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
2010-12-08 02:50:15 +01:00
|
|
|
/// implicitly uniques the values returned.
|
2012-12-04 22:34:03 +01:00
|
|
|
DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
|
2010-12-08 02:50:15 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createGlobalVariable - Create a new descriptor for the specified global.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Name Name of the variable.
|
|
|
|
/// @param File File where this variable is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Variable Type.
|
|
|
|
/// @param isLocalToUnit Boolean flag indicate whether this variable is
|
|
|
|
/// externally visible or not.
|
|
|
|
/// @param Val llvm::Value of the variable.
|
|
|
|
DIGlobalVariable
|
2011-02-22 19:56:12 +01:00
|
|
|
createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
|
2010-12-08 00:25:47 +01:00
|
|
|
DIType Ty, bool isLocalToUnit, llvm::Value *Val);
|
|
|
|
|
2013-03-20 18:49:48 +01:00
|
|
|
/// \brief Create a new descriptor for the specified global.
|
|
|
|
/// @param Name Name of the variable.
|
|
|
|
/// @param LinkageName Mangled variable name.
|
|
|
|
/// @param File File where this variable is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Variable Type.
|
|
|
|
/// @param isLocalToUnit Boolean flag indicate whether this variable is
|
|
|
|
/// externally visible or not.
|
|
|
|
/// @param Val llvm::Value of the variable.
|
|
|
|
DIGlobalVariable
|
|
|
|
createGlobalVariable(StringRef Name, StringRef LinkageName, DIFile File,
|
|
|
|
unsigned LineNo, DIType Ty, bool isLocalToUnit,
|
|
|
|
llvm::Value *Val);
|
2010-12-08 00:25:47 +01:00
|
|
|
|
2013-04-19 22:37:09 +02:00
|
|
|
/// createStaticVariable - Create a new descriptor for the specified
|
2010-12-08 00:25:47 +01:00
|
|
|
/// variable.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param Context Variable scope.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Name Name of the variable.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param LinkageName Mangled name of the variable.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param File File where this variable is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Variable Type.
|
|
|
|
/// @param isLocalToUnit Boolean flag indicate whether this variable is
|
|
|
|
/// externally visible or not.
|
|
|
|
/// @param Val llvm::Value of the variable.
|
2013-01-16 02:22:23 +01:00
|
|
|
/// @param Decl Reference to the corresponding declaration.
|
2010-12-08 00:25:47 +01:00
|
|
|
DIGlobalVariable
|
2013-04-19 22:37:09 +02:00
|
|
|
createStaticVariable(DIDescriptor Context, StringRef Name,
|
|
|
|
StringRef LinkageName, DIFile File, unsigned LineNo,
|
2013-01-16 02:22:23 +01:00
|
|
|
DIType Ty, bool isLocalToUnit, llvm::Value *Val,
|
|
|
|
MDNode *Decl = NULL);
|
2010-12-08 00:25:47 +01:00
|
|
|
|
|
|
|
|
2013-04-19 22:37:09 +02:00
|
|
|
/// createLocalVariable - Create a new descriptor for the specified
|
2010-12-08 00:58:00 +01:00
|
|
|
/// local variable.
|
|
|
|
/// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
|
|
|
|
/// DW_TAG_arg_variable.
|
|
|
|
/// @param Scope Variable scope.
|
|
|
|
/// @param Name Variable name.
|
|
|
|
/// @param File File where this variable is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Variable Type
|
|
|
|
/// @param AlwaysPreserve Boolean. Set to true if debug info for this
|
|
|
|
/// variable should be preserved in optimized build.
|
2013-12-18 22:48:11 +01:00
|
|
|
/// @param Flags Flags, e.g. artificial variable.
|
2013-10-22 01:55:19 +02:00
|
|
|
/// @param ArgNo If this variable is an argument then this argument's
|
2011-03-01 23:58:13 +01:00
|
|
|
/// number. 1 indicates 1st argument.
|
2011-02-22 19:56:12 +01:00
|
|
|
DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
2010-12-08 00:58:00 +01:00
|
|
|
StringRef Name,
|
|
|
|
DIFile File, unsigned LineNo,
|
|
|
|
DIType Ty, bool AlwaysPreserve = false,
|
2011-03-01 23:58:13 +01:00
|
|
|
unsigned Flags = 0,
|
|
|
|
unsigned ArgNo = 0);
|
2010-12-08 00:58:00 +01:00
|
|
|
|
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createComplexVariable - Create a new descriptor for the specified
|
2010-12-08 00:25:47 +01:00
|
|
|
/// variable which has a complex address expression for its address.
|
|
|
|
/// @param Tag Dwarf TAG. Usually DW_TAG_auto_variable or
|
|
|
|
/// DW_TAG_arg_variable.
|
|
|
|
/// @param Scope Variable scope.
|
|
|
|
/// @param Name Variable name.
|
2012-08-23 18:54:08 +02:00
|
|
|
/// @param F File where this variable is defined.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Variable Type
|
2011-04-24 12:11:03 +02:00
|
|
|
/// @param Addr An array of complex address operations.
|
2013-10-22 01:55:19 +02:00
|
|
|
/// @param ArgNo If this variable is an argument then this argument's
|
2011-03-01 23:58:13 +01:00
|
|
|
/// number. 1 indicates 1st argument.
|
2011-02-22 19:56:12 +01:00
|
|
|
DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
2010-12-08 00:25:47 +01:00
|
|
|
StringRef Name, DIFile F, unsigned LineNo,
|
2011-04-24 12:11:03 +02:00
|
|
|
DIType Ty, ArrayRef<Value *> Addr,
|
|
|
|
unsigned ArgNo = 0);
|
2010-12-08 00:25:47 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createFunction - Create a new descriptor for the specified subprogram.
|
2010-12-08 21:42:44 +01:00
|
|
|
/// See comments in DISubprogram for descriptions of these fields.
|
|
|
|
/// @param Scope Function scope.
|
|
|
|
/// @param Name Function name.
|
|
|
|
/// @param LinkageName Mangled function name.
|
|
|
|
/// @param File File where this variable is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Function type.
|
2014-01-18 03:12:10 +01:00
|
|
|
/// @param isLocalToUnit True if this function is not externally visible.
|
2010-12-08 21:42:44 +01:00
|
|
|
/// @param isDefinition True if this is a function definition.
|
2012-04-03 02:43:49 +02:00
|
|
|
/// @param ScopeLine Set to the beginning of the scope this starts
|
2010-12-08 21:42:44 +01:00
|
|
|
/// @param Flags e.g. is this function prototyped or not.
|
2013-12-18 22:48:11 +01:00
|
|
|
/// These flags are used to emit dwarf attributes.
|
2010-12-08 21:42:44 +01:00
|
|
|
/// @param isOptimized True if optimization is ON.
|
|
|
|
/// @param Fn llvm::Function pointer.
|
2011-04-06 00:52:06 +02:00
|
|
|
/// @param TParam Function template parameters.
|
2011-02-22 19:56:12 +01:00
|
|
|
DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
|
2010-12-08 21:42:44 +01:00
|
|
|
StringRef LinkageName,
|
|
|
|
DIFile File, unsigned LineNo,
|
2013-05-23 01:22:18 +02:00
|
|
|
DICompositeType Ty, bool isLocalToUnit,
|
2010-12-08 21:42:44 +01:00
|
|
|
bool isDefinition,
|
2012-04-03 02:43:49 +02:00
|
|
|
unsigned ScopeLine,
|
2010-12-08 21:42:44 +01:00
|
|
|
unsigned Flags = 0,
|
|
|
|
bool isOptimized = false,
|
2011-04-06 00:52:06 +02:00
|
|
|
Function *Fn = 0,
|
2013-10-10 20:40:01 +02:00
|
|
|
MDNode *TParam = 0,
|
|
|
|
MDNode *Decl = 0);
|
|
|
|
|
|
|
|
/// 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,
|
|
|
|
DICompositeType Ty, bool isLocalToUnit,
|
|
|
|
bool isDefinition,
|
|
|
|
unsigned ScopeLine,
|
|
|
|
unsigned Flags = 0,
|
|
|
|
bool isOptimized = false,
|
|
|
|
Function *Fn = 0,
|
2011-04-23 01:10:17 +02:00
|
|
|
MDNode *TParam = 0,
|
|
|
|
MDNode *Decl = 0);
|
2010-12-08 21:42:44 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createMethod - Create a new descriptor for the specified C++ method.
|
2010-12-08 21:42:44 +01:00
|
|
|
/// See comments in DISubprogram for descriptions of these fields.
|
|
|
|
/// @param Scope Function scope.
|
|
|
|
/// @param Name Function name.
|
|
|
|
/// @param LinkageName Mangled function name.
|
|
|
|
/// @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 isDefinition True if this is a function definition.
|
2013-04-19 22:37:09 +02:00
|
|
|
/// @param Virtuality Attributes describing virtualness. e.g. pure
|
2010-12-08 21:42:44 +01:00
|
|
|
/// virtual function.
|
|
|
|
/// @param VTableIndex Index no of this method in virtual table.
|
|
|
|
/// @param VTableHolder Type that holds vtable.
|
|
|
|
/// @param Flags e.g. is this function prototyped or not.
|
|
|
|
/// This flags are used to emit dwarf attributes.
|
|
|
|
/// @param isOptimized True if optimization is ON.
|
|
|
|
/// @param Fn llvm::Function pointer.
|
2011-04-06 00:52:06 +02:00
|
|
|
/// @param TParam Function template parameters.
|
2011-02-22 19:56:12 +01:00
|
|
|
DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
|
2010-12-08 21:42:44 +01:00
|
|
|
StringRef LinkageName,
|
|
|
|
DIFile File, unsigned LineNo,
|
2013-05-23 01:22:18 +02:00
|
|
|
DICompositeType Ty, bool isLocalToUnit,
|
2010-12-08 21:42:44 +01:00
|
|
|
bool isDefinition,
|
|
|
|
unsigned Virtuality = 0, unsigned VTableIndex = 0,
|
2013-11-19 00:33:32 +01:00
|
|
|
DIType VTableHolder = DIType(),
|
2010-12-08 21:42:44 +01:00
|
|
|
unsigned Flags = 0,
|
|
|
|
bool isOptimized = false,
|
2011-04-06 00:52:06 +02:00
|
|
|
Function *Fn = 0,
|
|
|
|
MDNode *TParam = 0);
|
2010-12-08 00:25:47 +01:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createNameSpace - This creates new descriptor for a namespace
|
2010-12-08 00:25:47 +01:00
|
|
|
/// with the specified parent scope.
|
|
|
|
/// @param Scope Namespace scope
|
|
|
|
/// @param Name Name of this namespace
|
|
|
|
/// @param File Source file
|
|
|
|
/// @param LineNo Line number
|
2011-02-22 19:56:12 +01:00
|
|
|
DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
|
2010-12-08 00:25:47 +01:00
|
|
|
DIFile File, unsigned LineNo);
|
|
|
|
|
|
|
|
|
2011-10-12 00:59:11 +02:00
|
|
|
/// createLexicalBlockFile - This creates a descriptor for a lexical
|
|
|
|
/// block with a new file attached. This merely extends the existing
|
|
|
|
/// lexical block as it crosses a file.
|
|
|
|
/// @param Scope Lexical block.
|
|
|
|
/// @param File Source file.
|
|
|
|
DILexicalBlockFile createLexicalBlockFile(DIDescriptor Scope,
|
2012-02-08 01:17:07 +01:00
|
|
|
DIFile File);
|
2013-04-19 22:37:09 +02:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// createLexicalBlock - This creates a descriptor for a lexical block
|
2010-12-08 02:50:15 +01:00
|
|
|
/// with the specified parent context.
|
|
|
|
/// @param Scope Parent lexical scope.
|
|
|
|
/// @param File Source file
|
|
|
|
/// @param Line Line number
|
|
|
|
/// @param Col Column number
|
2011-02-22 19:56:12 +01:00
|
|
|
DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
|
2010-12-08 02:50:15 +01:00
|
|
|
unsigned Line, unsigned Col);
|
|
|
|
|
2013-04-22 08:12:31 +02:00
|
|
|
/// \brief Create a descriptor for an imported module.
|
|
|
|
/// @param Context The scope this module is imported into
|
|
|
|
/// @param NS The namespace being imported here
|
2013-04-22 17:21:03 +02:00
|
|
|
/// @param Line Line number
|
2013-05-07 23:35:53 +02:00
|
|
|
DIImportedEntity createImportedModule(DIScope Context, DINameSpace NS,
|
2013-05-21 00:50:35 +02:00
|
|
|
unsigned Line,
|
|
|
|
StringRef Name = StringRef());
|
2013-04-22 08:12:31 +02:00
|
|
|
|
2013-05-21 00:50:35 +02:00
|
|
|
/// \brief Create a descriptor for an imported module.
|
|
|
|
/// @param Context The scope this module is imported into
|
|
|
|
/// @param NS An aliased namespace
|
|
|
|
/// @param Line Line number
|
|
|
|
DIImportedEntity createImportedModule(DIScope Context, DIImportedEntity NS,
|
|
|
|
unsigned Line, StringRef Name);
|
|
|
|
|
2013-05-07 23:35:53 +02:00
|
|
|
/// \brief Create a descriptor for an imported function.
|
|
|
|
/// @param Context The scope this module is imported into
|
|
|
|
/// @param Decl The declaration (or definition) of a function, type, or
|
|
|
|
/// variable
|
|
|
|
/// @param Line Line number
|
|
|
|
DIImportedEntity createImportedDeclaration(DIScope Context,
|
|
|
|
DIDescriptor Decl,
|
|
|
|
unsigned Line);
|
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Storage llvm::Value of the variable
|
|
|
|
/// @param VarInfo Variable's debug info descriptor.
|
|
|
|
/// @param InsertAtEnd Location for the new intrinsic.
|
2011-02-22 19:56:12 +01:00
|
|
|
Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
|
2010-12-08 00:25:47 +01:00
|
|
|
BasicBlock *InsertAtEnd);
|
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Storage llvm::Value of the variable
|
|
|
|
/// @param VarInfo Variable's debug info descriptor.
|
|
|
|
/// @param InsertBefore Location for the new intrinsic.
|
2011-02-22 19:56:12 +01:00
|
|
|
Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
|
2010-12-08 00:25:47 +01:00
|
|
|
Instruction *InsertBefore);
|
|
|
|
|
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Val llvm::Value of the variable
|
|
|
|
/// @param Offset Offset
|
|
|
|
/// @param VarInfo Variable's debug info descriptor.
|
|
|
|
/// @param InsertAtEnd Location for the new intrinsic.
|
2011-02-22 19:56:12 +01:00
|
|
|
Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
|
2013-04-19 22:37:09 +02:00
|
|
|
DIVariable VarInfo,
|
2010-12-08 00:25:47 +01:00
|
|
|
BasicBlock *InsertAtEnd);
|
2013-04-19 22:37:09 +02:00
|
|
|
|
2011-02-22 19:56:12 +01:00
|
|
|
/// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
|
2010-12-08 00:25:47 +01:00
|
|
|
/// @param Val llvm::Value of the variable
|
|
|
|
/// @param Offset Offset
|
|
|
|
/// @param VarInfo Variable's debug info descriptor.
|
|
|
|
/// @param InsertBefore Location for the new intrinsic.
|
2011-02-22 19:56:12 +01:00
|
|
|
Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
|
2013-04-19 22:37:09 +02:00
|
|
|
DIVariable VarInfo,
|
2010-12-08 00:25:47 +01:00
|
|
|
Instruction *InsertBefore);
|
|
|
|
|
Introduce DIBuilder. It is intended to be a front-end friendly interface to emit debuggging information entries in LLVM IR.
To create debugging information for a pointer, using DIBUilder front-end just needs
DBuilder.CreatePointerType(Ty, Size);
instead of
DebugFactory.CreateDerivedType(llvm::dwarf::DW_TAG_pointer_type,
TheCU, "", getOrCreateMainFile(),
0, Size, 0, 0, 0, OCTy);
llvm-svn: 118248
2010-11-04 16:01:38 +01:00
|
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|