[llvm] r211317 - Set missing options in LTOCodeGenerator::setTargetOptions.

Rafael Espindola rafael.espindola at gmail.com
Thu Jun 19 15:14:13 PDT 2014


Author: rafael
Date: Thu Jun 19 17:14:12 2014
New Revision: 211317

URL: http://llvm.org/viewvc/llvm-project?rev=211317&view=rev
Log:
Set missing options in LTOCodeGenerator::setTargetOptions.

Patch by Tom Roeder, I just added the test.

Added:
    llvm/trunk/test/LTO/jump-table-type.ll
Modified:
    llvm/trunk/lib/LTO/LTOCodeGenerator.cpp

Modified: llvm/trunk/lib/LTO/LTOCodeGenerator.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/LTO/LTOCodeGenerator.cpp?rev=211317&r1=211316&r2=211317&view=diff
==============================================================================
--- llvm/trunk/lib/LTO/LTOCodeGenerator.cpp (original)
+++ llvm/trunk/lib/LTO/LTOCodeGenerator.cpp Thu Jun 19 17:14:12 2014
@@ -141,6 +141,11 @@ void LTOCodeGenerator::setTargetOptions(
   Options.TrapFuncName = options.TrapFuncName;
   Options.PositionIndependentExecutable = options.PositionIndependentExecutable;
   Options.UseInitArray = options.UseInitArray;
+  Options.DataSections = options.DataSections;
+  Options.FunctionSections = options.FunctionSections;
+
+  Options.MCOptions = options.MCOptions;
+  Options.JTType = options.JTType;
 }
 
 void LTOCodeGenerator::setDebugInfo(lto_debug_model debug) {

Added: llvm/trunk/test/LTO/jump-table-type.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/LTO/jump-table-type.ll?rev=211317&view=auto
==============================================================================
--- llvm/trunk/test/LTO/jump-table-type.ll (added)
+++ llvm/trunk/test/LTO/jump-table-type.ll Thu Jun 19 17:14:12 2014
@@ -0,0 +1,23 @@
+; RUN: llvm-as <%s >%t1
+; RUN: llvm-lto -o %t2 %t1 -jump-table-type=arity
+; RUN: llvm-nm %t2 | FileCheck %s
+
+; CHECK: T __llvm_jump_instr_table_0_1
+; CHECK: T __llvm_jump_instr_table_1_1
+
+target triple = "x86_64-unknown-linux-gnu"
+
+define i32 @g(i32 %a) unnamed_addr jumptable {
+  ret i32 %a
+}
+
+define i32 @f() unnamed_addr jumptable {
+  ret i32 0
+}
+
+define i32 @main() {
+  ret i32 0
+}
+
+ at llvm.used = appending global [2 x i8*]  [i8* bitcast (i32(i32)* @g to i8*),
+                                          i8* bitcast (i32()* @f to i8*)]





More information about the llvm-commits mailing list