mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Formatting with clang-format patch r280700
llvm-svn: 280716
This commit is contained in:
parent
e2c59dd3f4
commit
f831870521
@ -76,12 +76,11 @@ LLVMMetadataRef LLVMDIBuilderCreateFunction(
|
||||
LLVMMetadataRef CompositeType, int IsLocalToUnit, int IsDefinition,
|
||||
unsigned ScopeLine, unsigned Flags, int IsOptimized) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createFunction(unwrap<DIScope>(Scope), Name, LinkageName,
|
||||
return wrap(D->createFunction(
|
||||
unwrap<DIScope>(Scope), Name, LinkageName,
|
||||
File ? unwrap<DIFile>(File) : nullptr, Line,
|
||||
unwrap<DISubroutineType>(CompositeType),
|
||||
IsLocalToUnit, IsDefinition, ScopeLine,
|
||||
static_cast<DINode::DIFlags>(Flags),
|
||||
IsOptimized));
|
||||
unwrap<DISubroutineType>(CompositeType), IsLocalToUnit, IsDefinition,
|
||||
ScopeLine, static_cast<DINode::DIFlags>(Flags), IsOptimized));
|
||||
}
|
||||
|
||||
LLVMMetadataRef
|
||||
@ -90,10 +89,9 @@ LLVMDIBuilderCreateAutoVariable(LLVMDIBuilderRef Dref, LLVMMetadataRef Scope,
|
||||
unsigned Line, LLVMMetadataRef Ty,
|
||||
int AlwaysPreserve, unsigned Flags) {
|
||||
DIBuilder *D = unwrap(Dref);
|
||||
return wrap(D->createAutoVariable(unwrap<DIScope>(Scope), Name,
|
||||
unwrap<DIFile>(File), Line,
|
||||
unwrap<DIType>(Ty), AlwaysPreserve,
|
||||
static_cast<DINode::DIFlags>(Flags)));
|
||||
return wrap(D->createAutoVariable(
|
||||
unwrap<DIScope>(Scope), Name, unwrap<DIFile>(File), Line,
|
||||
unwrap<DIType>(Ty), AlwaysPreserve, static_cast<DINode::DIFlags>(Flags)));
|
||||
}
|
||||
|
||||
LLVMMetadataRef LLVMDIBuilderCreateParameterVariable(
|
||||
|
@ -145,9 +145,9 @@ namespace llvm {
|
||||
/// \param SizeInBits Size.
|
||||
/// \param AlignInBits Alignment. (optional)
|
||||
/// \param Class Type for which this pointer points to members of.
|
||||
DIDerivedType *createMemberPointerType(DIType *PointeeTy, DIType *Class,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits = 0,
|
||||
DIDerivedType *
|
||||
createMemberPointerType(DIType *PointeeTy, DIType *Class,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits = 0,
|
||||
DINode::DIFlags Flags = DINode::FlagZero);
|
||||
|
||||
/// Create debugging information entry for a c++
|
||||
@ -193,8 +193,7 @@ namespace llvm {
|
||||
DIFile *File, unsigned LineNo,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags,
|
||||
DIType *Ty);
|
||||
DINode::DIFlags Flags, DIType *Ty);
|
||||
|
||||
/// Create debugging information entry for a bit field member.
|
||||
/// \param Scope Member scope.
|
||||
@ -273,14 +272,11 @@ namespace llvm {
|
||||
/// for more info.
|
||||
/// \param TemplateParms Template type parameters.
|
||||
/// \param UniqueIdentifier A unique identifier for the class.
|
||||
DICompositeType *createClassType(DIScope *Scope, StringRef Name,
|
||||
DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags,
|
||||
DIType *DerivedFrom, DINodeArray Elements,
|
||||
DIType *VTableHolder = nullptr,
|
||||
MDNode *TemplateParms = nullptr,
|
||||
DICompositeType *createClassType(
|
||||
DIScope *Scope, StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
DINode::DIFlags Flags, DIType *DerivedFrom, DINodeArray Elements,
|
||||
DIType *VTableHolder = nullptr, MDNode *TemplateParms = nullptr,
|
||||
StringRef UniqueIdentifier = "");
|
||||
|
||||
/// Create debugging information entry for a struct.
|
||||
@ -396,7 +392,8 @@ namespace llvm {
|
||||
/// \param Flags E.g.: LValueReference.
|
||||
/// These flags are used to emit dwarf attributes.
|
||||
/// \param CC Calling convention, e.g. dwarf::DW_CC_normal
|
||||
DISubroutineType *createSubroutineType(DITypeRefArray ParameterTypes,
|
||||
DISubroutineType *
|
||||
createSubroutineType(DITypeRefArray ParameterTypes,
|
||||
DINode::DIFlags Flags = DINode::FlagZero,
|
||||
unsigned CC = 0);
|
||||
|
||||
@ -481,10 +478,9 @@ namespace llvm {
|
||||
///
|
||||
/// If \c AlwaysPreserve, this variable will be referenced from its
|
||||
/// containing subprogram, and will survive some optimizations.
|
||||
DILocalVariable *createAutoVariable(DIScope *Scope, StringRef Name,
|
||||
DIFile *File, unsigned LineNo,
|
||||
DIType *Ty,
|
||||
bool AlwaysPreserve = false,
|
||||
DILocalVariable *
|
||||
createAutoVariable(DIScope *Scope, StringRef Name, DIFile *File,
|
||||
unsigned LineNo, DIType *Ty, bool AlwaysPreserve = false,
|
||||
DINode::DIFlags Flags = DINode::FlagZero);
|
||||
|
||||
/// Create a new descriptor for a parameter variable.
|
||||
@ -498,9 +494,9 @@ namespace llvm {
|
||||
///
|
||||
/// If \c AlwaysPreserve, this variable will be referenced from its
|
||||
/// containing subprogram, and will survive some optimizations.
|
||||
DILocalVariable *createParameterVariable(DIScope *Scope, StringRef Name,
|
||||
unsigned ArgNo, DIFile *File,
|
||||
unsigned LineNo, DIType *Ty,
|
||||
DILocalVariable *
|
||||
createParameterVariable(DIScope *Scope, StringRef Name, unsigned ArgNo,
|
||||
DIFile *File, unsigned LineNo, DIType *Ty,
|
||||
bool AlwaysPreserve = false,
|
||||
DINode::DIFlags Flags = DINode::FlagZero);
|
||||
|
||||
@ -549,8 +545,8 @@ namespace llvm {
|
||||
DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
|
||||
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
|
||||
bool isDefinition, unsigned ScopeLine,
|
||||
DINode::DIFlags Flags = DINode::FlagZero,
|
||||
bool isOptimized = false, DITemplateParameterArray TParams = nullptr,
|
||||
DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
|
||||
DITemplateParameterArray TParams = nullptr,
|
||||
DISubprogram *Decl = nullptr);
|
||||
|
||||
/// Create a new descriptor for the specified C++ method.
|
||||
@ -575,14 +571,12 @@ namespace llvm {
|
||||
/// This flags are used to emit dwarf attributes.
|
||||
/// \param isOptimized True if optimization is ON.
|
||||
/// \param TParams Function template parameters.
|
||||
DISubprogram *
|
||||
createMethod(DIScope *Scope, StringRef Name, StringRef LinkageName,
|
||||
DIFile *File, unsigned LineNo, DISubroutineType *Ty,
|
||||
bool isLocalToUnit, bool isDefinition, unsigned Virtuality = 0,
|
||||
unsigned VTableIndex = 0, int ThisAdjustment = 0,
|
||||
DIType *VTableHolder = nullptr,
|
||||
DINode::DIFlags Flags = DINode::FlagZero,
|
||||
bool isOptimized = false,
|
||||
DISubprogram *createMethod(
|
||||
DIScope *Scope, StringRef Name, StringRef LinkageName, DIFile *File,
|
||||
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
|
||||
bool isDefinition, unsigned Virtuality = 0, unsigned VTableIndex = 0,
|
||||
int ThisAdjustment = 0, DIType *VTableHolder = nullptr,
|
||||
DINode::DIFlags Flags = DINode::FlagZero, bool isOptimized = false,
|
||||
DITemplateParameterArray TParams = nullptr);
|
||||
|
||||
/// This creates new descriptor for a namespace with the specified
|
||||
|
@ -14,9 +14,9 @@
|
||||
#ifndef LLVM_IR_DEBUGINFOMETADATA_H
|
||||
#define LLVM_IR_DEBUGINFOMETADATA_H
|
||||
|
||||
#include "llvm/ADT/BitmaskEnum.h"
|
||||
#include "llvm/IR/Metadata.h"
|
||||
#include "llvm/Support/Dwarf.h"
|
||||
#include "llvm/ADT/BitmaskEnum.h"
|
||||
|
||||
// Helper macros for defining get() overrides.
|
||||
#define DEFINE_MDNODE_GET_UNPACK_IMPL(...) __VA_ARGS__
|
||||
@ -714,8 +714,8 @@ public:
|
||||
DEFINE_MDNODE_GET(DIDerivedType,
|
||||
(unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
|
||||
DIScopeRef Scope, DITypeRef BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, Metadata *ExtraData = nullptr),
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
Metadata *ExtraData = nullptr),
|
||||
(Tag, Name, File, Line, Scope, BaseType, SizeInBits,
|
||||
AlignInBits, OffsetInBits, Flags, ExtraData))
|
||||
|
||||
@ -825,8 +825,8 @@ public:
|
||||
DEFINE_MDNODE_GET(DICompositeType,
|
||||
(unsigned Tag, StringRef Name, DIFile *File, unsigned Line,
|
||||
DIScopeRef Scope, DITypeRef BaseType, uint64_t SizeInBits,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits,
|
||||
DIFlags Flags, DINodeArray Elements, unsigned RuntimeLang,
|
||||
uint64_t AlignInBits, uint64_t OffsetInBits, DIFlags Flags,
|
||||
DINodeArray Elements, unsigned RuntimeLang,
|
||||
DITypeRef VTableHolder,
|
||||
DITemplateParameterArray TemplateParams = nullptr,
|
||||
StringRef Identifier = ""),
|
||||
@ -1421,24 +1421,18 @@ public:
|
||||
///
|
||||
/// Return true if this subprogram is a C++11 reference-qualified non-static
|
||||
/// member function (void foo() &).
|
||||
bool isLValueReference() const {
|
||||
return getFlags() & FlagLValueReference;
|
||||
}
|
||||
bool isLValueReference() const { return getFlags() & FlagLValueReference; }
|
||||
|
||||
/// \brief Check if this is rvalue-reference-qualified.
|
||||
///
|
||||
/// Return true if this subprogram is a C++11 rvalue-reference-qualified
|
||||
/// non-static member function (void foo() &&).
|
||||
bool isRValueReference() const {
|
||||
return getFlags() & FlagRValueReference;
|
||||
}
|
||||
bool isRValueReference() const { return getFlags() & FlagRValueReference; }
|
||||
|
||||
/// \brief Check if this is marked as noreturn.
|
||||
///
|
||||
/// Return true if this subprogram is C++11 noreturn or C11 _Noreturn
|
||||
bool isNoReturn() const {
|
||||
return getFlags() & FlagNoReturn;
|
||||
}
|
||||
bool isNoReturn() const { return getFlags() & FlagNoReturn; }
|
||||
|
||||
DIScopeRef getScope() const { return DIScopeRef(getRawScope()); }
|
||||
|
||||
@ -1991,11 +1985,13 @@ class DILocalVariable : public DIVariable {
|
||||
public:
|
||||
DEFINE_MDNODE_GET(DILocalVariable,
|
||||
(DILocalScope * Scope, StringRef Name, DIFile *File,
|
||||
unsigned Line, DITypeRef Type, unsigned Arg, DIFlags Flags),
|
||||
unsigned Line, DITypeRef Type, unsigned Arg,
|
||||
DIFlags Flags),
|
||||
(Scope, Name, File, Line, Type, Arg, Flags))
|
||||
DEFINE_MDNODE_GET(DILocalVariable,
|
||||
(Metadata * Scope, MDString *Name, Metadata *File,
|
||||
unsigned Line, Metadata *Type, unsigned Arg, DIFlags Flags),
|
||||
unsigned Line, Metadata *Type, unsigned Arg,
|
||||
DIFlags Flags),
|
||||
(Scope, Name, File, Line, Type, Arg, Flags))
|
||||
|
||||
TempDILocalVariable clone() const { return cloneImpl(); }
|
||||
|
@ -2416,12 +2416,12 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
|
||||
IsDistinct = Record[0];
|
||||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(Record[10]);
|
||||
MetadataList.assignValue(
|
||||
GET_OR_DISTINCT(
|
||||
DIDerivedType,
|
||||
GET_OR_DISTINCT(DIDerivedType,
|
||||
(Context, Record[1], getMDString(Record[2]),
|
||||
getMDOrNull(Record[3]), Record[4], getDITypeRefOrNull(Record[5]),
|
||||
getDITypeRefOrNull(Record[6]), Record[7], Record[8], Record[9],
|
||||
Flags, getDITypeRefOrNull(Record[11]))),
|
||||
getMDOrNull(Record[3]), Record[4],
|
||||
getDITypeRefOrNull(Record[5]),
|
||||
getDITypeRefOrNull(Record[6]), Record[7], Record[8],
|
||||
Record[9], Flags, getDITypeRefOrNull(Record[11]))),
|
||||
NextMetadataNo++);
|
||||
break;
|
||||
}
|
||||
@ -2566,8 +2566,7 @@ std::error_code BitcodeReader::parseMetadata(bool ModuleLevel) {
|
||||
Record[11], // virtuality
|
||||
Record[12], // virtualIndex
|
||||
HasThisAdj ? Record[19] : 0, // thisAdjustment
|
||||
static_cast<DINode::DIFlags>(
|
||||
Record[13] // flags
|
||||
static_cast<DINode::DIFlags>(Record[13] // flags
|
||||
),
|
||||
Record[14], // isOptimized
|
||||
HasUnit ? CUorFn : nullptr, // unit
|
||||
|
@ -287,21 +287,19 @@ DIDerivedType *DIBuilder::createBitFieldMemberType(
|
||||
IntegerType::get(VMContext, 64), StorageOffsetInBits)));
|
||||
}
|
||||
|
||||
DIDerivedType *DIBuilder::createStaticMemberType(DIScope *Scope, StringRef Name,
|
||||
DIFile *File,
|
||||
unsigned LineNumber,
|
||||
DIType *Ty, DINode::DIFlags Flags,
|
||||
llvm::Constant *Val) {
|
||||
DIDerivedType *
|
||||
DIBuilder::createStaticMemberType(DIScope *Scope, StringRef Name, DIFile *File,
|
||||
unsigned LineNumber, DIType *Ty,
|
||||
DINode::DIFlags Flags, llvm::Constant *Val) {
|
||||
Flags |= DINode::FlagStaticMember;
|
||||
return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
|
||||
LineNumber, getNonCompileUnitScope(Scope), Ty, 0, 0,
|
||||
0, Flags, getConstantOrNull(Val));
|
||||
}
|
||||
|
||||
DIDerivedType *DIBuilder::createObjCIVar(StringRef Name, DIFile *File,
|
||||
unsigned LineNumber,
|
||||
uint64_t SizeInBits,
|
||||
uint64_t AlignInBits,
|
||||
DIDerivedType *
|
||||
DIBuilder::createObjCIVar(StringRef Name, DIFile *File, unsigned LineNumber,
|
||||
uint64_t SizeInBits, uint64_t AlignInBits,
|
||||
uint64_t OffsetInBits, DINode::DIFlags Flags,
|
||||
DIType *Ty, MDNode *PropertyNode) {
|
||||
return DIDerivedType::get(VMContext, dwarf::DW_TAG_member, Name, File,
|
||||
@ -400,7 +398,8 @@ DICompositeType *DIBuilder::createUnionType(
|
||||
}
|
||||
|
||||
DISubroutineType *DIBuilder::createSubroutineType(DITypeRefArray ParameterTypes,
|
||||
DINode::DIFlags Flags, unsigned CC) {
|
||||
DINode::DIFlags Flags,
|
||||
unsigned CC) {
|
||||
return DISubroutineType::get(VMContext, Flags, CC, ParameterTypes);
|
||||
}
|
||||
|
||||
@ -629,8 +628,8 @@ static DISubprogram *getSubprogram(bool IsDistinct, Ts &&... Args) {
|
||||
DISubprogram *DIBuilder::createFunction(
|
||||
DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
|
||||
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
|
||||
bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags, bool isOptimized,
|
||||
DITemplateParameterArray TParams, DISubprogram *Decl) {
|
||||
bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags,
|
||||
bool isOptimized, DITemplateParameterArray TParams, DISubprogram *Decl) {
|
||||
auto *Node = getSubprogram(
|
||||
/* IsDistinct = */ isDefinition, VMContext,
|
||||
getNonCompileUnitScope(Context), Name, LinkageName, File, LineNo, Ty,
|
||||
@ -647,8 +646,8 @@ DISubprogram *DIBuilder::createFunction(
|
||||
DISubprogram *DIBuilder::createTempFunctionFwdDecl(
|
||||
DIScope *Context, StringRef Name, StringRef LinkageName, DIFile *File,
|
||||
unsigned LineNo, DISubroutineType *Ty, bool isLocalToUnit,
|
||||
bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags, bool isOptimized,
|
||||
DITemplateParameterArray TParams, DISubprogram *Decl) {
|
||||
bool isDefinition, unsigned ScopeLine, DINode::DIFlags Flags,
|
||||
bool isOptimized, DITemplateParameterArray TParams, DISubprogram *Decl) {
|
||||
return DISubprogram::getTemporary(
|
||||
VMContext, getNonCompileUnitScope(Context), Name, LinkageName,
|
||||
File, LineNo, Ty, isLocalToUnit, isDefinition, ScopeLine, nullptr,
|
||||
@ -657,12 +656,13 @@ DISubprogram *DIBuilder::createTempFunctionFwdDecl(
|
||||
.release();
|
||||
}
|
||||
|
||||
DISubprogram *
|
||||
DIBuilder::createMethod(DIScope *Context, StringRef Name, StringRef LinkageName,
|
||||
DIFile *F, unsigned LineNo, DISubroutineType *Ty,
|
||||
bool isLocalToUnit, bool isDefinition, unsigned VK,
|
||||
unsigned VIndex, int ThisAdjustment,
|
||||
DIType *VTableHolder, DINode::DIFlags Flags, bool isOptimized,
|
||||
DISubprogram *DIBuilder::createMethod(DIScope *Context, StringRef Name,
|
||||
StringRef LinkageName, DIFile *F,
|
||||
unsigned LineNo, DISubroutineType *Ty,
|
||||
bool isLocalToUnit, bool isDefinition,
|
||||
unsigned VK, unsigned VIndex,
|
||||
int ThisAdjustment, DIType *VTableHolder,
|
||||
DINode::DIFlags Flags, bool isOptimized,
|
||||
DITemplateParameterArray TParams) {
|
||||
assert(getNonCompileUnitScope(Context) &&
|
||||
"Methods should have both a Context and a context that isn't "
|
||||
|
@ -333,9 +333,8 @@ DICompositeType *DICompositeType::getODRTypeIfExists(LLVMContext &Context,
|
||||
return Context.pImpl->DITypeMap->lookup(&Identifier);
|
||||
}
|
||||
|
||||
DISubroutineType *DISubroutineType::getImpl(LLVMContext &Context,
|
||||
DIFlags Flags, uint8_t CC,
|
||||
Metadata *TypeArray,
|
||||
DISubroutineType *DISubroutineType::getImpl(LLVMContext &Context, DIFlags Flags,
|
||||
uint8_t CC, Metadata *TypeArray,
|
||||
StorageType Storage,
|
||||
bool ShouldCreate) {
|
||||
DEFINE_GETIMPL_LOOKUP(DISubroutineType, (Flags, CC, TypeArray));
|
||||
|
@ -71,9 +71,11 @@ TEST(DINodeTest, splitFlags) {
|
||||
CHECK_SPLIT(DINode::FlagProtected, {DINode::FlagProtected}, DINode::FlagZero);
|
||||
CHECK_SPLIT(DINode::FlagPrivate, {DINode::FlagPrivate}, DINode::FlagZero);
|
||||
CHECK_SPLIT(DINode::FlagVector, {DINode::FlagVector}, DINode::FlagZero);
|
||||
CHECK_SPLIT(DINode::FlagRValueReference, {DINode::FlagRValueReference}, DINode::FlagZero);
|
||||
CHECK_SPLIT(DINode::FlagRValueReference, {DINode::FlagRValueReference},
|
||||
DINode::FlagZero);
|
||||
DINode::DIFlags Flags[] = {DINode::FlagFwdDecl, DINode::FlagVector};
|
||||
CHECK_SPLIT(DINode::FlagFwdDecl | DINode::FlagVector, Flags, DINode::FlagZero);
|
||||
CHECK_SPLIT(DINode::FlagFwdDecl | DINode::FlagVector, Flags,
|
||||
DINode::FlagZero);
|
||||
CHECK_SPLIT(DINode::FlagZero, {}, DINode::FlagZero);
|
||||
#undef CHECK_SPLIT
|
||||
}
|
||||
|
@ -44,16 +44,15 @@ TEST(DebugTypeODRUniquingTest, getODRType) {
|
||||
|
||||
// Check that we get it back, even if we change a field.
|
||||
EXPECT_EQ(&CT, DICompositeType::getODRTypeIfExists(Context, UUID));
|
||||
EXPECT_EQ(
|
||||
&CT, DICompositeType::getODRType(Context, UUID, dwarf::DW_TAG_class_type,
|
||||
nullptr, nullptr, 0, nullptr, nullptr, 0,
|
||||
0, 0, DINode::FlagZero, nullptr, 0,
|
||||
nullptr, nullptr));
|
||||
EXPECT_EQ(&CT, DICompositeType::getODRType(
|
||||
Context, UUID, dwarf::DW_TAG_class_type,
|
||||
MDString::get(Context, "name"), nullptr, 0, nullptr,
|
||||
nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0,
|
||||
Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr,
|
||||
0, nullptr, nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0,
|
||||
nullptr, nullptr));
|
||||
EXPECT_EQ(&CT,
|
||||
DICompositeType::getODRType(
|
||||
Context, UUID, dwarf::DW_TAG_class_type,
|
||||
MDString::get(Context, "name"), nullptr, 0, nullptr, nullptr, 0,
|
||||
0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr));
|
||||
|
||||
// Check that it's discarded with the type map.
|
||||
Context.disableDebugTypeODRUniquing();
|
||||
@ -84,8 +83,9 @@ TEST(DebugTypeODRUniquingTest, buildODRType) {
|
||||
|
||||
// Update with a definition. This time we should see a change.
|
||||
EXPECT_EQ(&CT, DICompositeType::buildODRType(
|
||||
Context, UUID, dwarf::DW_TAG_structure_type, nullptr, nullptr, 0, nullptr,
|
||||
nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr));
|
||||
Context, UUID, dwarf::DW_TAG_structure_type, nullptr,
|
||||
nullptr, 0, nullptr, nullptr, 0, 0, 0, DINode::FlagZero,
|
||||
nullptr, 0, nullptr, nullptr));
|
||||
EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag());
|
||||
|
||||
// Further updates should be ignored.
|
||||
@ -94,8 +94,9 @@ TEST(DebugTypeODRUniquingTest, buildODRType) {
|
||||
nullptr, 0, 0, 0, DINode::FlagFwdDecl, nullptr, 0, nullptr, nullptr));
|
||||
EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag());
|
||||
EXPECT_EQ(&CT, DICompositeType::buildODRType(
|
||||
Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr, 0, nullptr,
|
||||
nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0, nullptr, nullptr));
|
||||
Context, UUID, dwarf::DW_TAG_class_type, nullptr, nullptr,
|
||||
0, nullptr, nullptr, 0, 0, 0, DINode::FlagZero, nullptr, 0,
|
||||
nullptr, nullptr));
|
||||
EXPECT_EQ(dwarf::DW_TAG_structure_type, CT.getTag());
|
||||
}
|
||||
|
||||
|
@ -343,13 +343,11 @@ TEST_F(IRBuilderTest, DIBuilder) {
|
||||
auto CU = DIB.createCompileUnit(dwarf::DW_LANG_Cobol74, "F.CBL", "/",
|
||||
"llvm-cobol74", true, "", 0);
|
||||
auto Type = DIB.createSubroutineType(DIB.getOrCreateTypeArray(None));
|
||||
auto SP =
|
||||
DIB.createFunction(CU, "foo", "", File, 1, Type, false, true, 1,
|
||||
auto SP = DIB.createFunction(CU, "foo", "", File, 1, Type, false, true, 1,
|
||||
DINode::FlagZero, true);
|
||||
F->setSubprogram(SP);
|
||||
AllocaInst *I = Builder.CreateAlloca(Builder.getInt8Ty());
|
||||
auto BarSP =
|
||||
DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
|
||||
auto BarSP = DIB.createFunction(CU, "bar", "", File, 1, Type, false, true, 1,
|
||||
DINode::FlagZero, true);
|
||||
auto BadScope = DIB.createLexicalBlockFile(BarSP, File, 0);
|
||||
I->setDebugLoc(DebugLoc::get(2, 0, BadScope));
|
||||
|
@ -80,13 +80,13 @@ protected:
|
||||
|
||||
MDTuple *getTuple() { return MDTuple::getDistinct(Context, None); }
|
||||
DISubroutineType *getSubroutineType() {
|
||||
return DISubroutineType::getDistinct(Context, DINode::FlagZero,
|
||||
0, getNode(nullptr));
|
||||
return DISubroutineType::getDistinct(Context, DINode::FlagZero, 0,
|
||||
getNode(nullptr));
|
||||
}
|
||||
DISubprogram *getSubprogram() {
|
||||
return DISubprogram::getDistinct(Context, nullptr, "", "", nullptr, 0,
|
||||
nullptr, false, false, 0, nullptr,
|
||||
0, 0, 0, DINode::FlagZero, false, nullptr);
|
||||
nullptr, false, false, 0, nullptr, 0, 0, 0,
|
||||
DINode::FlagZero, false, nullptr);
|
||||
}
|
||||
DIFile *getFile() {
|
||||
return DIFile::getDistinct(Context, "file.c", "/path/to/dir");
|
||||
@ -101,10 +101,9 @@ protected:
|
||||
return DIBasicType::get(Context, dwarf::DW_TAG_unspecified_type, Name);
|
||||
}
|
||||
DIType *getDerivedType() {
|
||||
return DIDerivedType::getDistinct(Context, dwarf::DW_TAG_pointer_type, "",
|
||||
nullptr, 0, nullptr,
|
||||
getBasicType("basictype"),
|
||||
1, 2, 0, DINode::FlagZero);
|
||||
return DIDerivedType::getDistinct(
|
||||
Context, dwarf::DW_TAG_pointer_type, "", nullptr, 0, nullptr,
|
||||
getBasicType("basictype"), 1, 2, 0, DINode::FlagZero);
|
||||
}
|
||||
Constant *getConstant() {
|
||||
return ConstantInt::get(Type::getInt32Ty(Context), Counter++);
|
||||
@ -1030,16 +1029,16 @@ TEST_F(DITypeTest, setFlags) {
|
||||
Metadata *TypesOps[] = {nullptr};
|
||||
Metadata *Types = MDTuple::get(Context, TypesOps);
|
||||
|
||||
DIType *D = DISubroutineType::getDistinct(Context, DINode::FlagZero,
|
||||
0, Types);
|
||||
DIType *D =
|
||||
DISubroutineType::getDistinct(Context, DINode::FlagZero, 0, Types);
|
||||
EXPECT_EQ(DINode::FlagZero, D->getFlags());
|
||||
D->setFlags(DINode::FlagRValueReference);
|
||||
EXPECT_EQ(DINode::FlagRValueReference, D->getFlags());
|
||||
D->setFlags(DINode::FlagZero);
|
||||
EXPECT_EQ(DINode::FlagZero, D->getFlags());
|
||||
|
||||
TempDIType T = DISubroutineType::getTemporary(Context, DINode::FlagZero,
|
||||
0, Types);
|
||||
TempDIType T =
|
||||
DISubroutineType::getTemporary(Context, DINode::FlagZero, 0, Types);
|
||||
EXPECT_EQ(DINode::FlagZero, T->getFlags());
|
||||
T->setFlags(DINode::FlagRValueReference);
|
||||
EXPECT_EQ(DINode::FlagRValueReference, T->getFlags());
|
||||
@ -1057,9 +1056,9 @@ TEST_F(DIDerivedTypeTest, get) {
|
||||
DINode::DIFlags Flags5 = static_cast<DINode::DIFlags>(5);
|
||||
DINode::DIFlags Flags4 = static_cast<DINode::DIFlags>(4);
|
||||
|
||||
auto *N = DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
|
||||
File, 1, Scope, BaseType, 2, 3, 4,
|
||||
Flags5, ExtraData);
|
||||
auto *N =
|
||||
DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something", File,
|
||||
1, Scope, BaseType, 2, 3, 4, Flags5, ExtraData);
|
||||
EXPECT_EQ(dwarf::DW_TAG_pointer_type, N->getTag());
|
||||
EXPECT_EQ("something", N->getName());
|
||||
EXPECT_EQ(File, N->getFile());
|
||||
@ -1079,8 +1078,8 @@ TEST_F(DIDerivedTypeTest, get) {
|
||||
"something", File, 1, Scope, BaseType, 2, 3,
|
||||
4, Flags5, ExtraData));
|
||||
EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "else",
|
||||
File, 1, Scope, BaseType, 2, 3, 4,
|
||||
Flags5, ExtraData));
|
||||
File, 1, Scope, BaseType, 2, 3, 4, Flags5,
|
||||
ExtraData));
|
||||
EXPECT_NE(N, DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type,
|
||||
"something", getFile(), 1, Scope, BaseType, 2,
|
||||
3, 4, Flags5, ExtraData));
|
||||
@ -1120,9 +1119,9 @@ TEST_F(DIDerivedTypeTest, getWithLargeValues) {
|
||||
MDTuple *ExtraData = getTuple();
|
||||
DINode::DIFlags Flags = static_cast<DINode::DIFlags>(5);
|
||||
|
||||
auto *N = DIDerivedType::get(Context, dwarf::DW_TAG_pointer_type, "something",
|
||||
File, 1, Scope, BaseType, UINT64_MAX,
|
||||
UINT64_MAX - 1, UINT64_MAX - 2, Flags, ExtraData);
|
||||
auto *N = DIDerivedType::get(
|
||||
Context, dwarf::DW_TAG_pointer_type, "something", File, 1, Scope,
|
||||
BaseType, UINT64_MAX, UINT64_MAX - 1, UINT64_MAX - 2, Flags, ExtraData);
|
||||
EXPECT_EQ(UINT64_MAX, N->getSizeInBits());
|
||||
EXPECT_EQ(UINT64_MAX - 1, N->getAlignInBits());
|
||||
EXPECT_EQ(UINT64_MAX - 2, N->getOffsetInBits());
|
||||
|
@ -235,8 +235,9 @@ protected:
|
||||
DBuilder.createCompileUnit(dwarf::DW_LANG_C99, "filename.c",
|
||||
"/file/dir", "CloneFunc", false, "", 0);
|
||||
|
||||
auto *Subprogram = DBuilder.createFunction(
|
||||
CU, "f", "f", File, 4, FuncType, true, true, 3, DINode::FlagZero, false);
|
||||
auto *Subprogram =
|
||||
DBuilder.createFunction(CU, "f", "f", File, 4, FuncType, true, true, 3,
|
||||
DINode::FlagZero, false);
|
||||
OldFunc->setSubprogram(Subprogram);
|
||||
|
||||
// Function body
|
||||
@ -421,9 +422,9 @@ protected:
|
||||
DBuilder.createCompileUnit(dwarf::DW_LANG_C99, "filename.c",
|
||||
"/file/dir", "CloneModule", false, "", 0);
|
||||
// Function DI
|
||||
auto *Subprogram = DBuilder.createFunction(CU, "f", "f", File, 4, DFuncType,
|
||||
true, true, 3, DINode::FlagZero,
|
||||
false);
|
||||
auto *Subprogram =
|
||||
DBuilder.createFunction(CU, "f", "f", File, 4, DFuncType, true, true, 3,
|
||||
DINode::FlagZero, false);
|
||||
F->setSubprogram(Subprogram);
|
||||
|
||||
auto *Entry = BasicBlock::Create(C, "", F);
|
||||
|
Loading…
x
Reference in New Issue
Block a user