From b5437d238752dc297e42410e98d38d5250fe0463 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 23 Apr 2009 05:30:27 +0000 Subject: the logic for computing __func__ and friends is really broken: the type assigned by sema (and is visible with sizeof(__func__) for example) has nothing to do with what codegen ends up producing. We should eventually add a method on PredefinedExpr to handle this. In the meantime, just set up some framework and add some fixme's. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69872 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGExpr.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/CGExpr.cpp') diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 67b6e4c3d7..ed1baa0da0 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -752,8 +752,11 @@ LValue CodeGenFunction::EmitPredefinedFunctionName(unsigned Type) { break; } + // FIXME: This isn't right at all. The logic for computing this should go + // into a method on PredefinedExpr. This would allow sema and codegen to be + // consistent for things like sizeof(__func__) etc. std::string FunctionName; - if (const FunctionDecl *FD = dyn_cast_or_null(CurFuncDecl)) { + if (const FunctionDecl *FD = dyn_cast_or_null(CurCodeDecl)) { FunctionName = CGM.getMangledName(FD); } else { // Just get the mangled name; skipping the asm prefix if it -- cgit v1.2.3