Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Unified Diff: src/IceCfg.h

Issue 872933002: Subzero: Second attempt at fixing MacOS 10.6 build. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add llvm:: prefix Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCfg.h
diff --git a/src/IceCfg.h b/src/IceCfg.h
index b45a95bec28ee0544d5a817d921c773c3fda595d..472ba799d5d8cf92faa25438a938efd1a56c2965 100644
--- a/src/IceCfg.h
+++ b/src/IceCfg.h
@@ -37,15 +37,15 @@ 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(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(CurrentCfg));
+ return ICE_TLS_GET_FIELD(CurrentCfg)->Allocator.get();
}
GlobalContext *getContext() const { return Ctx; }
@@ -213,7 +213,10 @@ 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);
+
+public:
+ static void TlsInit() { ICE_TLS_INIT_FIELD(CurrentCfg); }
};
} // end of namespace Ice
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698