aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaChecking.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-26 23:50:07 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-26 23:50:07 +0000
commit72564e73277e29f6db3305d1f27ba408abb7ed88 (patch)
tree857ee84221eb8cb9b57d6b2e787347696c282f63 /lib/Sema/SemaChecking.cpp
parent3a2503227c3db04a3619735127483263c1075ef7 (diff)
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
Diffstat (limited to 'lib/Sema/SemaChecking.cpp')
-rw-r--r--lib/Sema/SemaChecking.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index fdd22fa4bf..3e6bd5a2ef 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -144,8 +144,8 @@ Sema::CheckFunctionCall(FunctionDecl *FDecl, CallExpr *TheCall) {
if (const FormatAttr *Format = FDecl->getAttr<FormatAttr>()) {
if (Format->getType() == "printf") {
bool HasVAListArg = false;
- if (const FunctionTypeProto *Proto
- = FDecl->getType()->getAsFunctionTypeProto())
+ if (const FunctionProtoType *Proto
+ = FDecl->getType()->getAsFunctionProtoType())
HasVAListArg = !Proto->isVariadic();
CheckPrintfArguments(TheCall, HasVAListArg, Format->getFormatIdx() - 1,
Format->getFirstArg() - 1);
@@ -210,8 +210,8 @@ bool Sema::SemaBuiltinVAStart(CallExpr *TheCall) {
// Determine whether the current function is variadic or not.
bool isVariadic;
if (getCurFunctionDecl()) {
- if (FunctionTypeProto* FTP =
- dyn_cast<FunctionTypeProto>(getCurFunctionDecl()->getType()))
+ if (FunctionProtoType* FTP =
+ dyn_cast<FunctionProtoType>(getCurFunctionDecl()->getType()))
isVariadic = FTP->isVariadic();
else
isVariadic = false;