Make getParamAlignment use argument numbers
authorReid Kleckner <rnk@google.com>
Fri, 28 Apr 2017 20:34:27 +0000 (20:34 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 28 Apr 2017 20:34:27 +0000 (20:34 +0000)
commit859f8b544a784798614cf9e0f0cdd99397b046fe
tree037ecc7ff173e4f7d6df3e1986aad5c035392b90
parent91d6a4488d49009d2c579394a8a7f7f944016bb5
Make getParamAlignment use argument numbers

The method is called "get *Param* Alignment", and is only used for
return values exactly once, so it should take argument indices, not
attribute indices.

Avoids confusing code like:
  IsSwiftError = CS->paramHasAttr(ArgIdx, Attribute::SwiftError);
  Alignment  = CS->getParamAlignment(ArgIdx + 1);

Add getRetAlignment to handle the one case in Value.cpp that wants the
return value alignment.

This is a potentially breaking change for out-of-tree backends that do
their own call lowering.

llvm-svn: 301682
16 files changed:
llvm/include/llvm/IR/Attributes.h
llvm/include/llvm/IR/CallSite.h
llvm/include/llvm/IR/Function.h
llvm/include/llvm/IR/Instructions.h
llvm/include/llvm/IR/IntrinsicInst.h
llvm/lib/CodeGen/GlobalISel/CallLowering.cpp
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
llvm/lib/IR/Attributes.cpp
llvm/lib/IR/Function.cpp
llvm/lib/IR/Value.cpp
llvm/lib/IR/Verifier.cpp
llvm/lib/Target/NVPTX/NVPTXAsmPrinter.cpp
llvm/lib/Target/NVPTX/NVPTXLowerArgs.cpp
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
llvm/lib/Transforms/Utils/InlineFunction.cpp