summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2014-04-19 13:47:43 +0000
committerYaron Keren <yaron.keren@gmail.com>2014-04-19 13:47:43 +0000
commit64b2297786f7fd6f5fa24cdd4db0298fbf211466 (patch)
treec5250834c0fd832fbdb7363822269f603cee844f /include
parent2fa9e6ca34a1f696904c0b8006c91d64679c2b51 (diff)
downloadllvm-64b2297786f7fd6f5fa24cdd4db0298fbf211466.tar.gz
llvm-64b2297786f7fd6f5fa24cdd4db0298fbf211466.tar.bz2
llvm-64b2297786f7fd6f5fa24cdd4db0298fbf211466.tar.xz
Patch by Vadim Chugunov
Win64 stack unwinder gets confused when execution flow "falls through" after a call to 'noreturn' function. This fixes the "missing epilogue" problem by emitting a trap instruction for IR 'unreachable' on x86_x64-pc-windows. A secondary use for it would be for anyone wanting to make double-sure that 'noreturn' functions, indeed, do not return. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@206684 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Target/TargetOptions.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/llvm/Target/TargetOptions.h b/include/llvm/Target/TargetOptions.h
index 122324fbb0..71a1fcf4c0 100644
--- a/include/llvm/Target/TargetOptions.h
+++ b/include/llvm/Target/TargetOptions.h
@@ -51,6 +51,7 @@ namespace llvm {
EnableFastISel(false), PositionIndependentExecutable(false),
UseInitArray(false),
DisableIntegratedAS(false), CompressDebugSections(false),
+ TrapUnreachable(false),
TrapFuncName(""), FloatABIType(FloatABI::Default),
AllowFPOpFusion(FPOpFusion::Standard) {}
@@ -162,6 +163,9 @@ namespace llvm {
/// Compress DWARF debug sections.
unsigned CompressDebugSections : 1;
+ /// Emit target-specific trap instruction for 'unreachable' IR instructions.
+ unsigned TrapUnreachable : 1;
+
/// getTrapFunctionName - If this returns a non-empty string, this means
/// isel should lower Intrinsic::trap to a call to the specified function
/// name instead of an ISD::TRAP node.
@@ -216,6 +220,7 @@ inline bool operator==(const TargetOptions &LHS,
ARE_EQUAL(EnableFastISel) &&
ARE_EQUAL(PositionIndependentExecutable) &&
ARE_EQUAL(UseInitArray) &&
+ ARE_EQUAL(TrapUnreachable) &&
ARE_EQUAL(TrapFuncName) &&
ARE_EQUAL(FloatABIType) &&
ARE_EQUAL(AllowFPOpFusion);