mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-18 10:31:57 +00:00
Add support to create vector, array, enums etc...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7bc0f27329
commit
43c249cf1e
@ -35,6 +35,8 @@ namespace llvm {
|
|||||||
class DIGlobalVariable;
|
class DIGlobalVariable;
|
||||||
class DINameSpace;
|
class DINameSpace;
|
||||||
class DIVariable;
|
class DIVariable;
|
||||||
|
class DISubrange;
|
||||||
|
class DILexicalBlock;
|
||||||
|
|
||||||
class DIBuilder {
|
class DIBuilder {
|
||||||
private:
|
private:
|
||||||
@ -141,11 +143,73 @@ namespace llvm {
|
|||||||
unsigned Flags, DIType Ty);
|
unsigned Flags, DIType Ty);
|
||||||
|
|
||||||
/// CreateStructType - Create debugging information entry for a struct.
|
/// CreateStructType - Create debugging information entry for a struct.
|
||||||
DIType CreateStructType(DIDescriptor Context, StringRef Name, DIFile F,
|
/// @param Scope Scope in which this struct is defined.
|
||||||
|
/// @param Name Struct 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 Elements Struct elements.
|
||||||
|
/// @param RunTimeLang Optional parameter, Objective-C runtime version.
|
||||||
|
DIType CreateStructType(DIDescriptor Scope, StringRef Name, DIFile File,
|
||||||
unsigned LineNumber, uint64_t SizeInBits,
|
unsigned LineNumber, uint64_t SizeInBits,
|
||||||
uint64_t AlignInBits, unsigned Flags,
|
uint64_t AlignInBits, unsigned Flags,
|
||||||
DIArray Elements, unsigned RunTimeLang = 0);
|
DIArray Elements, unsigned RunTimeLang = 0);
|
||||||
|
|
||||||
|
/// CreateUnionType - Create debugging information entry for an union.
|
||||||
|
/// @param Scope Scope in which this union is defined.
|
||||||
|
/// @param Name Union 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 Elements Union elements.
|
||||||
|
/// @param RunTimeLang Optional parameter, Objective-C runtime version.
|
||||||
|
DIType CreateUnionType(DIDescriptor Scope, StringRef Name, DIFile File,
|
||||||
|
unsigned LineNumber, uint64_t SizeInBits,
|
||||||
|
uint64_t AlignInBits, unsigned Flags,
|
||||||
|
DIArray Elements, unsigned RunTimeLang = 0);
|
||||||
|
|
||||||
|
/// CreateArrayType - Create debugging information entry for an array.
|
||||||
|
/// @param Size Array size.
|
||||||
|
/// @param AlignInBits Alignment.
|
||||||
|
/// @param Ty Element type.
|
||||||
|
/// @param Subscripts Subscripts.
|
||||||
|
DIType CreateArrayType(uint64_t Size, uint64_t AlignInBits,
|
||||||
|
DIType Ty, DIArray Subscripts);
|
||||||
|
|
||||||
|
/// CreateVectorType - Create debugging information entry for a vector type.
|
||||||
|
/// @param Size Array size.
|
||||||
|
/// @param AlignInBits Alignment.
|
||||||
|
/// @param Ty Element type.
|
||||||
|
/// @param Subscripts Subscripts.
|
||||||
|
DIType CreateVectorType(uint64_t Size, uint64_t AlignInBits,
|
||||||
|
DIType Ty, DIArray Subscripts);
|
||||||
|
|
||||||
|
/// CreateEnumerationType - Create debugging information entry for an
|
||||||
|
/// enumeration.
|
||||||
|
/// @param Scope Scope in which this enumeration is defined.
|
||||||
|
/// @param Name Union name.
|
||||||
|
/// @param File File where this member is defined.
|
||||||
|
/// @param LineNo Line number.
|
||||||
|
/// @param SizeInBits Member size.
|
||||||
|
/// @param AlignInBits Member alignment.
|
||||||
|
/// @param Elements Enumeration elements.
|
||||||
|
DIType CreateEnumerationType(DIDescriptor Scope, StringRef Name,
|
||||||
|
DIFile File, unsigned LineNumber,
|
||||||
|
uint64_t SizeInBits,
|
||||||
|
uint64_t AlignInBits, DIArray Elements);
|
||||||
|
|
||||||
|
/// CreateSubroutineType - Create subroutine type.
|
||||||
|
/// @param File File in which this subroutine is defined.
|
||||||
|
/// @param ParamterTypes An array of subroutine parameter types. This
|
||||||
|
/// includes return type at 0th index.
|
||||||
|
DIType CreateSubroutineType(DIFile File, DIArray ParameterTypes);
|
||||||
|
|
||||||
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
|
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
|
||||||
DIType CreateArtificialType(DIType Ty);
|
DIType CreateArtificialType(DIType Ty);
|
||||||
|
|
||||||
@ -153,9 +217,21 @@ namespace llvm {
|
|||||||
DIType CreateTemporaryType();
|
DIType CreateTemporaryType();
|
||||||
DIType CreateTemporaryType(DIFile F);
|
DIType CreateTemporaryType(DIFile F);
|
||||||
|
|
||||||
|
/// RetainType - Retain DIType in a module even if it is not referenced
|
||||||
|
/// through debug info anchors.
|
||||||
|
void RetainType(DIType T);
|
||||||
|
|
||||||
|
/// CreateUnspecifiedParameter - Create unspeicified type descriptor
|
||||||
|
/// for a subroutine type.
|
||||||
|
DIDescriptor CreateUnspecifiedParameter();
|
||||||
|
|
||||||
/// GetOrCreateArray - Get a DIArray, create one if required.
|
/// GetOrCreateArray - Get a DIArray, create one if required.
|
||||||
DIArray GetOrCreateArray(Value *const *Elements, unsigned NumElements);
|
DIArray GetOrCreateArray(Value *const *Elements, unsigned NumElements);
|
||||||
|
|
||||||
|
/// GetOrCreateSubrange - Create a descriptor for a value range. This
|
||||||
|
/// implicitly uniques the values returned.
|
||||||
|
DISubrange 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.
|
||||||
/// @param Name Name of the variable.
|
/// @param Name Name of the variable.
|
||||||
/// @param File File where this variable is defined.
|
/// @param File File where this variable is defined.
|
||||||
@ -232,6 +308,15 @@ namespace llvm {
|
|||||||
DIFile File, unsigned LineNo);
|
DIFile File, unsigned LineNo);
|
||||||
|
|
||||||
|
|
||||||
|
/// CreateLexicalBlock - This creates a descriptor for a lexical block
|
||||||
|
/// with the specified parent context.
|
||||||
|
/// @param Scope Parent lexical scope.
|
||||||
|
/// @param File Source file
|
||||||
|
/// @param Line Line number
|
||||||
|
/// @param Col Column number
|
||||||
|
DILexicalBlock CreateLexicalBlock(DIDescriptor Scope, DIFile File,
|
||||||
|
unsigned Line, unsigned Col);
|
||||||
|
|
||||||
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
||||||
/// @param Storage llvm::Value of the variable
|
/// @param Storage llvm::Value of the variable
|
||||||
/// @param VarInfo Variable's debug info descriptor.
|
/// @param VarInfo Variable's debug info descriptor.
|
||||||
|
@ -237,19 +237,21 @@ DIType DIBuilder::CreateMemberType(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, DIFile F,
|
DIType DIBuilder::CreateStructType(DIDescriptor Context, StringRef Name,
|
||||||
unsigned LineNumber, uint64_t SizeInBits,
|
DIFile File, unsigned LineNumber,
|
||||||
uint64_t AlignInBits, unsigned Flags,
|
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||||
DIArray Elements, unsigned RunTimeLang) {
|
unsigned Flags, DIArray Elements,
|
||||||
|
unsigned RunTimeLang) {
|
||||||
// TAG_structure_type is encoded in DICompositeType format.
|
// TAG_structure_type is encoded in DICompositeType format.
|
||||||
Value *Elts[] = {
|
Value *Elts[] = {
|
||||||
GetTagConstant(VMContext, dwarf::DW_TAG_structure_type),
|
GetTagConstant(VMContext, dwarf::DW_TAG_structure_type),
|
||||||
Context,
|
Context,
|
||||||
MDString::get(VMContext, Name),
|
MDString::get(VMContext, Name),
|
||||||
F,
|
File,
|
||||||
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||||
ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
|
ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
|
||||||
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
|
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
|
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
|
||||||
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
Elements,
|
Elements,
|
||||||
@ -259,6 +261,123 @@ DIType DIBuilder::CreateStructType(DIDescriptor Context, StringRef Name, DIFile
|
|||||||
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// CreateUnionType - Create debugging information entry for an union.
|
||||||
|
DIType DIBuilder::CreateUnionType(DIDescriptor Scope, StringRef Name,
|
||||||
|
DIFile File,
|
||||||
|
unsigned LineNumber, uint64_t SizeInBits,
|
||||||
|
uint64_t AlignInBits, unsigned Flags,
|
||||||
|
DIArray Elements, unsigned RunTimeLang) {
|
||||||
|
// TAG_union_type is encoded in DICompositeType format.
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_union_type),
|
||||||
|
Scope,
|
||||||
|
MDString::get(VMContext, Name),
|
||||||
|
File,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), Flags),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
Elements,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), RunTimeLang),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
};
|
||||||
|
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// CreateSubroutineType - Create subroutine type.
|
||||||
|
DIType DIBuilder::CreateSubroutineType(DIFile File, DIArray ParameterTypes) {
|
||||||
|
// TAG_subroutine_type is encoded in DICompositeType format.
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_subroutine_type),
|
||||||
|
File,
|
||||||
|
MDString::get(VMContext, ""),
|
||||||
|
File,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
ParameterTypes,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
};
|
||||||
|
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// CreateEnumerationType - Create debugging information entry for an
|
||||||
|
/// enumeration.
|
||||||
|
DIType DIBuilder::CreateEnumerationType(DIDescriptor Scope, StringRef Name,
|
||||||
|
DIFile File, unsigned LineNumber,
|
||||||
|
uint64_t SizeInBits,
|
||||||
|
uint64_t AlignInBits, DIArray Elements) {
|
||||||
|
// TAG_enumeration_type is encoded in DICompositeType format.
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_enumeration_type),
|
||||||
|
Scope,
|
||||||
|
MDString::get(VMContext, Name),
|
||||||
|
File,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), LineNumber),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), SizeInBits),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
Elements,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
};
|
||||||
|
MDNode *Node = MDNode::get(VMContext, &Elts[0], array_lengthof(Elts));
|
||||||
|
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.enum");
|
||||||
|
NMD->addOperand(Node);
|
||||||
|
return DIType(Node);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// CreateArrayType - Create debugging information entry for an array.
|
||||||
|
DIType DIBuilder::CreateArrayType(uint64_t Size, uint64_t AlignInBits,
|
||||||
|
DIType Ty, DIArray Subscripts) {
|
||||||
|
// TAG_array_type is encoded in DICompositeType format.
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_array_type),
|
||||||
|
TheCU,
|
||||||
|
MDString::get(VMContext, ""),
|
||||||
|
TheCU,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), Size),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
Ty,
|
||||||
|
Subscripts,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
};
|
||||||
|
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/// CreateVectorType - Create debugging information entry for a vector.
|
||||||
|
DIType DIBuilder::CreateVectorType(uint64_t Size, uint64_t AlignInBits,
|
||||||
|
DIType Ty, DIArray Subscripts) {
|
||||||
|
// TAG_vector_type is encoded in DICompositeType format.
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_vector_type),
|
||||||
|
TheCU,
|
||||||
|
MDString::get(VMContext, ""),
|
||||||
|
TheCU,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), Size),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), AlignInBits),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
Ty,
|
||||||
|
Subscripts,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), 0),
|
||||||
|
llvm::Constant::getNullValue(Type::getInt32Ty(VMContext)),
|
||||||
|
};
|
||||||
|
return DIType(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
|
}
|
||||||
|
|
||||||
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
|
/// CreateArtificialType - Create a new DIType with "artificial" flag set.
|
||||||
DIType DIBuilder::CreateArtificialType(DIType Ty) {
|
DIType DIBuilder::CreateArtificialType(DIType Ty) {
|
||||||
@ -284,6 +403,22 @@ DIType DIBuilder::CreateArtificialType(DIType Ty) {
|
|||||||
return DIType(MDNode::get(VMContext, Elts.data(), Elts.size()));
|
return DIType(MDNode::get(VMContext, Elts.data(), Elts.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// RetainType - Retain DIType in a module even if it is not referenced
|
||||||
|
/// through debug info anchors.
|
||||||
|
void DIBuilder::RetainType(DIType T) {
|
||||||
|
NamedMDNode *NMD = M.getOrInsertNamedMetadata("llvm.dbg.ty");
|
||||||
|
NMD->addOperand(T);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// CreateUnspecifiedParameter - Create unspeicified type descriptor
|
||||||
|
/// for the subroutine type.
|
||||||
|
DIDescriptor DIBuilder::CreateUnspecifiedParameter() {
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_unspecified_parameters)
|
||||||
|
};
|
||||||
|
return DIDescriptor(MDNode::get(VMContext, &Elts[0], 1));
|
||||||
|
}
|
||||||
|
|
||||||
/// CreateTemporaryType - Create a temporary forward-declared type.
|
/// CreateTemporaryType - Create a temporary forward-declared type.
|
||||||
DIType DIBuilder::CreateTemporaryType() {
|
DIType DIBuilder::CreateTemporaryType() {
|
||||||
// Give the temporary MDNode a tag. It doesn't matter what tag we
|
// Give the temporary MDNode a tag. It doesn't matter what tag we
|
||||||
@ -316,6 +451,18 @@ DIArray DIBuilder::GetOrCreateArray(Value *const *Elements, unsigned NumElements
|
|||||||
return DIArray(MDNode::get(VMContext, Elements, NumElements));
|
return DIArray(MDNode::get(VMContext, Elements, NumElements));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// GetOrCreateSubrange - Create a descriptor for a value range. This
|
||||||
|
/// implicitly uniques the values returned.
|
||||||
|
DISubrange DIBuilder::GetOrCreateSubrange(int64_t Lo, int64_t Hi) {
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_subrange_type),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), Lo),
|
||||||
|
ConstantInt::get(Type::getInt64Ty(VMContext), Hi)
|
||||||
|
};
|
||||||
|
|
||||||
|
return DISubrange(MDNode::get(VMContext, &Elts[0], 3));
|
||||||
|
}
|
||||||
|
|
||||||
/// 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,
|
||||||
@ -419,7 +566,6 @@ DIVariable DIBuilder::CreateComplexVariable(unsigned Tag, DIDescriptor Scope,
|
|||||||
return DIVariable(MDNode::get(VMContext, Elts.data(), Elts.size()));
|
return DIVariable(MDNode::get(VMContext, Elts.data(), Elts.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// CreateNameSpace - This creates new descriptor for a namespace
|
/// CreateNameSpace - This creates new descriptor for a namespace
|
||||||
/// with the specified parent scope.
|
/// with the specified parent scope.
|
||||||
DINameSpace DIBuilder::CreateNameSpace(DIDescriptor Scope, StringRef Name,
|
DINameSpace DIBuilder::CreateNameSpace(DIDescriptor Scope, StringRef Name,
|
||||||
@ -434,6 +580,21 @@ DINameSpace DIBuilder::CreateNameSpace(DIDescriptor Scope, StringRef Name,
|
|||||||
return DINameSpace(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
return DINameSpace(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DILexicalBlock DIBuilder::CreateLexicalBlock(DIDescriptor Scope, DIFile File,
|
||||||
|
unsigned Line, unsigned Col) {
|
||||||
|
// Defeat MDNode uniqing for lexical blocks by using unique id.
|
||||||
|
static unsigned int unique_id = 0;
|
||||||
|
Value *Elts[] = {
|
||||||
|
GetTagConstant(VMContext, dwarf::DW_TAG_lexical_block),
|
||||||
|
Scope,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), Line),
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), Col),
|
||||||
|
File,
|
||||||
|
ConstantInt::get(Type::getInt32Ty(VMContext), unique_id++)
|
||||||
|
};
|
||||||
|
return DILexicalBlock(MDNode::get(VMContext, &Elts[0], array_lengthof(Elts)));
|
||||||
|
}
|
||||||
|
|
||||||
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
/// InsertDeclare - Insert a new llvm.dbg.declare intrinsic call.
|
||||||
Instruction *DIBuilder::InsertDeclare(Value *Storage, DIVariable VarInfo,
|
Instruction *DIBuilder::InsertDeclare(Value *Storage, DIVariable VarInfo,
|
||||||
Instruction *InsertBefore) {
|
Instruction *InsertBefore) {
|
||||||
|
@ -309,6 +309,8 @@ bool DIType::Verify() const {
|
|||||||
if (!isBasicType() && Tag != dwarf::DW_TAG_const_type &&
|
if (!isBasicType() && Tag != dwarf::DW_TAG_const_type &&
|
||||||
Tag != dwarf::DW_TAG_volatile_type && Tag != dwarf::DW_TAG_pointer_type &&
|
Tag != dwarf::DW_TAG_volatile_type && Tag != dwarf::DW_TAG_pointer_type &&
|
||||||
Tag != dwarf::DW_TAG_reference_type && Tag != dwarf::DW_TAG_restrict_type
|
Tag != dwarf::DW_TAG_reference_type && Tag != dwarf::DW_TAG_restrict_type
|
||||||
|
&& Tag != dwarf::DW_TAG_vector_type && Tag != dwarf::DW_TAG_array_type
|
||||||
|
&& Tag != dwarf::DW_TAG_enumeration_type
|
||||||
&& getFilename().empty())
|
&& getFilename().empty())
|
||||||
return false;
|
return false;
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user