Create a new TypeNodes.def file that enumerates all of the types,
giving them rough classifications (normal types, never-canonical
types, always-dependent types, abstract type representations) and
making it far easier to make sure that we've hit all of the cases when
decoding types.
Switched some switch() statements on the type class over to using this
mechanism, and filtering out those things we don't care about. For
example, CodeGen should never see always-dependent or non-canonical
types, while debug info generation should never see always-dependent
types. More switch() statements on the type class need to be moved
over to using this approach, so that we'll get warnings when we add a
new type then fail to account for it somewhere in the compiler.
As part of this, some types have been renamed:
TypeOfExpr -> TypeOfExprType
FunctionTypeProto -> FunctionProtoType
FunctionTypeNoProto -> FunctionNoProtoType
There shouldn't be any functionality change...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65591 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 47cf8e5..d1dcca6 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -172,7 +172,7 @@
Expr *E = static_cast<Expr *>(DS.getTypeRep());
assert(E && "Didn't get an expression for typeof?");
// TypeQuals handled by caller.
- Result = Context.getTypeOfExpr(E);
+ Result = Context.getTypeOfExprType(E);
break;
}
case DeclSpec::TST_error:
@@ -505,7 +505,7 @@
T = Context.getFunctionType(T, NULL, 0, FTI.isVariadic, 0);
} else {
// Simple void foo(), where the incoming T is the result type.
- T = Context.getFunctionTypeNoProto(T);
+ T = Context.getFunctionNoProtoType(T);
}
} else if (FTI.ArgInfo[0].Param == 0) {
// C99 6.7.5.3p3: Reject int(x,y,z) when it's not a function definition.
@@ -540,7 +540,7 @@
// Look for 'void'. void is allowed only as a single argument to a
// function with no other parameters (C99 6.7.5.3p10). We record
- // int(void) as a FunctionTypeProto with an empty argument list.
+ // int(void) as a FunctionProtoType with an empty argument list.
else if (ArgTy->isVoidType()) {
// If this is something like 'float(int, void)', reject it. 'void'
// is an incomplete type (C99 6.2.5p19) and function decls cannot
@@ -634,8 +634,8 @@
}
if (getLangOptions().CPlusPlus && T->isFunctionType()) {
- const FunctionTypeProto *FnTy = T->getAsFunctionTypeProto();
- assert(FnTy && "Why oh why is there not a FunctionTypeProto here ?");
+ const FunctionProtoType *FnTy = T->getAsFunctionProtoType();
+ assert(FnTy && "Why oh why is there not a FunctionProtoType here ?");
// C++ 8.3.5p4: A cv-qualifier-seq shall only be part of the function type
// for a nonstatic member function, the function type to which a pointer