diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-23 23:17:00 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-23 23:17:00 +0000 |
commit | 1f0ce935e8c58f7862ea327b9c0245bc515008ec (patch) | |
tree | e89ef644732ff0c971782e139713056b14d78b9c | |
parent | f4f296de01568857bec625f2983f60638afbcc0e (diff) | |
download | bcm5719-llvm-1f0ce935e8c58f7862ea327b9c0245bc515008ec.tar.gz bcm5719-llvm-1f0ce935e8c58f7862ea327b9c0245bc515008ec.zip |
Another use of adjustParameterType. Plus, GetTypeForDeclarator will
always get ParmVarDecls with already-adjusted types. Assert it.
Thanks, Anders!
llvm-svn: 67576
-rw-r--r-- | clang/lib/Sema/SemaType.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp index 60ecb7abf71..fdd6ff91fe6 100644 --- a/clang/lib/Sema/SemaType.cpp +++ b/clang/lib/Sema/SemaType.cpp @@ -705,7 +705,7 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S, unsigned Skip) { assert(!ArgTy.isNull() && "Couldn't parse type?"); // Adjust the parameter type. - ArgTy = adjustParameterType(ArgTy); + assert((ArgTy == adjustParameterType(ArgTy)) && "Unadjusted type?"); // 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 @@ -860,13 +860,7 @@ QualType Sema::ObjCGetTypeForMethodDefinition(DeclTy *D) { E = MDecl->param_end(); PI != E; ++PI) { QualType ArgTy = (*PI)->getType(); assert(!ArgTy.isNull() && "Couldn't parse type?"); - // Perform the default function/array conversion (C99 6.7.5.3p[7,8]). - // This matches the conversion that is done in - // Sema::ActOnParamDeclarator(). - if (ArgTy->isArrayType()) - ArgTy = Context.getArrayDecayedType(ArgTy); - else if (ArgTy->isFunctionType()) - ArgTy = Context.getPointerType(ArgTy); + ArgTy = adjustParameterType(ArgTy); ArgTys.push_back(ArgTy); } T = Context.getFunctionType(T, &ArgTys[0], ArgTys.size(), |