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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()), |
226 DataLowering(TargetDataLowering::createLowering(this)), | 226 DataLowering(TargetDataLowering::createLowering(this)), |
227 HasSeenCode(false), | 227 HasSeenCode(false), |
228 ProfileBlockInfoVarDecl(VariableDeclaration::create()) { | 228 ProfileBlockInfoVarDecl(VariableDeclaration::create()), |
| 229 RandomizationCookie(0) { |
229 assert(OsDump && "OsDump is not defined for GlobalContext"); | 230 assert(OsDump && "OsDump is not defined for GlobalContext"); |
230 assert(OsEmit && "OsEmit is not defined for GlobalContext"); | 231 assert(OsEmit && "OsEmit is not defined for GlobalContext"); |
231 assert(OsError && "OsError is not defined for GlobalContext"); | 232 assert(OsError && "OsError is not defined for GlobalContext"); |
232 // Make sure thread_local fields are properly initialized before any | 233 // Make sure thread_local fields are properly initialized before any |
233 // accesses are made. Do this here instead of at the start of | 234 // accesses are made. Do this here instead of at the start of |
234 // main() so that all clients (e.g. unit tests) can benefit for | 235 // main() so that all clients (e.g. unit tests) can benefit for |
235 // free. | 236 // free. |
236 GlobalContext::TlsInit(); | 237 GlobalContext::TlsInit(); |
237 Cfg::TlsInit(); | 238 Cfg::TlsInit(); |
238 // Create a new ThreadContext for the current thread. No need to | 239 // Create a new ThreadContext for the current thread. No need to |
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 case IceType_NUM: | 747 case IceType_NUM: |
747 break; | 748 break; |
748 } | 749 } |
749 llvm_unreachable("Unknown type"); | 750 llvm_unreachable("Unknown type"); |
750 } | 751 } |
751 | 752 |
752 ConstantList GlobalContext::getConstantPool(Type Ty) { | 753 ConstantList GlobalContext::getConstantPool(Type Ty) { |
753 switch (Ty) { | 754 switch (Ty) { |
754 case IceType_i1: | 755 case IceType_i1: |
755 case IceType_i8: | 756 case IceType_i8: |
| 757 return getConstPool()->Integers8.getConstantPool(); |
756 case IceType_i16: | 758 case IceType_i16: |
| 759 return getConstPool()->Integers16.getConstantPool(); |
757 case IceType_i32: | 760 case IceType_i32: |
758 return getConstPool()->Integers32.getConstantPool(); | 761 return getConstPool()->Integers32.getConstantPool(); |
759 case IceType_i64: | 762 case IceType_i64: |
760 return getConstPool()->Integers64.getConstantPool(); | 763 return getConstPool()->Integers64.getConstantPool(); |
761 case IceType_f32: | 764 case IceType_f32: |
762 return getConstPool()->Floats.getConstantPool(); | 765 return getConstPool()->Floats.getConstantPool(); |
763 case IceType_f64: | 766 case IceType_f64: |
764 return getConstPool()->Doubles.getConstantPool(); | 767 return getConstPool()->Doubles.getConstantPool(); |
765 case IceType_v4i1: | 768 case IceType_v4i1: |
766 case IceType_v8i1: | 769 case IceType_v8i1: |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
892 Ctx = Func->getContext(); | 895 Ctx = Func->getContext(); |
893 Active = | 896 Active = |
894 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); | 897 Func->getFocusedTiming() || Ctx->getFlags().getSubzeroTimingEnabled(); |
895 if (Active) | 898 if (Active) |
896 Ctx->pushTimer(ID, StackID); | 899 Ctx->pushTimer(ID, StackID); |
897 } | 900 } |
898 | 901 |
899 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); | 902 ICE_TLS_DEFINE_FIELD(GlobalContext::ThreadContext *, GlobalContext, TLS); |
900 | 903 |
901 } // end of namespace Ice | 904 } // end of namespace Ice |
OLD | NEW |