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/CodeGenFunction.cpp | |
parent | 56c70441dca2687bf019d96428728a8ab064a885 (diff) | |
download | llvm-85365cd72a9d57c97a96dc845031068ced5aaf18.zip llvm-85365cd72a9d57c97a96dc845031068ced5aaf18.tar.gz llvm-85365cd72a9d57c97a96dc845031068ced5aaf18.tar.bz2 |
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/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index f1fc8c4..1fca466 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -930,8 +930,9 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn, EmitCheck(std::make_pair(IsFalse, SanitizerKind::Return), "missing_return", EmitCheckSourceLocation(FD->getLocation()), None); - } else if (CGM.getCodeGenOpts().OptimizationLevel == 0) - Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::trap), {}); + } else if (CGM.getCodeGenOpts().OptimizationLevel == 0) { + EmitTrapCall(llvm::Intrinsic::trap); + } Builder.CreateUnreachable(); Builder.ClearInsertionPoint(); } |