[llvm-commits] [llvm-gcc-4.0] r41772 - in /llvm-gcc-4.0/trunk/gcc: llvm-backend.cpp llvm-internal.h

Devang Patel dpatel at apple.com
Fri Sep 7 13:58:18 PDT 2007


Author: dpatel
Date: Fri Sep  7 15:58:18 2007
New Revision: 41772

URL: http://llvm.org/viewvc/llvm-project?rev=41772&view=rev
Log:
Use SmallSetVector instead SmallPtrSet to ensure determinstic order.

Modified:
    llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
    llvm-gcc-4.0/trunk/gcc/llvm-internal.h

Modified: llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp?rev=41772&r1=41771&r2=41772&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-backend.cpp Fri Sep  7 15:58:18 2007
@@ -84,7 +84,7 @@
 static cl::opt<bool> DisableLLVMOptimizations("disable-llvm-optzns");
 
 std::vector<std::pair<Function*, int> > StaticCtors, StaticDtors;
-SmallPtrSet<Constant*, 32> AttributeUsedGlobals;
+SmallSetVector<Constant*, 32> AttributeUsedGlobals;
 std::vector<Constant*> AttributeNoinlineFunctions;
 std::vector<Constant*> AttributeAnnotateGlobals;
 
@@ -482,7 +482,7 @@
   if (!AttributeUsedGlobals.empty()) {
     std::vector<Constant *> AUGs;
     const Type *SBP= PointerType::get(Type::Int8Ty);
-    for (SmallPtrSet<Constant *,32>::iterator AI = AttributeUsedGlobals.begin(),
+    for (SmallSetVector<Constant *,32>::iterator AI = AttributeUsedGlobals.begin(),
            AE = AttributeUsedGlobals.end(); AI != AE; ++AI) {
       Constant *C = *AI;
       AUGs.push_back(ConstantExpr::getBitCast(C, SBP));
@@ -804,7 +804,7 @@
                                              GV->getName(), TheModule);
     GV->replaceAllUsesWith(ConstantExpr::getBitCast(NGV, GV->getType()));
     if (AttributeUsedGlobals.count(GV)) {
-      AttributeUsedGlobals.erase(GV);
+      AttributeUsedGlobals.remove(GV);
       AttributeUsedGlobals.insert(NGV);
     }
     delete GV;

Modified: llvm-gcc-4.0/trunk/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/llvm-internal.h?rev=41772&r1=41771&r2=41772&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.0/trunk/gcc/llvm-internal.h Fri Sep  7 15:58:18 2007
@@ -34,7 +34,7 @@
 #include <string>
 #include "llvm/Intrinsics.h"
 #include "llvm/ADT/SmallVector.h"
-#include "llvm/ADT/SmallPtrSet.h"
+#include "llvm/ADT/SetVector.h"
 #include "llvm/Support/DataTypes.h"
 #include "llvm/Support/LLVMBuilder.h"
 #include "llvm/Support/Streams.h"
@@ -87,7 +87,7 @@
 extern std::vector<std::pair<Function*, int> > StaticCtors, StaticDtors;
 
 /// AttributeUsedGlobals - The list of globals that are marked attribute(used).
-extern SmallPtrSet<Constant *,32> AttributeUsedGlobals;
+extern SmallSetVector<Constant *,32> AttributeUsedGlobals;
 
 /// AttributeNoinlineFunctions - The list of functions that are 
 /// marked attribute(noinline)





More information about the llvm-commits mailing list