diff options
| author | Akira Hatanaka <ahatanaka@apple.com> | 2015-07-02 22:15:41 +0000 |
|---|---|---|
| committer | Akira Hatanaka <ahatanaka@apple.com> | 2015-07-02 22:15:41 +0000 |
| commit | 85365cd72a9d57c97a96dc845031068ced5aaf18 (patch) | |
| tree | 7d401e422b776052a9c212a5ae49e1f44c4c1c6d /clang/lib/CodeGen/CGCall.cpp | |
| parent | 56c70441dca2687bf019d96428728a8ab064a885 (diff) | |
| download | bcm5719-llvm-85365cd72a9d57c97a96dc845031068ced5aaf18.tar.gz bcm5719-llvm-85365cd72a9d57c97a96dc845031068ced5aaf18.zip | |
Attach attribute "trap-func-name" to call sites of llvm.trap and llvm.debugtrap.
This is needed to use clang's command line option "-ftrap-function" for LTO and
enable changing the trap function name on a per-call-site basis.
rdar://problem/21225723
Differential Revision: http://reviews.llvm.org/D10831
llvm-svn: 241306
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 142966e7c01..0535c05da5d 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -1452,6 +1452,8 @@ void CodeGenModule::ConstructAttributeList(const CGFunctionInfo &FI, // Attributes that should go on the call site only. if (!CodeGenOpts.SimplifyLibCalls) FuncAttrs.addAttribute(llvm::Attribute::NoBuiltin); + if (!CodeGenOpts.TrapFuncName.empty()) + FuncAttrs.addAttribute("trap-func-name", CodeGenOpts.TrapFuncName); } else { // Attributes that should go on the function, but not the call site. if (!CodeGenOpts.DisableFPElim) { |

