hanchenye-llvm-project/clang/lib
Eli Friedman 3f82f9e127 [CodeGen] Always use string computed in Sema for PredefinedExpr
We can't use any other string, anyway, because its type wouldn't
match the type of the PredefinedExpr.

With this change, we don't compute a "nice" name for the __func__ global
when it's used in the initializer for a constant. This doesn't seem like
a great loss, and I'm not sure how to fix it without either storing more
information in the AST, or somehow threading through the information
from ExprConstant.cpp.

This could break some situations involving BlockDecl; currently,
CodeGenFunction::EmitPredefinedLValue has some logic to intentionally
emit a string different from what Sema computed.  This code skips that
logic... but that logic can't work correctly in general anyway.  (For
example, sizeof(__func__) returns the wrong result.) Hopefully this
doesn't affect practical code.

Fixes https://bugs.llvm.org/show_bug.cgi?id=40313 .

Differential Revision: https://reviews.llvm.org/D56821

llvm-svn: 351766
2019-01-22 00:11:17 +00:00
..
ARCMigrate Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
AST Replace llvm::isPodLike<...> by llvm::is_trivially_copyable<...> 2019-01-20 21:19:56 +00:00
ASTMatchers Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Analysis Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Basic Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CodeGen [CodeGen] Always use string computed in Sema for PredefinedExpr 2019-01-22 00:11:17 +00:00
CrossTU Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Driver [Driver] Don't pass default value to getCompilerRTArgString 2019-01-21 01:34:09 +00:00
Edit Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Format Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Frontend Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
FrontendTool Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Headers [X86] Remove the cvtuqq2ps256/cvtqq2ps256 mask builtins. Replace with uitofp/sitofp and select. 2019-01-20 19:04:56 +00:00
Index Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Lex Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Parse [OpenCL] Allow address spaces as method qualifiers. 2019-01-21 16:01:38 +00:00
Rewrite Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
Sema Mark the lambda function pointer conversion operator as noexcept. 2019-01-21 16:25:08 +00:00
Serialization Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StaticAnalyzer [Analyzer] Remove extra blank line from Iterator Checker (test commit) 2019-01-21 15:31:23 +00:00
Tooling Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
CMakeLists.txt