OSDN Git Service

Reapply: IR: add optional type to 'byval' function parameters
authorTim Northover <tnorthover@apple.com>
Thu, 30 May 2019 18:48:23 +0000 (18:48 +0000)
committerTim Northover <tnorthover@apple.com>
Thu, 30 May 2019 18:48:23 +0000 (18:48 +0000)
commita8aa168ce3cd12d3426599df1137bfcccbd09096
tree31ddf255d3b028f35e31dff87472db2b02369362
parentae0814d7693f10bf0418908b12edd51770647894
Reapply: IR: add optional type to 'byval' function parameters

When we switch to opaque pointer types we will need some way to describe
how many bytes a 'byval' parameter should occupy on the stack. This adds
a (for now) optional extra type parameter.

If present, the type must match the pointee type of the argument.

The original commit did not remap byval types when linking modules, which broke
LTO. This version fixes that.

Note to front-end maintainers: if this causes test failures, it's probably
because the "byval" attribute is printed after attributes without any parameter
after this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@362128 91177308-0d34-0410-b5e6-96231b3b80d8
45 files changed:
docs/LangRef.rst
docs/ReleaseNotes.rst
include/llvm/CodeGen/TargetLowering.h
include/llvm/IR/Argument.h
include/llvm/IR/Attributes.h
include/llvm/IR/CallSite.h
include/llvm/IR/Function.h
include/llvm/IR/InstrTypes.h
lib/AsmParser/LLParser.cpp
lib/AsmParser/LLParser.h
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Writer/BitcodeWriter.cpp
lib/Bitcode/Writer/ValueEnumerator.cpp
lib/CodeGen/GlobalISel/CallLowering.cpp
lib/CodeGen/SelectionDAG/FastISel.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/CodeGen/SelectionDAG/TargetLowering.cpp
lib/IR/AttributeImpl.h
lib/IR/Attributes.cpp
lib/IR/Function.cpp
lib/IR/Verifier.cpp
lib/Linker/IRMover.cpp
lib/Transforms/Utils/ValueMapper.cpp
test/Assembler/byval-type-attr.ll [new file with mode: 0644]
test/Assembler/invalid-byval-type1.ll [new file with mode: 0644]
test/Assembler/invalid-byval-type2.ll [new file with mode: 0644]
test/Assembler/invalid-byval-type3.ll [new file with mode: 0644]
test/Bitcode/Inputs/byval-upgrade.bc [new file with mode: 0644]
test/Bitcode/attributes-3.3.ll
test/Bitcode/attributes.ll
test/Bitcode/byval-upgrade.test [new file with mode: 0644]
test/Bitcode/compatibility-3.6.ll
test/Bitcode/compatibility-3.7.ll
test/Bitcode/compatibility-3.8.ll
test/Bitcode/compatibility-3.9.ll
test/Bitcode/compatibility-4.0.ll
test/Bitcode/compatibility-5.0.ll
test/Bitcode/compatibility-6.0.ll
test/Bitcode/compatibility.ll
test/Bitcode/highLevelStructure.3.2.ll
test/CodeGen/AArch64/byval-type.ll [new file with mode: 0644]
test/Linker/Inputs/byval-types-1.ll [new file with mode: 0644]
test/Linker/byval-types.ll [new file with mode: 0644]
test/Transforms/Inline/byval-tail-call.ll
unittests/IR/AttributesTest.cpp