diff options
author | Wei Pan <wei.pan@intel.com> | 2013-08-26 14:27:34 +0000 |
---|---|---|
committer | Wei Pan <wei.pan@intel.com> | 2013-08-26 14:27:34 +0000 |
commit | 8d6b19a518b68a045e3db4e06b3ddc5023ffd046 (patch) | |
tree | 01b9d2fd095cbc7acabfe6821fb0aeec604510aa /clang/lib/CodeGen/CGExpr.cpp | |
parent | 91780dec58c88880cc264a4cdd1f8ba3a420159b (diff) | |
download | bcm5719-llvm-8d6b19a518b68a045e3db4e06b3ddc5023ffd046.tar.gz bcm5719-llvm-8d6b19a518b68a045e3db4e06b3ddc5023ffd046.zip |
Handle predefined expression for a captured statement
- __func__ or __FUNCTION__ returns captured statement's parent
function name, not the one compiler generated.
Differential Revision: http://llvm-reviews.chandlerc.com/D1491
Reviewed by bkramer
llvm-svn: 189219
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGExpr.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp index f5ca2d09740..2579d5bd633 100644 --- a/clang/lib/CodeGen/CGExpr.cpp +++ b/clang/lib/CodeGen/CGExpr.cpp @@ -1972,6 +1972,10 @@ LValue CodeGenFunction::EmitPredefinedLValue(const PredefinedExpr *E) { // Blocks use the mangled function name. // FIXME: ComputeName should handle blocks. FunctionName = FnName.str(); + } else if (isa<CapturedDecl>(CurDecl)) { + // For a captured statement, the function name is its enclosing + // function name not the one compiler generated. + FunctionName = PredefinedExpr::ComputeName(IdentType, CurDecl); } else { FunctionName = PredefinedExpr::ComputeName(IdentType, CurDecl); assert(cast<ConstantArrayType>(E->getType())->getSize() - 1 == |