summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
authorNirav Dave <niravd@google.com>2016-04-05 17:50:43 +0000
committerNirav Dave <niravd@google.com>2016-04-05 17:50:43 +0000
commitd2f44d8de01a635e197b3ad4dcafdab5f2b4408a (patch)
tree036b34df394049a6f3e996a2155d8026153027cd /clang/lib/CodeGen/CodeGenFunction.cpp
parent376ab7cc7bf65e7c14308a4a4f6d411883097f9c (diff)
downloadbcm5719-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.cpp4
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))
OpenPOWER on IntegriCloud