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)
commit5d0f7af3dc42d7bc843858317fba3bb91c44d68f
treec525924c6e517a0e74dc7c5329096c68c6a27a2f
parent4db3ad47fc58e3cc2b8227b4e6ea0c126338463e
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.

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