diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-11-07 16:47:05 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-11-07 16:47:05 +0000 |
commit | c48f7e76fa5bc6f8fc68cd4bce7144df563b013c (patch) | |
tree | d153f616043d655b9e7ff2f874ea14a5eaee6b71 | |
parent | 083eb00d9d33a6f50b18b2e4ebb1e00411c5388c (diff) | |
download | bcm5719-llvm-c48f7e76fa5bc6f8fc68cd4bce7144df563b013c.tar.gz bcm5719-llvm-c48f7e76fa5bc6f8fc68cd4bce7144df563b013c.zip |
Revert r221404 which caused lldb to not display
vararg expressions.
llvm-svn: 221533
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 33 | ||||
-rw-r--r-- | clang/test/CodeGenCXX/unknown-anytype.cpp | 6 |
2 files changed, 0 insertions, 39 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index d1a2105afbc..a8e4407f34f 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -13343,39 +13343,6 @@ ExprResult RebuildUnknownAnyExpr::resolveDecl(Expr *E, ValueDecl *VD) { << VD << E->getSourceRange(); return ExprError(); } - if (const FunctionProtoType *FT = Type->getAs<FunctionProtoType>()) { - // We must match the FunctionDecl's type to the hack introduced in - // RebuildUnknownAnyExpr::VisitCallExpr to vararg functions of unknown - // type. See the lengthy commentary in that routine. - QualType FDT = FD->getType(); - const FunctionType *FnType = FDT->castAs<FunctionType>(); - const FunctionProtoType *Proto = dyn_cast_or_null<FunctionProtoType>(FnType); - DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E); - if (DRE && Proto && Proto->getParamTypes().empty() && Proto->isVariadic()) { - SourceLocation Loc = FD->getLocation(); - FunctionDecl *NewFD = FunctionDecl::Create(FD->getASTContext(), - FD->getDeclContext(), - Loc, Loc, FD->getNameInfo().getName(), - DestType, FD->getTypeSourceInfo(), - SC_None, false/*isInlineSpecified*/, - FD->hasPrototype(), - false/*isConstexprSpecified*/); - - if (FD->getQualifier()) - NewFD->setQualifierInfo(FD->getQualifierLoc()); - - SmallVector<ParmVarDecl*, 16> Params; - for (const auto &AI : FT->param_types()) { - ParmVarDecl *Param = - S.BuildParmVarDeclForTypedef(FD, Loc, AI); - Param->setScopeInfo(0, Params.size()); - Params.push_back(Param); - } - NewFD->setParams(Params); - DRE->setDecl(NewFD); - VD = DRE->getDecl(); - } - } if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(FD)) if (MD->isInstance()) { diff --git a/clang/test/CodeGenCXX/unknown-anytype.cpp b/clang/test/CodeGenCXX/unknown-anytype.cpp index c1b8c7df708..aacb8493ef3 100644 --- a/clang/test/CodeGenCXX/unknown-anytype.cpp +++ b/clang/test/CodeGenCXX/unknown-anytype.cpp @@ -115,9 +115,3 @@ extern "C" __unknown_anytype test10_any(...); void test10() { (void) test10_any(), (void) test10_any(); } - -extern "C" __unknown_anytype malloc(...); -void test11() { - void *s = (void*)malloc(12); - void *d = (void*)malloc(435); -} |