summaryrefslogtreecommitdiff
path: root/lib/CodeGen/VirtRegMap.cpp
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2013-11-08 18:14:17 +0000
committerQuentin Colombet <qcolombet@apple.com>2013-11-08 18:14:17 +0000
commitf0c6ab6f00861fd97ad593cfc6d841082e4b4bd1 (patch)
treea4b17ccfe921f6276a7c3a1b7e5952eb5fc667c7 /lib/CodeGen/VirtRegMap.cpp
parent071a4f1a661d5469b67a64bea90887d8fd229a8f (diff)
downloadllvm-f0c6ab6f00861fd97ad593cfc6d841082e4b4bd1.tar.gz
llvm-f0c6ab6f00861fd97ad593cfc6d841082e4b4bd1.tar.bz2
llvm-f0c6ab6f00861fd97ad593cfc6d841082e4b4bd1.tar.xz
[VirtRegMap] Fix for PR17825. Do not ignore noreturn definitions when setting
isPhysRegUsed if the unwind information is required. Indeed, the runtime may need a correct stack to be able to unwind the call. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/VirtRegMap.cpp')
-rw-r--r--lib/CodeGen/VirtRegMap.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/CodeGen/VirtRegMap.cpp b/lib/CodeGen/VirtRegMap.cpp
index 0a08608ecf..e0aa405398 100644
--- a/lib/CodeGen/VirtRegMap.cpp
+++ b/lib/CodeGen/VirtRegMap.cpp
@@ -285,7 +285,11 @@ void VirtRegRewriter::rewrite() {
if (!MO.isGlobal())
continue;
const Function *Func = dyn_cast<Function>(MO.getGlobal());
- if (!Func || !Func->hasFnAttribute(Attribute::NoReturn))
+ if (!Func || !Func->hasFnAttribute(Attribute::NoReturn) ||
+ // We need to keep correct unwind information
+ // even if the function will not return, since the
+ // runtime may need it.
+ !Func->hasFnAttribute(Attribute::NoUnwind))
continue;
NoReturnInsts.insert(MI);
break;