[llvm-commits] CVS: llvm/lib/Transforms/IPO/FunctionResolution.cpp MutateStructTypes.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun Feb 8 22:20:46 PST 2004


Changes in directory llvm/lib/Transforms/IPO:

FunctionResolution.cpp updated: 1.45 -> 1.46
MutateStructTypes.cpp updated: 1.44 -> 1.45

---
Log message:

Start using the new and improve interface to FunctionType arguments



---
Diffs of the changes:  (+9 -9)

Index: llvm/lib/Transforms/IPO/FunctionResolution.cpp
diff -u llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.45 llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.46
--- llvm/lib/Transforms/IPO/FunctionResolution.cpp:1.45	Thu Nov 20 15:21:31 2003
+++ llvm/lib/Transforms/IPO/FunctionResolution.cpp	Sun Feb  8 22:14:01 2004
@@ -58,7 +58,7 @@
       const FunctionType *OldMT = Old->getFunctionType();
       const FunctionType *ConcreteMT = Concrete->getFunctionType();
       
-      if (OldMT->getParamTypes().size() > ConcreteMT->getParamTypes().size() &&
+      if (OldMT->getNumParams() > ConcreteMT->getNumParams() &&
           !ConcreteMT->isVarArg())
         if (!Old->use_empty()) {
           std::cerr << "WARNING: Linking function '" << Old->getName()
@@ -73,14 +73,14 @@
       // Check to make sure that if there are specified types, that they
       // match...
       //
-      unsigned NumArguments = std::min(OldMT->getParamTypes().size(),
-                                       ConcreteMT->getParamTypes().size());
+      unsigned NumArguments = std::min(OldMT->getNumParams(),
+                                       ConcreteMT->getNumParams());
 
       if (!Old->use_empty() && !Concrete->use_empty())
         for (unsigned i = 0; i < NumArguments; ++i)
-          if (OldMT->getParamTypes()[i] != ConcreteMT->getParamTypes()[i])
-            if (OldMT->getParamTypes()[i]->getPrimitiveID() != 
-                ConcreteMT->getParamTypes()[i]->getPrimitiveID()) {
+          if (OldMT->getParamType(i) != ConcreteMT->getParamType(i))
+            if (OldMT->getParamType(i)->getPrimitiveID() != 
+                ConcreteMT->getParamType(i)->getPrimitiveID()) {
               std::cerr << "WARNING: Function [" << Old->getName()
                         << "]: Parameter types conflict for: '";
               WriteTypeSymbolic(std::cerr, OldMT, &M);
@@ -231,7 +231,7 @@
           if ((ConcreteF->getReturnType() == OtherF->getReturnType() ||
                CallersAllIgnoreReturnValue(*OtherF)) &&
               OtherF->getFunctionType()->isVarArg() &&
-              OtherF->getFunctionType()->getParamTypes().empty())
+              OtherF->getFunctionType()->getNumParams() == 0)
             DontPrintWarning = true;
       
       // Otherwise, if the non-concrete global is a global array variable with a


Index: llvm/lib/Transforms/IPO/MutateStructTypes.cpp
diff -u llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.44 llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.45
--- llvm/lib/Transforms/IPO/MutateStructTypes.cpp:1.44	Fri Jan  9 00:02:51 2004
+++ llvm/lib/Transforms/IPO/MutateStructTypes.cpp	Sun Feb  8 22:14:01 2004
@@ -60,8 +60,8 @@
     const Type *RetTy = ConvertType(FT->getReturnType());
     std::vector<const Type*> ArgTypes;
 
-    for (FunctionType::ParamTypes::const_iterator I = FT->getParamTypes().begin(),
-           E = FT->getParamTypes().end(); I != E; ++I)
+    for (FunctionType::param_iterator I = FT->param_begin(),
+           E = FT->param_end(); I != E; ++I)
       ArgTypes.push_back(ConvertType(*I));
     
     DestTy = FunctionType::get(RetTy, ArgTypes, FT->isVarArg());





More information about the llvm-commits mailing list