mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
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
This commit is contained in:
94
include/llvm/Analysis/DIBuilder.h
Normal file
94
include/llvm/Analysis/DIBuilder.h
Normal file
@@ -0,0 +1,94 @@
|
||||
//===--- llvm/Analysis/DIBuilder.h - Debug Information Builder --*- C++ -*-===//
|
||||
//
|
||||
// The LLVM Compiler Infrastructure
|
||||
//
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// This file defines a DIBuilder that is useful for creating debugging
|
||||
// information entries in LLVM IR form.
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef LLVM_ANALYSIS_DIBUILDER_H
|
||||
#define LLVM_ANALYSIS_DIBUILDER_H
|
||||
|
||||
#include "llvm/System/DataTypes.h"
|
||||
#include "llvm/ADT/StringRef.h"
|
||||
|
||||
namespace llvm {
|
||||
class Module;
|
||||
class LLVMContext;
|
||||
class MDNode;
|
||||
class StringRef;
|
||||
class DIDescriptor;
|
||||
class DIFile;
|
||||
class DIEnumerator;
|
||||
class DIType;
|
||||
|
||||
class DIBuilder {
|
||||
private:
|
||||
Module &M;
|
||||
LLVMContext & VMContext;
|
||||
MDNode *TheCU;
|
||||
|
||||
DIBuilder(const DIBuilder &); // DO NOT IMPLEMENT
|
||||
void operator=(const DIBuilder &); // DO NOT IMPLEMENT
|
||||
|
||||
public:
|
||||
explicit DIBuilder(Module &M);
|
||||
const MDNode *getCU() { return TheCU; }
|
||||
|
||||
/// CreateCompileUnit - A CompileUnit provides an anchor for all debugging
|
||||
/// information generated during this instance of compilation.
|
||||
void CreateCompileUnit(unsigned Lang, StringRef F, StringRef D, StringRef P,
|
||||
bool isOptimized, StringRef Flags, unsigned RV);
|
||||
|
||||
/// CreateFile - Create a file descriptor to hold debugging information
|
||||
/// for a file.
|
||||
DIFile CreateFile(StringRef Filename, StringRef Directory);
|
||||
|
||||
/// CreateEnumerator - Create a single enumerator value.
|
||||
DIEnumerator CreateEnumerator(StringRef Name, uint64_t Val);
|
||||
|
||||
/// CreateBasicType - Create debugging information entry for a basic
|
||||
/// type, e.g 'char'.
|
||||
DIType CreateBasicType(StringRef Name, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, unsigned Encoding);
|
||||
|
||||
/// CreateQaulifiedType - Create debugging information entry for a qualified
|
||||
/// type, e.g. 'const int'.
|
||||
DIType CreateQualifiedType(unsigned Tag, DIType FromTy);
|
||||
|
||||
/// CreatePointerType - Create debugging information entry for a pointer.
|
||||
DIType CreatePointerType(DIType PointeeTy, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits = 0, StringRef Name = StringRef());
|
||||
|
||||
/// CreateReferenceType - Create debugging information entry for a reference.
|
||||
DIType CreateReferenceType(DIType RTy);
|
||||
|
||||
/// CreateTypedef - Create debugging information entry for a typedef.
|
||||
DIType CreateTypedef(DIType Ty, StringRef Name, DIFile F, unsigned LineNo);
|
||||
|
||||
/// CreateFriend - Create debugging information entry for a 'friend'.
|
||||
DIType CreateFriend(DIType Ty, DIType FriendTy);
|
||||
|
||||
/// CreateInheritance - Create debugging information entry to establish
|
||||
/// inheritnace relationship between two types.
|
||||
DIType CreateInheritance(DIType Ty, DIType BaseTy, uint64_t BaseOffset,
|
||||
unsigned Flags);
|
||||
|
||||
/// CreateMemberType - Create debugging information entry for a member.
|
||||
DIType CreateMemberType(DIDescriptor Context, StringRef Name, DIFile F,
|
||||
unsigned LineNumber, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
unsigned Flags, DIType Ty);
|
||||
|
||||
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
|
||||
DIType CreateArtificialType(DIType Ty);
|
||||
};
|
||||
} // end namespace llvm
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user