diff options
author | Nirav Dave <niravd@google.com> | 2016-04-05 17:50:43 +0000 |
---|---|---|
committer | Nirav Dave <niravd@google.com> | 2016-04-05 17:50:43 +0000 |
commit | d2f44d8de01a635e197b3ad4dcafdab5f2b4408a (patch) | |
tree | 036b34df394049a6f3e996a2155d8026153027cd /clang/lib/CodeGen/CodeGenFunction.cpp | |
parent | 376ab7cc7bf65e7c14308a4a4f6d411883097f9c (diff) | |
download | bcm5719-llvm-d2f44d8de01a635e197b3ad4dcafdab5f2b4408a.tar.gz bcm5719-llvm-d2f44d8de01a635e197b3ad4dcafdab5f2b4408a.zip |
Add -fno-jump-tables and-fjump-tables flags
Add no-jump-tables flag to disable use of jump tables when lowering
switch statements
Reviewers: echristo, hans
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D18407
llvm-svn: 265425
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp index 71c364cabc5..8acc256cb3f 100644 --- a/clang/lib/CodeGen/CodeGenFunction.cpp +++ b/clang/lib/CodeGen/CodeGenFunction.cpp @@ -711,6 +711,10 @@ void CodeGenFunction::StartFunction(GlobalDecl GD, Fn->addFnAttr(llvm::Attribute::NoInline); } + // Add no-jump-tables value. + Fn->addFnAttr("no-jump-tables", + llvm::toStringRef(CGM.getCodeGenOpts().NoUseJumpTables)); + if (getLangOpts().OpenCL) { // Add metadata for a kernel function. if (const FunctionDecl *FD = dyn_cast_or_null<FunctionDecl>(D)) |