Index: src/IceGlobalContext.cpp |
diff --git a/src/IceGlobalContext.cpp b/src/IceGlobalContext.cpp |
index ca7097a01cd09edcda305454e6a850c0cfbd8015..18b9180eb2f5e6bc30f606e0bc95d608bfc48c14 100644 |
--- a/src/IceGlobalContext.cpp |
+++ b/src/IceGlobalContext.cpp |
@@ -105,6 +105,8 @@ public: |
TypePool<IceType_i32, int32_t, ConstantInteger32> Integers32; |
TypePool<IceType_i64, int64_t, ConstantInteger64> Integers64; |
TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> Relocatables; |
+ TypePool<IceType_i32, RelocatableTuple, ConstantRelocatable> |
+ ExternRelocatables; |
UndefPool Undefs; |
}; |
@@ -422,6 +424,13 @@ Constant *GlobalContext::getConstantSym(RelocOffsetT Offset, |
this, RelocatableTuple(Offset, Name, SuppressMangling)); |
} |
+Constant *GlobalContext::getConstantExternSym(const IceString &Name) { |
+ const RelocOffsetT Offset = 0; |
+ const bool SuppressMangling = true; |
+ return getConstPool()->ExternRelocatables.getOrAdd( |
+ this, RelocatableTuple(Offset, Name, SuppressMangling)); |
+} |
+ |
Constant *GlobalContext::getConstantUndef(Type Ty) { |
return getConstPool()->Undefs.getOrAdd(this, Ty); |
} |
@@ -494,6 +503,10 @@ ConstantList GlobalContext::getConstantPool(Type Ty) { |
llvm_unreachable("Unknown type"); |
} |
+ConstantList GlobalContext::getConstantExternSyms() { |
+ return getConstPool()->ExternRelocatables.getConstantPool(); |
+} |
+ |
TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) { |
if (!ALLOW_DUMP) |
return 0; |