mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 00:20:11 +00:00
Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions and function calls. This is an updated and slightly corrected version of Reid Spencer's original patch. The only known problem is that auto-upgrading of bitcode files doesn't seem to work properly (see test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully a bitcode guru (who might that be? :) ) will fix it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -79,6 +79,9 @@ void llvm::CloneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
assert(ValueMap.count(I) && "No mapping from source argument specified!");
|
||||
#endif
|
||||
|
||||
// Clone the parameter attributes
|
||||
NewFunc->setParamAttrs(OldFunc->getParamAttrs());
|
||||
|
||||
// Loop over all of the basic blocks in the function, cloning them as
|
||||
// appropriate. Note that we save BE this way in order to handle cloning of
|
||||
// recursive functions into themselves.
|
||||
@@ -304,7 +307,7 @@ ConstantFoldMappedInstruction(const Instruction *I) {
|
||||
/// effect of this is to copy significantly less code in cases where (for
|
||||
/// example) a function call with constant arguments is inlined, and those
|
||||
/// constant arguments cause a significant amount of code in the callee to be
|
||||
/// dead. Since this doesn't produce an exactly copy of the input, it can't be
|
||||
/// dead. Since this doesn't produce an exact copy of the input, it can't be
|
||||
/// used for things like CloneFunction or CloneModule.
|
||||
void llvm::CloneAndPruneFunctionInto(Function *NewFunc, const Function *OldFunc,
|
||||
DenseMap<const Value*, Value*> &ValueMap,
|
||||
|
||||
Reference in New Issue
Block a user