Index: src/IceCfg.h |
diff --git a/src/IceCfg.h b/src/IceCfg.h |
index b45a95bec28ee0544d5a817d921c773c3fda595d..0502dc0b93a258dafa0a197fd62e1b930ed7d00c 100644 |
--- a/src/IceCfg.h |
+++ b/src/IceCfg.h |
@@ -37,15 +37,17 @@ public: |
// destruction requirements more explicit. |
static Cfg *create(GlobalContext *Ctx) { |
Cfg *Func = new Cfg(Ctx); |
- CurrentCfg = Func; |
+ ICE_TLS_SET_FIELD(CurrentCfg, Func); |
return Func; |
} |
// Gets a pointer to the current thread's Cfg. |
- static const Cfg *getCurrentCfg() { return CurrentCfg; } |
+ static const Cfg *getCurrentCfg() { |
+ return ICE_TLS_GET_FIELD(const Cfg *, CurrentCfg); |
+ } |
// Gets a pointer to the current thread's Cfg's allocator. |
static ArenaAllocator<> *getCurrentCfgAllocator() { |
- assert(CurrentCfg); |
- return CurrentCfg->Allocator.get(); |
+ assert(ICE_TLS_GET_FIELD(const Cfg *, CurrentCfg)); |
+ return ICE_TLS_GET_FIELD(const Cfg *, CurrentCfg)->Allocator.get(); |
} |
GlobalContext *getContext() const { return Ctx; } |
@@ -213,7 +215,7 @@ private: |
// Maintain a pointer in TLS to the current Cfg being translated. |
// This is primarily for accessing its allocator statelessly, but |
// other uses are possible. |
- ICE_ATTRIBUTE_TLS static const Cfg *CurrentCfg; |
+ ICE_TLS_DECLARE_FIELD(const Cfg *, CurrentCfg); |
}; |
} // end of namespace Ice |