Merge branch 'master' into nvptx_merge
This commit is contained in:
25
type.cpp
25
type.cpp
@@ -826,7 +826,7 @@ EnumType::GetDIType(llvm::DIDescriptor scope) const {
|
||||
|
||||
llvm::DIFile diFile = pos.GetDIFile();
|
||||
llvm::DIType diType =
|
||||
m->diBuilder->createEnumerationType(scope, name, diFile, pos.first_line,
|
||||
m->diBuilder->createEnumerationType(diFile, name, diFile, pos.first_line,
|
||||
32 /* size in bits */,
|
||||
32 /* align in bits */,
|
||||
elementArray
|
||||
@@ -1956,6 +1956,25 @@ StructType::IsConstType() const {
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
StructType::IsDefined() const {
|
||||
for (int i = 0; i < GetElementCount(); i++) {
|
||||
const Type *t = GetElementType(i);
|
||||
const UndefinedStructType *ust = CastType<UndefinedStructType>(t);
|
||||
if (ust != NULL) {
|
||||
return false;
|
||||
}
|
||||
const StructType *st = CastType<StructType>(t);
|
||||
if (st != NULL) {
|
||||
if (!st->IsDefined()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
const Type *
|
||||
StructType::GetBaseType() const {
|
||||
return this;
|
||||
@@ -2179,7 +2198,7 @@ StructType::GetDIType(llvm::DIDescriptor scope) const {
|
||||
llvm::DIArray elements = m->diBuilder->getOrCreateArray(elementLLVMTypes);
|
||||
llvm::DIFile diFile = pos.GetDIFile();
|
||||
return m->diBuilder->createStructType(
|
||||
scope,
|
||||
diFile,
|
||||
name,
|
||||
diFile,
|
||||
pos.first_line, // Line number
|
||||
@@ -2422,7 +2441,7 @@ UndefinedStructType::GetDIType(llvm::DIDescriptor scope) const {
|
||||
llvm::DIFile diFile = pos.GetDIFile();
|
||||
llvm::DIArray elements;
|
||||
return m->diBuilder->createStructType(
|
||||
scope,
|
||||
diFile,
|
||||
name,
|
||||
diFile,
|
||||
pos.first_line, // Line number
|
||||
|
||||
Reference in New Issue
Block a user