OSDN Git Service

[cfi] Emit jump tables as a function-level inline asm.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 22 Dec 2016 22:22:35 +0000 (22:22 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 22 Dec 2016 22:22:35 +0000 (22:22 +0000)
commit9ee744ac24392af82ac7340995e8f94c300d4a14
treec54ffc28fd9db3530ca368bf655cbe612030ad49
parent29c28815d840740d6aeed04eb656362580fe72fd
[cfi] Emit jump tables as a function-level inline asm.

Use a dummy private function with inline asm calls instead of module
level asm blocks for CFI jumptables.

The main advantage is that now jumptable codegen can be affected by
the function attributes (like target_cpu on ARM). Module level asm
gets the default subtarget based on the target triple, which is often
not good enough.

This change also uses asm constraints/arguments to reference
jumptable targets and aliases directly. We no longer do asm name
mangling in an IR pass.

Differential Revision: https://reviews.llvm.org/D28012

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290384 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/LowerTypeTests.cpp
test/Transforms/LowerTypeTests/function-disjoint.ll
test/Transforms/LowerTypeTests/function-ext.ll
test/Transforms/LowerTypeTests/function-weak.ll
test/Transforms/LowerTypeTests/function.ll
test/Transforms/LowerTypeTests/section.ll