Fix problem which effected linking apache
authorChris Lattner <sabre@nondot.org>
Tue, 21 Oct 2003 17:39:59 +0000 (17:39 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 21 Oct 2003 17:39:59 +0000 (17:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9335 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bytecode/Writer/SlotCalculator.cpp
lib/VMCore/Constants.cpp
lib/VMCore/SlotCalculator.cpp

index f527b1838f352fef6a10c708abd4836e8f2acf12..7b4a6da179032108402f7d4349cbfa1a41f8cdd1 100644 (file)
@@ -174,8 +174,12 @@ void SlotCalculator::incorporateFunction(const Function *F) {
   SC_DEBUG("Inserting Instructions:\n");
 
   // Add all of the instructions to the type planes...
-  for_each(inst_begin(F), inst_end(F),
-          bind_obj(this, &SlotCalculator::getOrCreateSlot));
+  for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
+    for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
+      getOrCreateSlot(I);
+      //if (const VANextInst *VAN = dyn_cast<VANextInst>(I))
+      //  getOrCreateSlot(VAN->getArgType());
+    }
 
   if (!IgnoreNamedNodes) {
     SC_DEBUG("Inserting SymbolTable values:\n");
index a1ebd9173762e4eac89b4ddc8a1e6ad7ed58f610..b755c6f913a9699dc4203349823e12f81233b716 100644 (file)
@@ -268,7 +268,7 @@ ConstantStruct::ConstantStruct(const StructType *T,
   Operands.reserve(V.size());
   for (unsigned i = 0, e = V.size(); i != e; ++i) {
     assert((V[i]->getType() == ETypes[i] ||
-            (ETypes[i]->isAbstract() &&
+            ((ETypes[i]->isAbstract() || V[i]->getType()->isAbstract()) &&
              ETypes[i]->getPrimitiveID()==V[i]->getType()->getPrimitiveID())) &&
            "Initializer for struct element doesn't match struct element type!");
     Operands.push_back(Use(V[i], this));
index f527b1838f352fef6a10c708abd4836e8f2acf12..7b4a6da179032108402f7d4349cbfa1a41f8cdd1 100644 (file)
@@ -174,8 +174,12 @@ void SlotCalculator::incorporateFunction(const Function *F) {
   SC_DEBUG("Inserting Instructions:\n");
 
   // Add all of the instructions to the type planes...
-  for_each(inst_begin(F), inst_end(F),
-          bind_obj(this, &SlotCalculator::getOrCreateSlot));
+  for (Function::const_iterator BB = F->begin(), E = F->end(); BB != E; ++BB)
+    for (BasicBlock::const_iterator I = BB->begin(), E = BB->end(); I!=E; ++I) {
+      getOrCreateSlot(I);
+      //if (const VANextInst *VAN = dyn_cast<VANextInst>(I))
+      //  getOrCreateSlot(VAN->getArgType());
+    }
 
   if (!IgnoreNamedNodes) {
     SC_DEBUG("Inserting SymbolTable values:\n");