add codegen support for __func__ and friends, producing the same

output that GCC does.  rdar://6440297

llvm-svn: 60922
This commit is contained in:
Chris Lattner 2008-12-12 05:18:02 +00:00
parent f45c5ecb3b
commit b4396f40a0
1 changed files with 10 additions and 0 deletions

View File

@ -612,6 +612,16 @@ public:
}
break;
}
case Expr::PredefinedExprClass: {
// __func__/__FUNCTION__ -> "". __PRETTY_FUNCTION__ -> "top level".
std::string Str;
if (cast<PredefinedExpr>(E)->getIdentType() ==
PredefinedExpr::PrettyFunction)
Str = "top level";
return CGM.GetAddrOfConstantCString(Str, ".tmp");
}
}
CGM.ErrorUnsupported(E, "constant l-value expression");
llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));