[llvm-commits] CVS: llvm/lib/Target/MSIL/MSILWriter.cpp

Reid Spencer reid at x10sys.com
Sun Apr 8 23:17:41 PDT 2007



Changes in directory llvm/lib/Target/MSIL:

MSILWriter.cpp updated: 1.1 -> 1.2
---
Log message:

For PR1146: http://llvm.org/PR1146 :
Adapt handling of parameter attributes to use the new ParamAttrsList class.


---
Diffs of the changes:  (+4 -2)

 MSILWriter.cpp |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/MSIL/MSILWriter.cpp
diff -u llvm/lib/Target/MSIL/MSILWriter.cpp:1.1 llvm/lib/Target/MSIL/MSILWriter.cpp:1.2
--- llvm/lib/Target/MSIL/MSILWriter.cpp:1.1	Wed Mar 21 16:38:25 2007
+++ llvm/lib/Target/MSIL/MSILWriter.cpp	Mon Apr  9 01:17:21 2007
@@ -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);
   }






More information about the llvm-commits mailing list