diff options
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 52d99dc60e..2166a5c898 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -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())); |