2012-06-29 08:32:07 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00: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 20:37:09 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
// information entries in LLVM IR form.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2013-01-10 00:45:19 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-04-24 10:11:03 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
#include "llvm/ADT/StringRef.h"
|
2012-12-03 17:02:12 +00:00
|
|
|
#include "llvm/Support/DataTypes.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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
|
|
|
namespace llvm {
|
2010-12-07 23:25:47 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
class Module;
|
2010-12-07 23:25:47 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
class LLVMContext;
|
|
|
|
class MDNode;
|
|
|
|
class StringRef;
|
2013-02-12 00:40:41 +00:00
|
|
|
class DIBasicType;
|
2013-02-18 06:41:57 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
class DIDescriptor;
|
|
|
|
class DIFile;
|
|
|
|
class DIEnumerator;
|
|
|
|
class DIType;
|
2010-12-07 23:25:47 +00:00
|
|
|
class DIArray;
|
|
|
|
class DIGlobalVariable;
|
2013-05-07 21:35:53 +00:00
|
|
|
class DIImportedEntity;
|
2010-12-07 23:25:47 +00:00
|
|
|
class DINameSpace;
|
|
|
|
class DIVariable;
|
2010-12-08 01:50:15 +00:00
|
|
|
class DISubrange;
|
2011-10-11 22:59:11 +00:00
|
|
|
class DILexicalBlockFile;
|
2010-12-08 01:50:15 +00:00
|
|
|
class DILexicalBlock;
|
2013-04-22 06:12:31 +00:00
|
|
|
class DIScope;
|
2010-12-08 20:42:44 +00:00
|
|
|
class DISubprogram;
|
2011-02-02 21:38:25 +00:00
|
|
|
class DITemplateTypeParameter;
|
2011-02-02 22:35:53 +00:00
|
|
|
class DITemplateValueParameter;
|
2012-02-04 00:59:25 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
|
|
|
class DIBuilder {
|
|
|
|
private:
|
|
|
|
Module &M;
|
|
|
|
LLVMContext & VMContext;
|
|
|
|
MDNode *TheCU;
|
|
|
|
|
2011-08-16 22:09:43 +00:00
|
|
|
MDNode *TempEnumTypes;
|
|
|
|
MDNode *TempRetainTypes;
|
|
|
|
MDNode *TempSubprograms;
|
|
|
|
MDNode *TempGVs;
|
2013-04-22 06:12:31 +00:00
|
|
|
MDNode *TempImportedModules;
|
2011-08-16 22:09:43 +00:00
|
|
|
|
2010-12-07 23:25:47 +00:00
|
|
|
Function *DeclareFn; // llvm.dbg.declare
|
|
|
|
Function *ValueFn; // llvm.dbg.value
|
|
|
|
|
2011-08-16 22:09:43 +00:00
|
|
|
SmallVector<Value *, 4> AllEnumTypes;
|
|
|
|
SmallVector<Value *, 4> AllRetainTypes;
|
|
|
|
SmallVector<Value *, 4> AllSubprograms;
|
|
|
|
SmallVector<Value *, 4> AllGVs;
|
2013-04-22 06:12:31 +00:00
|
|
|
SmallVector<Value *, 4> AllImportedModules;
|
2011-08-16 22:09:43 +00:00
|
|
|
|
2012-09-17 07:16:40 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
explicit DIBuilder(Module &M);
|
|
|
|
const MDNode *getCU() { return TheCU; }
|
2011-02-18 23:28:53 +00:00
|
|
|
enum ComplexAddrKind { OpPlus=1, OpDeref };
|
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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-08-15 23:00:00 +00:00
|
|
|
/// finalize - Construct any deferred debug info descriptors.
|
|
|
|
void finalize();
|
|
|
|
|
2011-02-22 18:56:12 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
/// information generated during this instance of compilation.
|
2010-11-08 18:28:34 +00:00
|
|
|
/// @param Lang Source programming language, eg. dwarf::DW_LANG_C99
|
|
|
|
/// @param File File name
|
|
|
|
/// @param Dir Directory
|
2013-04-19 20:37:09 +00:00
|
|
|
/// @param Producer String identify producer of debugging information.
|
2010-11-08 18:28:34 +00:00
|
|
|
/// Usuall this is a compiler version string.
|
|
|
|
/// @param isOptimized A boolean flag which indicates whether optimization
|
|
|
|
/// is ON or not.
|
2013-04-19 20:37:09 +00:00
|
|
|
/// @param Flags This string lists command line options. This string is
|
2010-11-08 18:28:34 +00:00
|
|
|
/// directly embedded in debug info output which may be used
|
|
|
|
/// by a tool analyzing generated debugging information.
|
2013-04-19 20:37:09 +00:00
|
|
|
/// @param RV This indicates runtime version for languages like
|
2010-11-08 18:28:34 +00:00
|
|
|
/// Objective-C.
|
2013-02-22 23:50:04 +00:00
|
|
|
/// @param SplitName The name of the file that we'll split debug info out
|
|
|
|
/// into.
|
2013-04-19 20:37:09 +00:00
|
|
|
void createCompileUnit(unsigned Lang, StringRef File, StringRef Dir,
|
2013-02-22 23:50:04 +00:00
|
|
|
StringRef Producer, bool isOptimized,
|
|
|
|
StringRef Flags, unsigned RV,
|
|
|
|
StringRef SplitName = 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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
/// for a file.
|
2011-02-22 18:56:12 +00:00
|
|
|
DIFile createFile(StringRef Filename, StringRef Directory);
|
2013-04-19 20:37:09 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createEnumerator - Create a single enumerator value.
|
|
|
|
DIEnumerator createEnumerator(StringRef Name, uint64_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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-09-14 23:13:28 +00:00
|
|
|
/// createNullPtrType - Create C++0x nullptr type.
|
2013-06-07 18:35:53 +00:00
|
|
|
DIBasicType createNullPtrType(StringRef Name);
|
2011-09-14 23:13:28 +00:00
|
|
|
|
2013-04-19 20:37:09 +00:00
|
|
|
/// createBasicType - Create debugging information entry for a basic
|
2010-11-08 18:28:34 +00: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 00:40:41 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
/// type, e.g. 'const int'.
|
2010-11-08 18:28:34 +00:00
|
|
|
/// @param Tag Tag identifing type, e.g. dwarf::TAG_volatile_type
|
|
|
|
/// @param FromTy Base Type.
|
2013-02-18 06:41:57 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createPointerType - Create debugging information entry for a pointer.
|
2010-12-07 23:25:47 +00:00
|
|
|
/// @param PointeeTy Type pointed by this pointer.
|
|
|
|
/// @param SizeInBits Size.
|
|
|
|
/// @param AlignInBits Alignment. (optional)
|
|
|
|
/// @param Name Pointer type name. (optional)
|
2013-02-18 06:41:57 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2013-01-07 05:51:15 +00: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 06:41:57 +00:00
|
|
|
DIDerivedType createMemberPointerType(DIType PointeeTy, DIType Class);
|
2013-01-07 05:51:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createReferenceType - Create debugging information entry for a c++
|
2012-05-19 01:36:37 +00:00
|
|
|
/// style reference or rvalue reference type.
|
2013-02-18 06:41:57 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createTypedef - Create debugging information entry for a typedef.
|
2010-12-07 23:25:47 +00:00
|
|
|
/// @param Ty Original type.
|
|
|
|
/// @param Name Typedef name.
|
|
|
|
/// @param File File where this type is defined.
|
|
|
|
/// @param LineNo Line number.
|
2011-06-03 17:04:51 +00:00
|
|
|
/// @param Context The surrounding context for the typedef.
|
2013-02-18 06:41:57 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createFriend - Create debugging information entry for a 'friend'.
|
2013-06-07 18:35:53 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createInheritance - Create debugging information entry to establish
|
2010-11-08 18:28:34 +00:00
|
|
|
/// inheritance relationship between two types.
|
2010-12-07 23:25:47 +00:00
|
|
|
/// @param Ty Original type.
|
|
|
|
/// @param BaseTy Base type. Ty is inherits from base.
|
|
|
|
/// @param BaseOffset Base offset.
|
2013-04-19 20:37:09 +00:00
|
|
|
/// @param Flags Flags to describe inheritance attribute,
|
2010-12-07 23:25:47 +00:00
|
|
|
/// e.g. private
|
2013-02-18 06:41:57 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createMemberType - Create debugging information entry for a member.
|
2011-06-24 22:00:39 +00:00
|
|
|
/// @param Scope Member scope.
|
2010-12-07 23:25:47 +00: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 06:41:57 +00:00
|
|
|
DIDerivedType
|
|
|
|
createMemberType(DIDescriptor Scope, StringRef Name, DIFile File,
|
|
|
|
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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
|
2013-01-16 01:22:23 +00: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 18:35:53 +00:00
|
|
|
DIDerivedType
|
|
|
|
createStaticMemberType(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIFile File, unsigned LineNo, DIType Ty,
|
|
|
|
unsigned Flags, llvm::Value *Val);
|
2013-01-16 01:22:23 +00:00
|
|
|
|
2011-04-16 00:11:51 +00: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 10:20:22 +00:00
|
|
|
/// @param PropertyName Name of the Objective C property associated with
|
2011-04-16 00:11:51 +00:00
|
|
|
/// this ivar.
|
2012-08-23 16:54:08 +00:00
|
|
|
/// @param PropertyGetterName Name of the Objective C property getter
|
|
|
|
/// selector.
|
|
|
|
/// @param PropertySetterName Name of the Objective C property setter
|
|
|
|
/// selector.
|
2011-04-16 00:11:51 +00:00
|
|
|
/// @param PropertyAttributes Objective C property attributes.
|
2013-06-07 18:35:53 +00: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 00:11:51 +00:00
|
|
|
|
2012-02-06 17:49:43 +00: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 16:54:08 +00:00
|
|
|
/// @param PropertyNode Property associated with this ivar.
|
2013-06-07 18:35:53 +00: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 17:49:43 +00:00
|
|
|
|
2012-02-04 00:59:25 +00:00
|
|
|
/// createObjCProperty - Create debugging information entry for Objective-C
|
|
|
|
/// property.
|
|
|
|
/// @param Name Property name.
|
2012-03-29 08:42:56 +00:00
|
|
|
/// @param File File where this property is defined.
|
|
|
|
/// @param LineNumber Line number.
|
2012-02-04 00:59:25 +00: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 08:42:56 +00:00
|
|
|
/// @param Ty Type.
|
|
|
|
DIObjCProperty createObjCProperty(StringRef Name,
|
2012-07-19 00:01:00 +00:00
|
|
|
DIFile File, unsigned LineNumber,
|
|
|
|
StringRef GetterName,
|
|
|
|
StringRef SetterName,
|
|
|
|
unsigned PropertyAttributes,
|
|
|
|
DIType Ty);
|
2013-04-19 20:37:09 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createClassType - Create debugging information entry for a class.
|
2010-12-08 20:18:20 +00: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 16:54:08 +00:00
|
|
|
/// @param LineNumber Line number.
|
2010-12-08 20:18:20 +00: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 20:37:09 +00:00
|
|
|
/// for this type. This is used in
|
2010-12-08 20:18:20 +00:00
|
|
|
/// DW_AT_containing_type. See DWARF documentation
|
|
|
|
/// for more info.
|
2011-02-02 21:38:25 +00:00
|
|
|
/// @param TemplateParms Template type parameters.
|
2013-03-26 23:46:39 +00: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,
|
|
|
|
MDNode *VTableHolder = 0,
|
|
|
|
MDNode *TemplateParms = 0);
|
2010-12-08 20:18:20 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createStructType - Create debugging information entry for a struct.
|
2010-12-08 01:50:15 +00: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 16:54:08 +00:00
|
|
|
/// @param LineNumber Line number.
|
2010-12-08 01:50:15 +00: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-02-25 01:07:18 +00: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,
|
|
|
|
MDNode *VTableHolder = 0);
|
2010-12-07 23:25:47 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createUnionType - Create debugging information entry for an union.
|
2010-12-08 01:50:15 +00: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 16:54:08 +00:00
|
|
|
/// @param LineNumber Line number.
|
2010-12-08 01:50:15 +00: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-02-18 06:41:57 +00:00
|
|
|
DICompositeType createUnionType(
|
|
|
|
DIDescriptor Scope, StringRef Name, DIFile File, unsigned LineNumber,
|
|
|
|
uint64_t SizeInBits, uint64_t AlignInBits, unsigned Flags,
|
|
|
|
DIArray Elements, unsigned RunTimeLang = 0);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createTemplateTypeParameter - Create debugging information for template
|
2011-02-02 21:38:25 +00:00
|
|
|
/// type parameter.
|
2011-02-02 22:35:53 +00:00
|
|
|
/// @param Scope Scope in which this type is defined.
|
2011-02-02 21:38:25 +00: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 18:56:12 +00:00
|
|
|
createTemplateTypeParameter(DIDescriptor Scope, StringRef Name, DIType Ty,
|
2011-02-02 21:38:25 +00:00
|
|
|
MDNode *File = 0, unsigned LineNo = 0,
|
|
|
|
unsigned ColumnNo = 0);
|
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createTemplateValueParameter - Create debugging information for template
|
2011-02-02 22:35:53 +00:00
|
|
|
/// value parameter.
|
|
|
|
/// @param Scope Scope in which this type is defined.
|
|
|
|
/// @param Name Value parameter name.
|
|
|
|
/// @param Ty Parameter type.
|
2013-05-11 19:14:10 +00:00
|
|
|
/// @param Val Constant parameter value.
|
2011-02-02 22:35:53 +00:00
|
|
|
/// @param File File where this type parameter is defined.
|
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param ColumnNo Column Number.
|
|
|
|
DITemplateValueParameter
|
2013-05-10 21:52:07 +00:00
|
|
|
createTemplateValueParameter(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIType Ty, Value *Val, MDNode *File = 0,
|
|
|
|
unsigned LineNo = 0, unsigned ColumnNo = 0);
|
2011-02-02 22:35:53 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createArrayType - Create debugging information entry for an array.
|
2010-12-08 01:50:15 +00:00
|
|
|
/// @param Size Array size.
|
|
|
|
/// @param AlignInBits Alignment.
|
|
|
|
/// @param Ty Element type.
|
|
|
|
/// @param Subscripts Subscripts.
|
2013-02-18 06:41:57 +00:00
|
|
|
DICompositeType createArrayType(uint64_t Size, uint64_t AlignInBits,
|
|
|
|
DIType Ty, DIArray Subscripts);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createVectorType - Create debugging information entry for a vector type.
|
2010-12-08 01:50:15 +00:00
|
|
|
/// @param Size Array size.
|
|
|
|
/// @param AlignInBits Alignment.
|
|
|
|
/// @param Ty Element type.
|
|
|
|
/// @param Subscripts Subscripts.
|
2013-06-07 03:13:46 +00:00
|
|
|
DICompositeType createVectorType(uint64_t Size, uint64_t AlignInBits,
|
|
|
|
DIType Ty, DIArray Subscripts);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2013-04-19 19:56:02 +00:00
|
|
|
/// createEnumerationType - Create debugging information entry for an
|
2010-12-08 01:50:15 +00:00
|
|
|
/// enumeration.
|
2013-04-19 19:56:02 +00: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-04-19 20:37:09 +00:00
|
|
|
DICompositeType createEnumerationType(DIDescriptor Scope, StringRef Name,
|
|
|
|
DIFile File, unsigned LineNumber,
|
|
|
|
uint64_t SizeInBits,
|
|
|
|
uint64_t AlignInBits,
|
|
|
|
DIArray Elements,
|
|
|
|
DIType UnderlyingType);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createSubroutineType - Create subroutine type.
|
2012-08-23 16:54:08 +00: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.
|
2013-02-18 06:41:57 +00:00
|
|
|
DICompositeType createSubroutineType(DIFile File, DIArray ParameterTypes);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createArtificialType - Create a new DIType with "artificial" flag set.
|
|
|
|
DIType createArtificialType(DIType Ty);
|
2010-12-07 23:25:47 +00:00
|
|
|
|
2012-09-12 23:36:19 +00:00
|
|
|
/// createObjectPointerType - Create a new DIType with the "object pointer"
|
|
|
|
/// flag set.
|
|
|
|
DIType createObjectPointerType(DIType Ty);
|
|
|
|
|
2012-02-08 00:22:26 +00:00
|
|
|
/// createForwardDecl - Create a temporary forward-declared type.
|
2012-04-23 19:00:11 +00:00
|
|
|
DIType createForwardDecl(unsigned Tag, StringRef Name, DIDescriptor Scope,
|
2012-10-05 01:49:14 +00:00
|
|
|
DIFile F, unsigned Line, unsigned RuntimeLang = 0,
|
|
|
|
uint64_t SizeInBits = 0, uint64_t AlignInBits = 0);
|
2012-02-08 00:22:26 +00:00
|
|
|
|
2013-04-19 20:37:09 +00:00
|
|
|
/// retainType - Retain DIType in a module even if it is not referenced
|
2010-12-08 01:50:15 +00:00
|
|
|
/// through debug info anchors.
|
2011-02-22 18:56:12 +00:00
|
|
|
void retainType(DIType T);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createUnspecifiedParameter - Create unspeicified type descriptor
|
2010-12-08 01:50:15 +00:00
|
|
|
/// for a subroutine type.
|
2011-02-22 18:56:12 +00:00
|
|
|
DIDescriptor createUnspecifiedParameter();
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// getOrCreateArray - Get a DIArray, create one if required.
|
2011-04-24 10:11:03 +00:00
|
|
|
DIArray getOrCreateArray(ArrayRef<Value *> Elements);
|
2010-12-07 23:25:47 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// getOrCreateSubrange - Create a descriptor for a value range. This
|
2010-12-08 01:50:15 +00:00
|
|
|
/// implicitly uniques the values returned.
|
2012-12-04 21:34:03 +00:00
|
|
|
DISubrange getOrCreateSubrange(int64_t Lo, int64_t Count);
|
2010-12-08 01:50:15 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createGlobalVariable - Create a new descriptor for the specified global.
|
2010-12-07 23:25:47 +00: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 18:56:12 +00:00
|
|
|
createGlobalVariable(StringRef Name, DIFile File, unsigned LineNo,
|
2010-12-07 23:25:47 +00:00
|
|
|
DIType Ty, bool isLocalToUnit, llvm::Value *Val);
|
|
|
|
|
2013-03-20 17:49:48 +00: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-07 23:25:47 +00:00
|
|
|
|
2013-04-19 20:37:09 +00:00
|
|
|
/// createStaticVariable - Create a new descriptor for the specified
|
2010-12-07 23:25:47 +00:00
|
|
|
/// variable.
|
2012-08-23 16:54:08 +00:00
|
|
|
/// @param Context Variable scope.
|
2010-12-07 23:25:47 +00:00
|
|
|
/// @param Name Name of the variable.
|
2012-08-23 16:54:08 +00:00
|
|
|
/// @param LinkageName Mangled name of the variable.
|
2010-12-07 23:25:47 +00: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 01:22:23 +00:00
|
|
|
/// @param Decl Reference to the corresponding declaration.
|
2010-12-07 23:25:47 +00:00
|
|
|
DIGlobalVariable
|
2013-04-19 20:37:09 +00:00
|
|
|
createStaticVariable(DIDescriptor Context, StringRef Name,
|
|
|
|
StringRef LinkageName, DIFile File, unsigned LineNo,
|
2013-01-16 01:22:23 +00:00
|
|
|
DIType Ty, bool isLocalToUnit, llvm::Value *Val,
|
|
|
|
MDNode *Decl = NULL);
|
2010-12-07 23:25:47 +00:00
|
|
|
|
|
|
|
|
2013-04-19 20:37:09 +00:00
|
|
|
/// createLocalVariable - Create a new descriptor for the specified
|
2010-12-07 23:58:00 +00: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.
|
|
|
|
/// @param Flags Flags, e.g. artificial variable.
|
2011-03-01 22:58:13 +00:00
|
|
|
/// @param ArgNo If this variable is an arugment then this argument's
|
|
|
|
/// number. 1 indicates 1st argument.
|
2011-02-22 18:56:12 +00:00
|
|
|
DIVariable createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
2010-12-07 23:58:00 +00:00
|
|
|
StringRef Name,
|
|
|
|
DIFile File, unsigned LineNo,
|
|
|
|
DIType Ty, bool AlwaysPreserve = false,
|
2011-03-01 22:58:13 +00:00
|
|
|
unsigned Flags = 0,
|
|
|
|
unsigned ArgNo = 0);
|
2010-12-07 23:58:00 +00:00
|
|
|
|
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createComplexVariable - Create a new descriptor for the specified
|
2010-12-07 23:25:47 +00: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 16:54:08 +00:00
|
|
|
/// @param F File where this variable is defined.
|
2010-12-07 23:25:47 +00:00
|
|
|
/// @param LineNo Line number.
|
|
|
|
/// @param Ty Variable Type
|
2011-04-24 10:11:03 +00:00
|
|
|
/// @param Addr An array of complex address operations.
|
2011-03-01 22:58:13 +00:00
|
|
|
/// @param ArgNo If this variable is an arugment then this argument's
|
|
|
|
/// number. 1 indicates 1st argument.
|
2011-02-22 18:56:12 +00:00
|
|
|
DIVariable createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
2010-12-07 23:25:47 +00:00
|
|
|
StringRef Name, DIFile F, unsigned LineNo,
|
2011-04-24 10:11:03 +00:00
|
|
|
DIType Ty, ArrayRef<Value *> Addr,
|
|
|
|
unsigned ArgNo = 0);
|
2010-12-07 23:25:47 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createFunction - Create a new descriptor for the specified subprogram.
|
2010-12-08 20:42:44 +00: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.
|
2012-04-03 00:43:49 +00:00
|
|
|
/// @param ScopeLine Set to the beginning of the scope this starts
|
2010-12-08 20:42:44 +00:00
|
|
|
/// @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-05 22:52:06 +00:00
|
|
|
/// @param TParam Function template parameters.
|
2011-02-22 18:56:12 +00:00
|
|
|
DISubprogram createFunction(DIDescriptor Scope, StringRef Name,
|
2010-12-08 20:42:44 +00:00
|
|
|
StringRef LinkageName,
|
|
|
|
DIFile File, unsigned LineNo,
|
2013-05-22 23:22:18 +00:00
|
|
|
DICompositeType Ty, bool isLocalToUnit,
|
2010-12-08 20:42:44 +00:00
|
|
|
bool isDefinition,
|
2012-04-03 00:43:49 +00:00
|
|
|
unsigned ScopeLine,
|
2010-12-08 20:42:44 +00:00
|
|
|
unsigned Flags = 0,
|
|
|
|
bool isOptimized = false,
|
2011-04-05 22:52:06 +00:00
|
|
|
Function *Fn = 0,
|
2011-04-22 23:10:17 +00:00
|
|
|
MDNode *TParam = 0,
|
|
|
|
MDNode *Decl = 0);
|
2010-12-08 20:42:44 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createMethod - Create a new descriptor for the specified C++ method.
|
2010-12-08 20:42:44 +00: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 20:37:09 +00:00
|
|
|
/// @param Virtuality Attributes describing virtualness. e.g. pure
|
2010-12-08 20:42:44 +00: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-05 22:52:06 +00:00
|
|
|
/// @param TParam Function template parameters.
|
2011-02-22 18:56:12 +00:00
|
|
|
DISubprogram createMethod(DIDescriptor Scope, StringRef Name,
|
2010-12-08 20:42:44 +00:00
|
|
|
StringRef LinkageName,
|
|
|
|
DIFile File, unsigned LineNo,
|
2013-05-22 23:22:18 +00:00
|
|
|
DICompositeType Ty, bool isLocalToUnit,
|
2010-12-08 20:42:44 +00:00
|
|
|
bool isDefinition,
|
|
|
|
unsigned Virtuality = 0, unsigned VTableIndex = 0,
|
|
|
|
MDNode *VTableHolder = 0,
|
|
|
|
unsigned Flags = 0,
|
|
|
|
bool isOptimized = false,
|
2011-04-05 22:52:06 +00:00
|
|
|
Function *Fn = 0,
|
|
|
|
MDNode *TParam = 0);
|
2010-12-07 23:25:47 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createNameSpace - This creates new descriptor for a namespace
|
2010-12-07 23:25:47 +00: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 18:56:12 +00:00
|
|
|
DINameSpace createNameSpace(DIDescriptor Scope, StringRef Name,
|
2010-12-07 23:25:47 +00:00
|
|
|
DIFile File, unsigned LineNo);
|
|
|
|
|
|
|
|
|
2011-10-11 22:59:11 +00: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 00:17:07 +00:00
|
|
|
DIFile File);
|
2013-04-19 20:37:09 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// createLexicalBlock - This creates a descriptor for a lexical block
|
2010-12-08 01:50:15 +00: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 18:56:12 +00:00
|
|
|
DILexicalBlock createLexicalBlock(DIDescriptor Scope, DIFile File,
|
2010-12-08 01:50:15 +00:00
|
|
|
unsigned Line, unsigned Col);
|
|
|
|
|
2013-04-22 06:12:31 +00: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 15:21:03 +00:00
|
|
|
/// @param Line Line number
|
2013-05-07 21:35:53 +00:00
|
|
|
DIImportedEntity createImportedModule(DIScope Context, DINameSpace NS,
|
2013-05-20 22:50:35 +00:00
|
|
|
unsigned Line,
|
|
|
|
StringRef Name = StringRef());
|
2013-04-22 06:12:31 +00:00
|
|
|
|
2013-05-20 22:50:35 +00: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 21:35:53 +00: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 18:56:12 +00:00
|
|
|
/// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
2010-12-07 23:25:47 +00: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 18:56:12 +00:00
|
|
|
Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
|
2010-12-07 23:25:47 +00:00
|
|
|
BasicBlock *InsertAtEnd);
|
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// insertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
2010-12-07 23:25:47 +00: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 18:56:12 +00:00
|
|
|
Instruction *insertDeclare(llvm::Value *Storage, DIVariable VarInfo,
|
2010-12-07 23:25:47 +00:00
|
|
|
Instruction *InsertBefore);
|
|
|
|
|
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
|
2010-12-07 23:25:47 +00: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 18:56:12 +00:00
|
|
|
Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
|
2013-04-19 20:37:09 +00:00
|
|
|
DIVariable VarInfo,
|
2010-12-07 23:25:47 +00:00
|
|
|
BasicBlock *InsertAtEnd);
|
2013-04-19 20:37:09 +00:00
|
|
|
|
2011-02-22 18:56:12 +00:00
|
|
|
/// insertDbgValueIntrinsic - Insert a new llvm.dbg.value intrinsic call.
|
2010-12-07 23:25:47 +00: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 18:56:12 +00:00
|
|
|
Instruction *insertDbgValueIntrinsic(llvm::Value *Val, uint64_t Offset,
|
2013-04-19 20:37:09 +00:00
|
|
|
DIVariable VarInfo,
|
2010-12-07 23:25:47 +00: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);
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118248 91177308-0d34-0410-b5e6-96231b3b80d8
2010-11-04 15:01:38 +00:00
|
|
|
};
|
|
|
|
} // end namespace llvm
|
|
|
|
|
|
|
|
#endif
|