For PR1146:
Adapt handling of parameter attributes to use the new ParamAttrsList class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35814 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/MSIL/MSILWriter.cpp b/lib/Target/MSIL/MSILWriter.cpp
index bab2904..3aa05e4 100644
--- a/lib/Target/MSIL/MSILWriter.cpp
+++ b/lib/Target/MSIL/MSILWriter.cpp
@@ -16,6 +16,7 @@
#include "llvm/DerivedTypes.h"
#include "llvm/Intrinsics.h"
#include "llvm/IntrinsicInst.h"
+#include "llvm/ParameterAttributes.h"
#include "llvm/TypeSymbolTable.h"
#include "llvm/Analysis/ConstantsScanner.h"
#include "llvm/Support/CallSite.h"
@@ -1131,7 +1132,8 @@
void MSILWriter::printFunction(const Function& F) {
const FunctionType* FTy = F.getFunctionType();
- bool isSigned = FTy->paramHasAttr(0,FunctionType::SExtAttribute);
+ const ParamAttrsList *Attrs = FTy->getParamAttrs();
+ bool isSigned = Attrs && Attrs->paramHasAttr(0, SExtAttribute);
Out << "\n.method static ";
Out << (F.hasInternalLinkage() ? "private " : "public ");
if (F.isVarArg()) Out << "vararg ";
@@ -1142,7 +1144,7 @@
unsigned ArgIdx = 1;
for (Function::const_arg_iterator I = F.arg_begin(), E = F.arg_end(); I!=E;
++I, ++ArgIdx) {
- isSigned = FTy->paramHasAttr(ArgIdx,FunctionType::SExtAttribute);
+ isSigned = Attrs && Attrs->paramHasAttr(ArgIdx, SExtAttribute);
if (I!=F.arg_begin()) Out << ", ";
Out << getTypeName(I->getType(),isSigned) << getValueName(I);
}