Use SmallSetVector instead SmallPtrSet to ensure determinstic order.
llvm-svn: 41772
diff --git a/llvm-gcc-4.0/gcc/llvm-backend.cpp b/llvm-gcc-4.0/gcc/llvm-backend.cpp
index 36b844c..6ee7800 100644
--- a/llvm-gcc-4.0/gcc/llvm-backend.cpp
+++ b/llvm-gcc-4.0/gcc/llvm-backend.cpp
@@ -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;
diff --git a/llvm-gcc-4.0/gcc/llvm-internal.h b/llvm-gcc-4.0/gcc/llvm-internal.h
index fe69083..4a8f55c 100644
--- a/llvm-gcc-4.0/gcc/llvm-internal.h
+++ b/llvm-gcc-4.0/gcc/llvm-internal.h
@@ -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)