Add a new attribute called 'jumptable' that creates jump-instruction tables for funct...
authorTom Roeder <tmroeder@google.com>
Thu, 5 Jun 2014 19:29:43 +0000 (19:29 +0000)
committerTom Roeder <tmroeder@google.com>
Thu, 5 Jun 2014 19:29:43 +0000 (19:29 +0000)
commit44cb65fff1fa26a2a1ff90290f172756f082c8a1
treebf434728cf43339c7a59346772330571289765b8
parentf7e289c0f25c920368b28d0d9d3be64d882f32cb
Add a new attribute called 'jumptable' that creates jump-instruction tables for functions marked with this attribute.
It includes a pass that rewrites all indirect calls to jumptable functions to pass through these tables.

This also adds backend support for generating the jump-instruction tables on ARM and X86.
Note that since the jumptable attribute creates a second function pointer for a
function, any function marked with jumptable must also be marked with unnamed_addr.

llvm-svn: 210280
40 files changed:
llvm/docs/LangRef.rst
llvm/include/llvm-c/Core.h
llvm/include/llvm/Analysis/JumpInstrTableInfo.h [new file with mode: 0644]
llvm/include/llvm/Analysis/Passes.h
llvm/include/llvm/Bitcode/LLVMBitCodes.h
llvm/include/llvm/CodeGen/CommandFlags.h
llvm/include/llvm/CodeGen/JumpInstrTables.h [new file with mode: 0644]
llvm/include/llvm/CodeGen/Passes.h
llvm/include/llvm/IR/Attributes.h
llvm/include/llvm/InitializePasses.h
llvm/include/llvm/LinkAllPasses.h
llvm/include/llvm/Target/TargetInstrInfo.h
llvm/include/llvm/Target/TargetOptions.h
llvm/lib/Analysis/Analysis.cpp
llvm/lib/Analysis/CMakeLists.txt
llvm/lib/Analysis/JumpInstrTableInfo.cpp [new file with mode: 0644]
llvm/lib/AsmParser/LLLexer.cpp
llvm/lib/AsmParser/LLParser.cpp
llvm/lib/AsmParser/LLToken.h
llvm/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
llvm/lib/CodeGen/CMakeLists.txt
llvm/lib/CodeGen/JumpInstrTables.cpp [new file with mode: 0644]
llvm/lib/CodeGen/LLVMTargetMachine.cpp
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/LTO/LTOCodeGenerator.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
llvm/lib/Target/ARM/ARMBaseInstrInfo.h
llvm/lib/Target/X86/X86InstrInfo.cpp
llvm/lib/Target/X86/X86InstrInfo.h
llvm/lib/Transforms/IPO/IPO.cpp
llvm/test/Bitcode/attributes.ll
llvm/test/CodeGen/ARM/jump_tables.ll [new file with mode: 0644]
llvm/test/CodeGen/Generic/stop-after.ll
llvm/test/CodeGen/X86/jump_table_alias.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/jump_table_bitcast.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/jump_tables.ll [new file with mode: 0644]
llvm/test/Verifier/jumptable.ll [new file with mode: 0644]