mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Do not use StringRef in DebugInfo interface.
This allows StringRef to skip controversial if(str) check in constructor. Buildbots, wait for corresponding clang and llvm-gcc FE check-ins! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86914 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -496,26 +496,26 @@ namespace llvm {
|
|||||||
/// CreateCompileUnit - Create a new descriptor for the specified compile
|
/// CreateCompileUnit - Create a new descriptor for the specified compile
|
||||||
/// unit.
|
/// unit.
|
||||||
DICompileUnit CreateCompileUnit(unsigned LangID,
|
DICompileUnit CreateCompileUnit(unsigned LangID,
|
||||||
StringRef Filenae,
|
const char * Filename,
|
||||||
StringRef Directory,
|
const char * Directory,
|
||||||
StringRef Producer,
|
const char * Producer,
|
||||||
bool isMain = false,
|
bool isMain = false,
|
||||||
bool isOptimized = false,
|
bool isOptimized = false,
|
||||||
const char *Flags = "",
|
const char *Flags = "",
|
||||||
unsigned RunTimeVer = 0);
|
unsigned RunTimeVer = 0);
|
||||||
|
|
||||||
/// CreateEnumerator - Create a single enumerator value.
|
/// CreateEnumerator - Create a single enumerator value.
|
||||||
DIEnumerator CreateEnumerator(StringRef Name, uint64_t Val);
|
DIEnumerator CreateEnumerator(const char * Name, uint64_t Val);
|
||||||
|
|
||||||
/// CreateBasicType - Create a basic type like int, float, etc.
|
/// CreateBasicType - Create a basic type like int, float, etc.
|
||||||
DIBasicType CreateBasicType(DIDescriptor Context, StringRef Name,
|
DIBasicType CreateBasicType(DIDescriptor Context, const char * Name,
|
||||||
DICompileUnit CompileUnit, unsigned LineNumber,
|
DICompileUnit CompileUnit, unsigned LineNumber,
|
||||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
uint64_t OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
unsigned Encoding);
|
unsigned Encoding);
|
||||||
|
|
||||||
/// CreateBasicType - Create a basic type like int, float, etc.
|
/// CreateBasicType - Create a basic type like int, float, etc.
|
||||||
DIBasicType CreateBasicTypeEx(DIDescriptor Context, StringRef Name,
|
DIBasicType CreateBasicTypeEx(DIDescriptor Context, const char * Name,
|
||||||
DICompileUnit CompileUnit, unsigned LineNumber,
|
DICompileUnit CompileUnit, unsigned LineNumber,
|
||||||
Constant *SizeInBits, Constant *AlignInBits,
|
Constant *SizeInBits, Constant *AlignInBits,
|
||||||
Constant *OffsetInBits, unsigned Flags,
|
Constant *OffsetInBits, unsigned Flags,
|
||||||
@@ -524,7 +524,7 @@ namespace llvm {
|
|||||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||||
/// pointer, typedef, etc.
|
/// pointer, typedef, etc.
|
||||||
DIDerivedType CreateDerivedType(unsigned Tag, DIDescriptor Context,
|
DIDerivedType CreateDerivedType(unsigned Tag, DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
@@ -534,7 +534,7 @@ namespace llvm {
|
|||||||
/// CreateDerivedType - Create a derived type like const qualified type,
|
/// CreateDerivedType - Create a derived type like const qualified type,
|
||||||
/// pointer, typedef, etc.
|
/// pointer, typedef, etc.
|
||||||
DIDerivedType CreateDerivedTypeEx(unsigned Tag, DIDescriptor Context,
|
DIDerivedType CreateDerivedTypeEx(unsigned Tag, DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
Constant *SizeInBits, Constant *AlignInBits,
|
Constant *SizeInBits, Constant *AlignInBits,
|
||||||
@@ -543,7 +543,7 @@ namespace llvm {
|
|||||||
|
|
||||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||||
DICompositeType CreateCompositeType(unsigned Tag, DIDescriptor Context,
|
DICompositeType CreateCompositeType(unsigned Tag, DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
uint64_t SizeInBits,
|
uint64_t SizeInBits,
|
||||||
@@ -555,7 +555,7 @@ namespace llvm {
|
|||||||
|
|
||||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||||
DICompositeType CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context,
|
DICompositeType CreateCompositeTypeEx(unsigned Tag, DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
Constant *SizeInBits,
|
Constant *SizeInBits,
|
||||||
@@ -567,25 +567,25 @@ namespace llvm {
|
|||||||
|
|
||||||
/// CreateSubprogram - Create a new descriptor for the specified subprogram.
|
/// CreateSubprogram - Create a new descriptor for the specified subprogram.
|
||||||
/// See comments in DISubprogram for descriptions of these fields.
|
/// See comments in DISubprogram for descriptions of these fields.
|
||||||
DISubprogram CreateSubprogram(DIDescriptor Context, StringRef Name,
|
DISubprogram CreateSubprogram(DIDescriptor Context, const char * Name,
|
||||||
StringRef DisplayName,
|
const char * DisplayName,
|
||||||
StringRef LinkageName,
|
const char * LinkageName,
|
||||||
DICompileUnit CompileUnit, unsigned LineNo,
|
DICompileUnit CompileUnit, unsigned LineNo,
|
||||||
DIType Type, bool isLocalToUnit,
|
DIType Type, bool isLocalToUnit,
|
||||||
bool isDefinition);
|
bool isDefinition);
|
||||||
|
|
||||||
/// CreateGlobalVariable - Create a new descriptor for the specified global.
|
/// CreateGlobalVariable - Create a new descriptor for the specified global.
|
||||||
DIGlobalVariable
|
DIGlobalVariable
|
||||||
CreateGlobalVariable(DIDescriptor Context, StringRef Name,
|
CreateGlobalVariable(DIDescriptor Context, const char * Name,
|
||||||
StringRef DisplayName,
|
const char * DisplayName,
|
||||||
StringRef LinkageName,
|
const char * LinkageName,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNo, DIType Type, bool isLocalToUnit,
|
unsigned LineNo, DIType Type, bool isLocalToUnit,
|
||||||
bool isDefinition, llvm::GlobalVariable *GV);
|
bool isDefinition, llvm::GlobalVariable *GV);
|
||||||
|
|
||||||
/// CreateVariable - Create a new descriptor for the specified variable.
|
/// CreateVariable - Create a new descriptor for the specified variable.
|
||||||
DIVariable CreateVariable(unsigned Tag, DIDescriptor Context,
|
DIVariable CreateVariable(unsigned Tag, DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit, unsigned LineNo,
|
DICompileUnit CompileUnit, unsigned LineNo,
|
||||||
DIType Type);
|
DIType Type);
|
||||||
|
|
||||||
|
@@ -60,6 +60,7 @@ protected:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
static MDString *get(LLVMContext &Context, StringRef Str);
|
static MDString *get(LLVMContext &Context, StringRef Str);
|
||||||
|
static MDString *get(LLVMContext &Context, const char *Str);
|
||||||
|
|
||||||
StringRef getString() const { return Str; }
|
StringRef getString() const { return Str; }
|
||||||
|
|
||||||
|
@@ -653,9 +653,9 @@ DISubrange DIFactory::GetOrCreateSubrange(int64_t Lo, int64_t Hi) {
|
|||||||
/// CreateCompileUnit - Create a new descriptor for the specified compile
|
/// CreateCompileUnit - Create a new descriptor for the specified compile
|
||||||
/// unit. Note that this does not unique compile units within the module.
|
/// unit. Note that this does not unique compile units within the module.
|
||||||
DICompileUnit DIFactory::CreateCompileUnit(unsigned LangID,
|
DICompileUnit DIFactory::CreateCompileUnit(unsigned LangID,
|
||||||
StringRef Filename,
|
const char * Filename,
|
||||||
StringRef Directory,
|
const char * Directory,
|
||||||
StringRef Producer,
|
const char * Producer,
|
||||||
bool isMain,
|
bool isMain,
|
||||||
bool isOptimized,
|
bool isOptimized,
|
||||||
const char *Flags,
|
const char *Flags,
|
||||||
@@ -677,7 +677,7 @@ DICompileUnit DIFactory::CreateCompileUnit(unsigned LangID,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// CreateEnumerator - Create a single enumerator value.
|
/// CreateEnumerator - Create a single enumerator value.
|
||||||
DIEnumerator DIFactory::CreateEnumerator(StringRef Name, uint64_t Val){
|
DIEnumerator DIFactory::CreateEnumerator(const char * Name, uint64_t Val){
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(dwarf::DW_TAG_enumerator),
|
GetTagConstant(dwarf::DW_TAG_enumerator),
|
||||||
MDString::get(VMContext, Name),
|
MDString::get(VMContext, Name),
|
||||||
@@ -689,7 +689,7 @@ DIEnumerator DIFactory::CreateEnumerator(StringRef Name, uint64_t Val){
|
|||||||
|
|
||||||
/// CreateBasicType - Create a basic type like int, float, etc.
|
/// CreateBasicType - Create a basic type like int, float, etc.
|
||||||
DIBasicType DIFactory::CreateBasicType(DIDescriptor Context,
|
DIBasicType DIFactory::CreateBasicType(DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
uint64_t SizeInBits,
|
uint64_t SizeInBits,
|
||||||
@@ -714,7 +714,7 @@ DIBasicType DIFactory::CreateBasicType(DIDescriptor Context,
|
|||||||
|
|
||||||
/// CreateBasicType - Create a basic type like int, float, etc.
|
/// CreateBasicType - Create a basic type like int, float, etc.
|
||||||
DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context,
|
DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
Constant *SizeInBits,
|
Constant *SizeInBits,
|
||||||
@@ -741,7 +741,7 @@ DIBasicType DIFactory::CreateBasicTypeEx(DIDescriptor Context,
|
|||||||
/// pointer, typedef, etc.
|
/// pointer, typedef, etc.
|
||||||
DIDerivedType DIFactory::CreateDerivedType(unsigned Tag,
|
DIDerivedType DIFactory::CreateDerivedType(unsigned Tag,
|
||||||
DIDescriptor Context,
|
DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
uint64_t SizeInBits,
|
uint64_t SizeInBits,
|
||||||
@@ -769,7 +769,7 @@ DIDerivedType DIFactory::CreateDerivedType(unsigned Tag,
|
|||||||
/// pointer, typedef, etc.
|
/// pointer, typedef, etc.
|
||||||
DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag,
|
DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag,
|
||||||
DIDescriptor Context,
|
DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
Constant *SizeInBits,
|
Constant *SizeInBits,
|
||||||
@@ -796,7 +796,7 @@ DIDerivedType DIFactory::CreateDerivedTypeEx(unsigned Tag,
|
|||||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||||
DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
|
DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
|
||||||
DIDescriptor Context,
|
DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
uint64_t SizeInBits,
|
uint64_t SizeInBits,
|
||||||
@@ -828,7 +828,7 @@ DICompositeType DIFactory::CreateCompositeType(unsigned Tag,
|
|||||||
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
/// CreateCompositeType - Create a composite type like array, struct, etc.
|
||||||
DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag,
|
DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag,
|
||||||
DIDescriptor Context,
|
DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNumber,
|
unsigned LineNumber,
|
||||||
Constant *SizeInBits,
|
Constant *SizeInBits,
|
||||||
@@ -861,9 +861,9 @@ DICompositeType DIFactory::CreateCompositeTypeEx(unsigned Tag,
|
|||||||
/// See comments in DISubprogram for descriptions of these fields. This
|
/// See comments in DISubprogram for descriptions of these fields. This
|
||||||
/// method does not unique the generated descriptors.
|
/// method does not unique the generated descriptors.
|
||||||
DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context,
|
DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
StringRef DisplayName,
|
const char * DisplayName,
|
||||||
StringRef LinkageName,
|
const char * LinkageName,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNo, DIType Type,
|
unsigned LineNo, DIType Type,
|
||||||
bool isLocalToUnit,
|
bool isLocalToUnit,
|
||||||
@@ -887,9 +887,9 @@ DISubprogram DIFactory::CreateSubprogram(DIDescriptor Context,
|
|||||||
|
|
||||||
/// CreateGlobalVariable - Create a new descriptor for the specified global.
|
/// CreateGlobalVariable - Create a new descriptor for the specified global.
|
||||||
DIGlobalVariable
|
DIGlobalVariable
|
||||||
DIFactory::CreateGlobalVariable(DIDescriptor Context, StringRef Name,
|
DIFactory::CreateGlobalVariable(DIDescriptor Context, const char * Name,
|
||||||
StringRef DisplayName,
|
const char * DisplayName,
|
||||||
StringRef LinkageName,
|
const char * LinkageName,
|
||||||
DICompileUnit CompileUnit,
|
DICompileUnit CompileUnit,
|
||||||
unsigned LineNo, DIType Type,bool isLocalToUnit,
|
unsigned LineNo, DIType Type,bool isLocalToUnit,
|
||||||
bool isDefinition, llvm::GlobalVariable *Val) {
|
bool isDefinition, llvm::GlobalVariable *Val) {
|
||||||
@@ -921,7 +921,7 @@ DIFactory::CreateGlobalVariable(DIDescriptor Context, StringRef Name,
|
|||||||
|
|
||||||
/// CreateVariable - Create a new descriptor for the specified variable.
|
/// CreateVariable - Create a new descriptor for the specified variable.
|
||||||
DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
|
DIVariable DIFactory::CreateVariable(unsigned Tag, DIDescriptor Context,
|
||||||
StringRef Name,
|
const char * Name,
|
||||||
DICompileUnit CompileUnit, unsigned LineNo,
|
DICompileUnit CompileUnit, unsigned LineNo,
|
||||||
DIType Type) {
|
DIType Type) {
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
|
@@ -39,6 +39,17 @@ MDString *MDString::get(LLVMContext &Context, StringRef Str) {
|
|||||||
new MDString(Context, Entry.getKey());
|
new MDString(Context, Entry.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MDString *MDString::get(LLVMContext &Context, const char *Str) {
|
||||||
|
LLVMContextImpl *pImpl = Context.pImpl;
|
||||||
|
StringMapEntry<MDString *> &Entry =
|
||||||
|
pImpl->MDStringCache.GetOrCreateValue(Str ? StringRef(Str) : StringRef());
|
||||||
|
MDString *&S = Entry.getValue();
|
||||||
|
if (S) return S;
|
||||||
|
|
||||||
|
return S =
|
||||||
|
new MDString(Context, Entry.getKey());
|
||||||
|
}
|
||||||
|
|
||||||
//===----------------------------------------------------------------------===//
|
//===----------------------------------------------------------------------===//
|
||||||
// MDNode implementation.
|
// MDNode implementation.
|
||||||
//
|
//
|
||||||
|
Reference in New Issue
Block a user