Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// | 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs -------------===// |
| 2 // | 2 // |
| 3 // The Subzero Code Generator | 3 // The Subzero Code Generator |
| 4 // | 4 // |
| 5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
| 6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
| 7 // | 7 // |
| 8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
| 9 /// | 9 /// |
| 10 /// \file | 10 /// \file |
| 11 /// \brief Defines aspects of the compilation that persist across multiple | 11 /// \brief Defines aspects of the compilation that persist across multiple |
| 12 /// functions. | 12 /// functions. |
| 13 /// | 13 /// |
| 14 //===----------------------------------------------------------------------===// | 14 //===----------------------------------------------------------------------===// |
| 15 | 15 |
| 16 #include "IceGlobalContext.h" | 16 #include "IceGlobalContext.h" |
| 17 | 17 |
| 18 #include "IceCfg.h" | 18 #include "IceCfg.h" |
| 19 #include "IceCfgNode.h" | 19 #include "IceCfgNode.h" |
| 20 #include "IceClFlags.h" | 20 #include "IceClFlags.h" |
| 21 #include "IceDefs.h" | 21 #include "IceDefs.h" |
| 22 #include "IceELFObjectWriter.h" | 22 #include "IceELFObjectWriter.h" |
| 23 #include "IceGlobalInits.h" | 23 #include "IceGlobalInits.h" |
| 24 #include "IceOperand.h" | 24 #include "IceOperand.h" |
| 25 #include "IceLiveness.h" | |
|
Jim Stichnoth
2016/03/31 16:23:20
Alphabetize?
John
2016/04/01 13:52:04
I guess jpp::less<Alphabet> had a bug? :P
Done.
| |
| 25 #include "IceTargetLowering.h" | 26 #include "IceTargetLowering.h" |
| 26 #include "IceTimerTree.h" | 27 #include "IceTimerTree.h" |
| 27 #include "IceTypes.def" | 28 #include "IceTypes.def" |
| 28 #include "IceTypes.h" | 29 #include "IceTypes.h" |
| 29 | 30 |
| 30 #ifdef __clang__ | 31 #ifdef __clang__ |
| 31 #pragma clang diagnostic push | 32 #pragma clang diagnostic push |
| 32 #pragma clang diagnostic ignored "-Wunused-parameter" | 33 #pragma clang diagnostic ignored "-Wunused-parameter" |
| 33 #endif // __clang__ | 34 #endif // __clang__ |
| 34 | 35 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 258 DataLowering(TargetDataLowering::createLowering(this)) { | 259 DataLowering(TargetDataLowering::createLowering(this)) { |
| 259 assert(OsDump && "OsDump is not defined for GlobalContext"); | 260 assert(OsDump && "OsDump is not defined for GlobalContext"); |
| 260 assert(OsEmit && "OsEmit is not defined for GlobalContext"); | 261 assert(OsEmit && "OsEmit is not defined for GlobalContext"); |
| 261 assert(OsError && "OsError is not defined for GlobalContext"); | 262 assert(OsError && "OsError is not defined for GlobalContext"); |
| 262 // Make sure thread_local fields are properly initialized before any | 263 // Make sure thread_local fields are properly initialized before any |
| 263 // accesses are made. Do this here instead of at the start of | 264 // accesses are made. Do this here instead of at the start of |
| 264 // main() so that all clients (e.g. unit tests) can benefit for | 265 // main() so that all clients (e.g. unit tests) can benefit for |
| 265 // free. | 266 // free. |
| 266 GlobalContext::TlsInit(); | 267 GlobalContext::TlsInit(); |
| 267 Cfg::TlsInit(); | 268 Cfg::TlsInit(); |
| 269 Liveness::TlsInit(); | |
| 268 // Create a new ThreadContext for the current thread. No need to | 270 // Create a new ThreadContext for the current thread. No need to |
| 269 // lock AllThreadContexts at this point since no other threads have | 271 // lock AllThreadContexts at this point since no other threads have |
| 270 // access yet to this GlobalContext object. | 272 // access yet to this GlobalContext object. |
| 271 ThreadContext *MyTLS = new ThreadContext(); | 273 ThreadContext *MyTLS = new ThreadContext(); |
| 272 AllThreadContexts.push_back(MyTLS); | 274 AllThreadContexts.push_back(MyTLS); |
| 273 ICE_TLS_SET_FIELD(TLS, MyTLS); | 275 ICE_TLS_SET_FIELD(TLS, MyTLS); |
| 274 // Pre-register built-in stack names. | 276 // Pre-register built-in stack names. |
| 275 if (BuildDefs::timers()) { | 277 if (BuildDefs::timers()) { |
| 276 // TODO(stichnot): There needs to be a strong relationship between | 278 // TODO(stichnot): There needs to be a strong relationship between |
| 277 // the newTimerStackID() return values and TSK_Default/TSK_Funcs. | 279 // the newTimerStackID() return values and TSK_Default/TSK_Funcs. |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 963 Ctx = Func->getContext(); | 965 Ctx = Func->getContext(); |
| 964 Active = | 966 Active = |
| 965 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 967 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 966 if (Active) | 968 if (Active) |
| 967 Ctx->pushTimer(ID, StackID); | 969 Ctx->pushTimer(ID, StackID); |
| 968 } | 970 } |
| 969 | 971 |
| 970 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 972 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 971 | 973 |
| 972 } // end of namespace Ice | 974 } // end of namespace Ice |
| OLD | NEW |