diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-02-26 23:50:07 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-02-26 23:50:07 +0000 |
| commit | deaad8cc34239d93ca3f31a0585d69c6969d0b43 (patch) | |
| tree | ceb2800303cb600d77f74cf20ea9884a1c4498c8 /clang/lib/Sema/SemaExpr.cpp | |
| parent | 007cb026c9a4f56302bea0e8e3ff10fdb002b313 (diff) | |
| download | bcm5719-llvm-deaad8cc34239d93ca3f31a0585d69c6969d0b43.tar.gz bcm5719-llvm-deaad8cc34239d93ca3f31a0585d69c6969d0b43.zip | |
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...
llvm-svn: 65591
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 01be6b2474c..29d5f59de91 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -887,8 +887,8 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc, // type. QualType T = Func->getType(); QualType NoProtoType = T; - if (const FunctionTypeProto *Proto = T->getAsFunctionTypeProto()) - NoProtoType = Context.getFunctionTypeNoProto(Proto->getResultType()); + if (const FunctionProtoType *Proto = T->getAsFunctionProtoType()) + NoProtoType = Context.getFunctionNoProtoType(Proto->getResultType()); return Owned(BuildDeclRefExpr(VD, NoProtoType, Loc, false, false, SS)); } } @@ -1949,7 +1949,7 @@ Sema::ActOnMemberReferenceExpr(Scope *S, ExprArg Base, SourceLocation OpLoc, bool Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn, FunctionDecl *FDecl, - const FunctionTypeProto *Proto, + const FunctionProtoType *Proto, Expr **Args, unsigned NumArgs, SourceLocation RParenLoc) { // C99 6.5.2.2p7 - the arguments are implicitly converted, as if by @@ -2164,12 +2164,12 @@ Sema::ActOnCallExpr(Scope *S, ExprArg fn, SourceLocation LParenLoc, // We know the result type of the call, set it. TheCall->setType(FuncT->getResultType().getNonReferenceType()); - if (const FunctionTypeProto *Proto = dyn_cast<FunctionTypeProto>(FuncT)) { + if (const FunctionProtoType *Proto = dyn_cast<FunctionProtoType>(FuncT)) { if (ConvertArgumentsForCall(&*TheCall, Fn, FDecl, Proto, Args, NumArgs, RParenLoc)) return ExprError(); } else { - assert(isa<FunctionTypeNoProto>(FuncT) && "Unknown FunctionType!"); + assert(isa<FunctionNoProtoType>(FuncT) && "Unknown FunctionType!"); // Promote the arguments (C99 6.5.2.2p6). for (unsigned i = 0; i != NumArgs; i++) { @@ -4501,7 +4501,7 @@ Sema::ExprResult Sema::ActOnBlockStmtExpr(SourceLocation CaretLoc, StmtTy *body, QualType BlockTy; if (!BSI->hasPrototype) - BlockTy = Context.getFunctionTypeNoProto(RetTy); + BlockTy = Context.getFunctionNoProtoType(RetTy); else BlockTy = Context.getFunctionType(RetTy, &ArgTypes[0], ArgTypes.size(), BSI->isVariadic, 0); |

