зеркало из https://github.com/microsoft/clang-1.git
Extend ASTContext::getTypeInfo() and ASTContext::getObjCEncodingForType() for BlockTypes.
This fixes <rdar://problem/6240616> clang: Assertion failed when using typedef and Blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56554 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
cafd9089a4
Коммит
485eeff9ba
|
@ -308,6 +308,12 @@ ASTContext::getTypeInfo(QualType T) {
|
||||||
Width = Target.getPointerWidth(0);
|
Width = Target.getPointerWidth(0);
|
||||||
Align = Target.getPointerAlign(0);
|
Align = Target.getPointerAlign(0);
|
||||||
break;
|
break;
|
||||||
|
case Type::BlockPointer: {
|
||||||
|
unsigned AS = cast<BlockPointerType>(T)->getPointeeType().getAddressSpace();
|
||||||
|
Width = Target.getPointerWidth(AS);
|
||||||
|
Align = Target.getPointerAlign(AS);
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Type::Pointer: {
|
case Type::Pointer: {
|
||||||
unsigned AS = cast<PointerType>(T)->getPointeeType().getAddressSpace();
|
unsigned AS = cast<PointerType>(T)->getPointeeType().getAddressSpace();
|
||||||
Width = Target.getPointerWidth(AS);
|
Width = Target.getPointerWidth(AS);
|
||||||
|
@ -1668,6 +1674,8 @@ void ASTContext::getObjCEncodingForType(QualType T, std::string& S,
|
||||||
S += '}';
|
S += '}';
|
||||||
} else if (T->isEnumeralType()) {
|
} else if (T->isEnumeralType()) {
|
||||||
S += 'i';
|
S += 'i';
|
||||||
|
} else if (T->isBlockPointerType()) {
|
||||||
|
S += '^'; // This type string is the same as general pointers.
|
||||||
} else
|
} else
|
||||||
assert(0 && "@encode for type not implemented!");
|
assert(0 && "@encode for type not implemented!");
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче