Use SmallSetVector insetad of SmallPtrSet to ensure determinstic order.
llvm-svn: 41773
diff --git a/llvm-gcc-4.2/gcc/llvm-backend.cpp b/llvm-gcc-4.2/gcc/llvm-backend.cpp
index a052a48..0fa26ac 100644
--- a/llvm-gcc-4.2/gcc/llvm-backend.cpp
+++ b/llvm-gcc-4.2/gcc/llvm-backend.cpp
@@ -85,7 +85,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;
@@ -483,7 +483,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));
@@ -815,7 +815,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.2/gcc/llvm-internal.h b/llvm-gcc-4.2/gcc/llvm-internal.h
index f6946de..9dba0bf 100644
--- a/llvm-gcc-4.2/gcc/llvm-internal.h
+++ b/llvm-gcc-4.2/gcc/llvm-internal.h
@@ -35,7 +35,7 @@
#include "llvm/Intrinsics.h"
#include "llvm/ADT/IndexedMap.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"
@@ -92,7 +92,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)