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

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: Reformat to 80-columns 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') | src/IceDefs.h » ('J')
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..a8509817e2baccf0c84ad325d6669bda4a98145d 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(CurrentCfg, const Cfg *);
+ }
// 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, const Cfg *));
+ return ICE_TLS_GET_FIELD(CurrentCfg, const Cfg *)->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(CurrentCfg, const Cfg *);
};
} // end of namespace Ice
« no previous file with comments | « no previous file | src/IceCfg.cpp » ('j') | src/IceDefs.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698