| 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 // This file defines aspects of the compilation that persist across | 10 // This file defines aspects of the compilation that persist across |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 } | 215 } |
| 216 | 216 |
| 217 GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError, | 217 GlobalContext::GlobalContext(Ostream *OsDump, Ostream *OsEmit, Ostream *OsError, |
| 218 ELFStreamer *ELFStr, const ClFlags &Flags) | 218 ELFStreamer *ELFStr, const ClFlags &Flags) |
| 219 : ConstPool(new ConstantPool()), ErrorStatus(), StrDump(OsDump), | 219 : ConstPool(new ConstantPool()), ErrorStatus(), StrDump(OsDump), |
| 220 StrEmit(OsEmit), StrError(OsError), Flags(Flags), | 220 StrEmit(OsEmit), StrError(OsError), Flags(Flags), |
| 221 RNG(Flags.getRandomSeed()), ObjectWriter(), | 221 RNG(Flags.getRandomSeed()), ObjectWriter(), |
| 222 OptQ(/*Sequential=*/Flags.isSequential(), | 222 OptQ(/*Sequential=*/Flags.isSequential(), |
| 223 /*MaxSize=*/Flags.getNumTranslationThreads()), | 223 /*MaxSize=*/Flags.getNumTranslationThreads()), |
| 224 // EmitQ is allowed unlimited size. | 224 // EmitQ is allowed unlimited size. |
| 225 EmitQ(/*Sequential=*/Flags.isSequential()) { | 225 EmitQ(/*Sequential=*/Flags.isSequential()), RandomizationCookie(0) { |
| 226 assert(OsDump && "OsDump is not defined for GlobalContext"); | 226 assert(OsDump && "OsDump is not defined for GlobalContext"); |
| 227 assert(OsEmit && "OsEmit is not defined for GlobalContext"); | 227 assert(OsEmit && "OsEmit is not defined for GlobalContext"); |
| 228 assert(OsError && "OsError is not defined for GlobalContext"); | 228 assert(OsError && "OsError is not defined for GlobalContext"); |
| 229 // Make sure thread_local fields are properly initialized before any | 229 // Make sure thread_local fields are properly initialized before any |
| 230 // accesses are made. Do this here instead of at the start of | 230 // accesses are made. Do this here instead of at the start of |
| 231 // main() so that all clients (e.g. unit tests) can benefit for | 231 // main() so that all clients (e.g. unit tests) can benefit for |
| 232 // free. | 232 // free. |
| 233 GlobalContext::TlsInit(); | 233 GlobalContext::TlsInit(); |
| 234 Cfg::TlsInit(); | 234 Cfg::TlsInit(); |
| 235 // Create a new ThreadContext for the current thread. No need to | 235 // Create a new ThreadContext for the current thread. No need to |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 case IceType_NUM: | 760 case IceType_NUM: |
| 761 break; | 761 break; |
| 762 } | 762 } |
| 763 llvm_unreachable("Unknown type"); | 763 llvm_unreachable("Unknown type"); |
| 764 } | 764 } |
| 765 | 765 |
| 766 ConstantList GlobalContext::getConstantPool(Type Ty) { | 766 ConstantList GlobalContext::getConstantPool(Type Ty) { |
| 767 switch (Ty) { | 767 switch (Ty) { |
| 768 case IceType_i1: | 768 case IceType_i1: |
| 769 case IceType_i8: | 769 case IceType_i8: |
| 770 return getConstPool()->Integers8.getConstantPool(); |
| 770 case IceType_i16: | 771 case IceType_i16: |
| 772 return getConstPool()->Integers16.getConstantPool(); |
| 771 case IceType_i32: | 773 case IceType_i32: |
| 772 return getConstPool()->Integers32.getConstantPool(); | 774 return getConstPool()->Integers32.getConstantPool(); |
| 773 case IceType_i64: | 775 case IceType_i64: |
| 774 return getConstPool()->Integers64.getConstantPool(); | 776 return getConstPool()->Integers64.getConstantPool(); |
| 775 case IceType_f32: | 777 case IceType_f32: |
| 776 return getConstPool()->Floats.getConstantPool(); | 778 return getConstPool()->Floats.getConstantPool(); |
| 777 case IceType_f64: | 779 case IceType_f64: |
| 778 return getConstPool()->Doubles.getConstantPool(); | 780 return getConstPool()->Doubles.getConstantPool(); |
| 779 case IceType_v4i1: | 781 case IceType_v4i1: |
| 780 case IceType_v8i1: | 782 case IceType_v8i1: |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 Ctx = Func->getContext(); | 908 Ctx = Func->getContext(); |
| 907 Active = | 909 Active = |
| 908 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 910 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
| 909 if (Active) | 911 if (Active) |
| 910 Ctx->pushTimer(ID, StackID); | 912 Ctx->pushTimer(ID, StackID); |
| 911 } | 913 } |
| 912 | 914 |
| 913 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 915 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
| 914 | 916 |
| 915 } // end of namespace Ice | 917 } // end of namespace Ice |
| OLD | NEW |