diff options
Diffstat (limited to 'lib/Target/TargetMachine.cpp')
-rw-r--r-- | lib/Target/TargetMachine.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 600a120e86..0bf0e374d1 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -40,6 +40,7 @@ namespace llvm { bool RealignStack; bool VerboseAsm; bool DisableJumpTables; + StackCanaries::Model StackProtectors; } static cl::opt<bool, true> PrintCode("print-machineinstrs", @@ -163,6 +164,21 @@ DisableSwitchTables(cl::Hidden, "disable-jump-tables", cl::location(DisableJumpTables), cl::init(false)); +static cl::opt<llvm::StackCanaries::Model, true> +GenerateStackProtectors("stack-protector", + cl::desc("Generate stack protectors"), + cl::location(StackProtectors), + cl::init(StackCanaries::Default), + cl::values( + clEnumValN(StackCanaries::Default, "default", + " No stack protectors"), + clEnumValN(StackCanaries::On, "on", + " Generate stack protectors for functions that" + "need them"), + clEnumValN(StackCanaries::Always, "all", + " Generate stack protectors for all functions"), + clEnumValEnd)); + //--------------------------------------------------------------------------- // TargetMachine Class // |