Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs ---*- C++ -*-===// | 1 //===- subzero/src/IceGlobalContext.cpp - Global context defs ---*- C++ -*-===// |
| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 225 case IceType_i1: | 225 case IceType_i1: |
| 226 case IceType_i8: | 226 case IceType_i8: |
| 227 case IceType_i16: | 227 case IceType_i16: |
| 228 case IceType_i32: | 228 case IceType_i32: |
| 229 case IceType_i64: | 229 case IceType_i64: |
| 230 return getConstantInt(Ty, 0); | 230 return getConstantInt(Ty, 0); |
| 231 case IceType_f32: | 231 case IceType_f32: |
| 232 return getConstantFloat(0); | 232 return getConstantFloat(0); |
| 233 case IceType_f64: | 233 case IceType_f64: |
| 234 return getConstantDouble(0); | 234 return getConstantDouble(0); |
| 235 case IceType_v4i1: | |
| 236 case IceType_v8i1: | |
| 237 case IceType_v16i1: | |
| 238 case IceType_v16i8: | |
| 239 case IceType_v8i16: | |
| 240 case IceType_v4i32: | |
| 241 case IceType_v4f32: | |
| 242 llvm_unreachable("Unsupported type"); | |
|
Jim Stichnoth
2014/07/07 17:47:23
Add the type name to the error message (here and b
wala
2014/07/07 21:33:41
Done.
| |
| 235 case IceType_void: | 243 case IceType_void: |
| 236 case IceType_NUM: | 244 case IceType_NUM: |
| 237 break; | 245 break; |
| 238 } | 246 } |
| 239 llvm_unreachable("Unknown type"); | 247 llvm_unreachable("Unknown type"); |
| 240 } | 248 } |
| 241 | 249 |
| 242 ConstantList GlobalContext::getConstantPool(Type Ty) const { | 250 ConstantList GlobalContext::getConstantPool(Type Ty) const { |
| 243 switch (Ty) { | 251 switch (Ty) { |
| 244 case IceType_i1: | 252 case IceType_i1: |
| 245 case IceType_i8: | 253 case IceType_i8: |
| 246 case IceType_i16: | 254 case IceType_i16: |
| 247 case IceType_i32: | 255 case IceType_i32: |
| 248 case IceType_i64: | 256 case IceType_i64: |
| 249 return ConstPool->Integers.getConstantPool(); | 257 return ConstPool->Integers.getConstantPool(); |
| 250 case IceType_f32: | 258 case IceType_f32: |
| 251 return ConstPool->Floats.getConstantPool(); | 259 return ConstPool->Floats.getConstantPool(); |
| 252 case IceType_f64: | 260 case IceType_f64: |
| 253 return ConstPool->Doubles.getConstantPool(); | 261 return ConstPool->Doubles.getConstantPool(); |
| 262 case IceType_v4i1: | |
| 263 case IceType_v8i1: | |
| 264 case IceType_v16i1: | |
| 265 case IceType_v16i8: | |
| 266 case IceType_v8i16: | |
| 267 case IceType_v4i32: | |
| 268 case IceType_v4f32: | |
| 269 llvm_unreachable("Unsupported type"); | |
| 254 case IceType_void: | 270 case IceType_void: |
| 255 case IceType_NUM: | 271 case IceType_NUM: |
| 256 break; | 272 break; |
| 257 } | 273 } |
| 258 llvm_unreachable("Unknown type"); | 274 llvm_unreachable("Unknown type"); |
| 259 } | 275 } |
| 260 | 276 |
| 261 void Timer::printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const { | 277 void Timer::printElapsedUs(GlobalContext *Ctx, const IceString &Tag) const { |
| 262 if (Ctx->isVerbose(IceV_Timing)) { | 278 if (Ctx->isVerbose(IceV_Timing)) { |
| 263 // Prefixing with '#' allows timing strings to be included | 279 // Prefixing with '#' allows timing strings to be included |
| 264 // without error in textual assembly output. | 280 // without error in textual assembly output. |
| 265 Ctx->getStrDump() << "# " << getElapsedUs() << " usec " << Tag << "\n"; | 281 Ctx->getStrDump() << "# " << getElapsedUs() << " usec " << Tag << "\n"; |
| 266 } | 282 } |
| 267 } | 283 } |
| 268 | 284 |
| 269 } // end of namespace Ice | 285 } // end of namespace Ice |
| OLD | NEW |