mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Whitespace and 80-col.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138654 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -29,8 +29,9 @@ static Constant *GetTagConstant(LLVMContext &VMContext, unsigned Tag) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
DIBuilder::DIBuilder(Module &m)
|
DIBuilder::DIBuilder(Module &m)
|
||||||
: M(m), VMContext(M.getContext()), TheCU(0), TempEnumTypes(0),
|
: M(m), VMContext(M.getContext()), TheCU(0), TempEnumTypes(0),
|
||||||
TempRetainTypes(0), TempSubprograms(0), TempGVs(0), DeclareFn(0), ValueFn(0)
|
TempRetainTypes(0), TempSubprograms(0), TempGVs(0), DeclareFn(0),
|
||||||
|
ValueFn(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
/// finalize - Construct any deferred debug info descriptors.
|
/// finalize - Construct any deferred debug info descriptors.
|
||||||
@ -61,7 +62,8 @@ void DIBuilder::finalize() {
|
|||||||
DIType(TempGVs).replaceAllUsesWith(GVs);
|
DIType(TempGVs).replaceAllUsesWith(GVs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getNonCompileUnitScope - If N is compile unit return NULL otherwise return N.
|
/// getNonCompileUnitScope - If N is compile unit return NULL otherwise return
|
||||||
|
/// N.
|
||||||
static MDNode *getNonCompileUnitScope(MDNode *N) {
|
static MDNode *getNonCompileUnitScope(MDNode *N) {
|
||||||
if (DIDescriptor(N).isCompileUnit())
|
if (DIDescriptor(N).isCompileUnit())
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -70,9 +72,9 @@ static MDNode *getNonCompileUnitScope(MDNode *N) {
|
|||||||
|
|
||||||
/// createCompileUnit - A CompileUnit provides an anchor for all debugging
|
/// createCompileUnit - A CompileUnit provides an anchor for all debugging
|
||||||
/// information generated during this instance of compilation.
|
/// information generated during this instance of compilation.
|
||||||
void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
|
void DIBuilder::createCompileUnit(unsigned Lang, StringRef Filename,
|
||||||
StringRef Directory, StringRef Producer,
|
StringRef Directory, StringRef Producer,
|
||||||
bool isOptimized, StringRef Flags,
|
bool isOptimized, StringRef Flags,
|
||||||
unsigned RunTimeVer) {
|
unsigned RunTimeVer) {
|
||||||
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
|
Value *TElts[] = { GetTagConstant(VMContext, DW_TAG_base_type) };
|
||||||
TempEnumTypes = MDNode::getTemporary(VMContext, TElts);
|
TempEnumTypes = MDNode::getTemporary(VMContext, TElts);
|
||||||
@ -138,9 +140,9 @@ DIEnumerator DIBuilder::createEnumerator(StringRef Name, uint64_t Val) {
|
|||||||
return DIEnumerator(MDNode::get(VMContext, Elts));
|
return DIEnumerator(MDNode::get(VMContext, Elts));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// createBasicType - Create debugging information entry for a basic
|
/// createBasicType - Create debugging information entry for a basic
|
||||||
/// type, e.g 'char'.
|
/// type, e.g 'char'.
|
||||||
DIType DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits,
|
DIType DIBuilder::createBasicType(StringRef Name, uint64_t SizeInBits,
|
||||||
uint64_t AlignInBits,
|
uint64_t AlignInBits,
|
||||||
unsigned Encoding) {
|
unsigned Encoding) {
|
||||||
// Basic types are encoded in DIBasicType format. Line number, filename,
|
// Basic types are encoded in DIBasicType format. Line number, filename,
|
||||||
@ -203,7 +205,7 @@ DIType DIBuilder::createReferenceType(DIType RTy) {
|
|||||||
// References are encoded in DIDerivedType format.
|
// References are encoded in DIDerivedType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_reference_type),
|
GetTagConstant(VMContext, dwarf::DW_TAG_reference_type),
|
||||||
NULL, //TheCU,
|
NULL, // TheCU,
|
||||||
NULL, // Name
|
NULL, // Name
|
||||||
NULL, // Filename
|
NULL, // Filename
|
||||||
ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0), // Line
|
||||||
@ -258,7 +260,7 @@ DIType DIBuilder::createFriend(DIType Ty, DIType FriendTy) {
|
|||||||
|
|
||||||
/// createInheritance - Create debugging information entry to establish
|
/// createInheritance - Create debugging information entry to establish
|
||||||
/// inheritnace relationship between two types.
|
/// inheritnace relationship between two types.
|
||||||
DIType DIBuilder::createInheritance(DIType Ty, DIType BaseTy,
|
DIType DIBuilder::createInheritance(DIType Ty, DIType BaseTy,
|
||||||
uint64_t BaseOffset, unsigned Flags) {
|
uint64_t BaseOffset, unsigned Flags) {
|
||||||
// TAG_inheritance is encoded in DIDerivedType format.
|
// TAG_inheritance is encoded in DIDerivedType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@ -277,10 +279,10 @@ DIType DIBuilder::createInheritance(DIType Ty, DIType BaseTy,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// createMemberType - Create debugging information entry for a member.
|
/// createMemberType - Create debugging information entry for a member.
|
||||||
DIType DIBuilder::createMemberType(DIDescriptor Scope, StringRef Name,
|
DIType DIBuilder::createMemberType(DIDescriptor Scope, StringRef Name,
|
||||||
DIFile File, unsigned LineNumber,
|
DIFile File, unsigned LineNumber,
|
||||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
uint64_t OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
DIType Ty) {
|
DIType Ty) {
|
||||||
// TAG_member is encoded in DIDerivedType format.
|
// TAG_member is encoded in DIDerivedType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@ -300,10 +302,10 @@ DIType DIBuilder::createMemberType(DIDescriptor Scope, StringRef Name,
|
|||||||
|
|
||||||
/// createObjCIVar - Create debugging information entry for Objective-C
|
/// createObjCIVar - Create debugging information entry for Objective-C
|
||||||
/// instance variable.
|
/// instance variable.
|
||||||
DIType DIBuilder::createObjCIVar(StringRef Name,
|
DIType DIBuilder::createObjCIVar(StringRef Name,
|
||||||
DIFile File, unsigned LineNumber,
|
DIFile File, unsigned LineNumber,
|
||||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
uint64_t OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
DIType Ty, StringRef PropertyName,
|
DIType Ty, StringRef PropertyName,
|
||||||
StringRef GetterName, StringRef SetterName,
|
StringRef GetterName, StringRef SetterName,
|
||||||
unsigned PropertyAttributes) {
|
unsigned PropertyAttributes) {
|
||||||
@ -328,8 +330,8 @@ DIType DIBuilder::createObjCIVar(StringRef Name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// createClassType - Create debugging information entry for a class.
|
/// createClassType - Create debugging information entry for a class.
|
||||||
DIType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
DIType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
||||||
DIFile File, unsigned LineNumber,
|
DIFile File, unsigned LineNumber,
|
||||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
uint64_t OffsetInBits, unsigned Flags,
|
uint64_t OffsetInBits, unsigned Flags,
|
||||||
DIType DerivedFrom, DIArray Elements,
|
DIType DerivedFrom, DIArray Elements,
|
||||||
@ -356,7 +358,7 @@ DIType DIBuilder::createClassType(DIDescriptor Context, StringRef Name,
|
|||||||
|
|
||||||
/// createTemplateTypeParameter - Create debugging information for template
|
/// createTemplateTypeParameter - Create debugging information for template
|
||||||
/// type parameter.
|
/// type parameter.
|
||||||
DITemplateTypeParameter
|
DITemplateTypeParameter
|
||||||
DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name,
|
DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name,
|
||||||
DIType Ty, MDNode *File, unsigned LineNo,
|
DIType Ty, MDNode *File, unsigned LineNo,
|
||||||
unsigned ColumnNo) {
|
unsigned ColumnNo) {
|
||||||
@ -374,7 +376,7 @@ DIBuilder::createTemplateTypeParameter(DIDescriptor Context, StringRef Name,
|
|||||||
|
|
||||||
/// createTemplateValueParameter - Create debugging information for template
|
/// createTemplateValueParameter - Create debugging information for template
|
||||||
/// value parameter.
|
/// value parameter.
|
||||||
DITemplateValueParameter
|
DITemplateValueParameter
|
||||||
DIBuilder::createTemplateValueParameter(DIDescriptor Context, StringRef Name,
|
DIBuilder::createTemplateValueParameter(DIDescriptor Context, StringRef Name,
|
||||||
DIType Ty, uint64_t Val,
|
DIType Ty, uint64_t Val,
|
||||||
MDNode *File, unsigned LineNo,
|
MDNode *File, unsigned LineNo,
|
||||||
@ -393,10 +395,10 @@ DIBuilder::createTemplateValueParameter(DIDescriptor Context, StringRef Name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// createStructType - Create debugging information entry for a struct.
|
/// createStructType - Create debugging information entry for a struct.
|
||||||
DIType DIBuilder::createStructType(DIDescriptor Context, StringRef Name,
|
DIType DIBuilder::createStructType(DIDescriptor Context, StringRef Name,
|
||||||
DIFile File, unsigned LineNumber,
|
DIFile File, unsigned LineNumber,
|
||||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
unsigned Flags, DIArray Elements,
|
unsigned Flags, DIArray Elements,
|
||||||
unsigned RunTimeLang) {
|
unsigned RunTimeLang) {
|
||||||
// TAG_structure_type is encoded in DICompositeType format.
|
// TAG_structure_type is encoded in DICompositeType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@ -418,7 +420,7 @@ DIType DIBuilder::createStructType(DIDescriptor Context, StringRef Name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// createUnionType - Create debugging information entry for an union.
|
/// createUnionType - Create debugging information entry for an union.
|
||||||
DIType DIBuilder::createUnionType(DIDescriptor Scope, StringRef Name,
|
DIType DIBuilder::createUnionType(DIDescriptor Scope, StringRef Name,
|
||||||
DIFile File,
|
DIFile File,
|
||||||
unsigned LineNumber, uint64_t SizeInBits,
|
unsigned LineNumber, uint64_t SizeInBits,
|
||||||
uint64_t AlignInBits, unsigned Flags,
|
uint64_t AlignInBits, unsigned Flags,
|
||||||
@ -463,12 +465,13 @@ DIType DIBuilder::createSubroutineType(DIFile File, DIArray ParameterTypes) {
|
|||||||
return DIType(MDNode::get(VMContext, Elts));
|
return DIType(MDNode::get(VMContext, Elts));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// createEnumerationType - Create debugging information entry for an
|
/// createEnumerationType - Create debugging information entry for an
|
||||||
/// enumeration.
|
/// enumeration.
|
||||||
DIType DIBuilder::createEnumerationType(DIDescriptor Scope, StringRef Name,
|
DIType DIBuilder::createEnumerationType(DIDescriptor Scope, StringRef Name,
|
||||||
DIFile File, unsigned LineNumber,
|
DIFile File, unsigned LineNumber,
|
||||||
uint64_t SizeInBits,
|
uint64_t SizeInBits,
|
||||||
uint64_t AlignInBits, DIArray Elements) {
|
uint64_t AlignInBits,
|
||||||
|
DIArray Elements) {
|
||||||
// TAG_enumeration_type is encoded in DICompositeType format.
|
// TAG_enumeration_type is encoded in DICompositeType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
|
GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
|
||||||
@ -491,7 +494,7 @@ DIType DIBuilder::createEnumerationType(DIDescriptor Scope, StringRef Name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// createArrayType - Create debugging information entry for an array.
|
/// createArrayType - Create debugging information entry for an array.
|
||||||
DIType DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits,
|
DIType DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits,
|
||||||
DIType Ty, DIArray Subscripts) {
|
DIType Ty, DIArray Subscripts) {
|
||||||
// TAG_array_type is encoded in DICompositeType format.
|
// TAG_array_type is encoded in DICompositeType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@ -513,7 +516,7 @@ DIType DIBuilder::createArrayType(uint64_t Size, uint64_t AlignInBits,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// createVectorType - Create debugging information entry for a vector.
|
/// createVectorType - Create debugging information entry for a vector.
|
||||||
DIType DIBuilder::createVectorType(uint64_t Size, uint64_t AlignInBits,
|
DIType DIBuilder::createVectorType(uint64_t Size, uint64_t AlignInBits,
|
||||||
DIType Ty, DIArray Subscripts) {
|
DIType Ty, DIArray Subscripts) {
|
||||||
// TAG_vector_type is encoded in DICompositeType format.
|
// TAG_vector_type is encoded in DICompositeType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@ -558,7 +561,7 @@ DIType DIBuilder::createArtificialType(DIType Ty) {
|
|||||||
return DIType(MDNode::get(VMContext, Elts));
|
return DIType(MDNode::get(VMContext, Elts));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// retainType - Retain DIType in a module even if it is not referenced
|
/// retainType - Retain DIType in a module even if it is not referenced
|
||||||
/// through debug info anchors.
|
/// through debug info anchors.
|
||||||
void DIBuilder::retainType(DIType T) {
|
void DIBuilder::retainType(DIType T) {
|
||||||
AllRetainTypes.push_back(T);
|
AllRetainTypes.push_back(T);
|
||||||
@ -567,8 +570,8 @@ void DIBuilder::retainType(DIType T) {
|
|||||||
/// createUnspecifiedParameter - Create unspeicified type descriptor
|
/// createUnspecifiedParameter - Create unspeicified type descriptor
|
||||||
/// for the subroutine type.
|
/// for the subroutine type.
|
||||||
DIDescriptor DIBuilder::createUnspecifiedParameter() {
|
DIDescriptor DIBuilder::createUnspecifiedParameter() {
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_parameters)
|
GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_parameters)
|
||||||
};
|
};
|
||||||
return DIDescriptor(MDNode::get(VMContext, Elts));
|
return DIDescriptor(MDNode::get(VMContext, Elts));
|
||||||
}
|
}
|
||||||
@ -619,7 +622,7 @@ DISubrange DIBuilder::getOrCreateSubrange(int64_t Lo, int64_t Hi) {
|
|||||||
|
|
||||||
/// createGlobalVariable - Create a new descriptor for the specified global.
|
/// createGlobalVariable - Create a new descriptor for the specified global.
|
||||||
DIGlobalVariable DIBuilder::
|
DIGlobalVariable DIBuilder::
|
||||||
createGlobalVariable(StringRef Name, DIFile F, unsigned LineNumber,
|
createGlobalVariable(StringRef Name, DIFile F, unsigned LineNumber,
|
||||||
DIType Ty, bool isLocalToUnit, llvm::Value *Val) {
|
DIType Ty, bool isLocalToUnit, llvm::Value *Val) {
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_variable),
|
GetTagConstant(VMContext, dwarf::DW_TAG_variable),
|
||||||
@ -643,8 +646,8 @@ createGlobalVariable(StringRef Name, DIFile F, unsigned LineNumber,
|
|||||||
/// createStaticVariable - Create a new descriptor for the specified static
|
/// createStaticVariable - Create a new descriptor for the specified static
|
||||||
/// variable.
|
/// variable.
|
||||||
DIGlobalVariable DIBuilder::
|
DIGlobalVariable DIBuilder::
|
||||||
createStaticVariable(DIDescriptor Context, StringRef Name,
|
createStaticVariable(DIDescriptor Context, StringRef Name,
|
||||||
StringRef LinkageName, DIFile F, unsigned LineNumber,
|
StringRef LinkageName, DIFile F, unsigned LineNumber,
|
||||||
DIType Ty, bool isLocalToUnit, llvm::Value *Val) {
|
DIType Ty, bool isLocalToUnit, llvm::Value *Val) {
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_variable),
|
GetTagConstant(VMContext, dwarf::DW_TAG_variable),
|
||||||
@ -668,7 +671,7 @@ createStaticVariable(DIDescriptor Context, StringRef Name,
|
|||||||
/// createVariable - Create a new descriptor for the specified variable.
|
/// createVariable - Create a new descriptor for the specified variable.
|
||||||
DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
DIVariable DIBuilder::createLocalVariable(unsigned Tag, DIDescriptor Scope,
|
||||||
StringRef Name, DIFile File,
|
StringRef Name, DIFile File,
|
||||||
unsigned LineNo, DIType Ty,
|
unsigned LineNo, DIType Ty,
|
||||||
bool AlwaysPreserve, unsigned Flags,
|
bool AlwaysPreserve, unsigned Flags,
|
||||||
unsigned ArgNo) {
|
unsigned ArgNo) {
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
@ -705,7 +708,8 @@ DIVariable DIBuilder::createComplexVariable(unsigned Tag, DIDescriptor Scope,
|
|||||||
Elts.push_back(getNonCompileUnitScope(Scope)),
|
Elts.push_back(getNonCompileUnitScope(Scope)),
|
||||||
Elts.push_back(MDString::get(VMContext, Name));
|
Elts.push_back(MDString::get(VMContext, Name));
|
||||||
Elts.push_back(F);
|
Elts.push_back(F);
|
||||||
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext), (LineNo | (ArgNo << 24))));
|
Elts.push_back(ConstantInt::get(Type::getInt32Ty(VMContext),
|
||||||
|
(LineNo | (ArgNo << 24))));
|
||||||
Elts.push_back(Ty);
|
Elts.push_back(Ty);
|
||||||
Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
|
Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
|
||||||
Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
|
Elts.push_back(llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)));
|
||||||
@ -892,4 +896,3 @@ Instruction *DIBuilder::insertDbgValueIntrinsic(Value *V, uint64_t Offset,
|
|||||||
VarInfo };
|
VarInfo };
|
||||||
return CallInst::Create(ValueFn, Args, "", InsertAtEnd);
|
return CallInst::Create(ValueFn, Args, "", InsertAtEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user