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

Side by Side Diff: src/IceGlobalContext.cpp

Issue 814163004: Subzero: Remove the GlobalContext::GlobalDeclarations vector. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove unused GlobalContext args 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 unified diff | Download patch
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 incrementSubstitutions(NewName); 307 incrementSubstitutions(NewName);
308 return NewName.data(); 308 return NewName.data();
309 } 309 }
310 310
311 // Transform bar ==> Prefixbar 311 // Transform bar ==> Prefixbar
312 // ^^^^^^ 312 // ^^^^^^
313 return getTestPrefix() + Name; 313 return getTestPrefix() + Name;
314 } 314 }
315 315
316 GlobalContext::~GlobalContext() { 316 GlobalContext::~GlobalContext() {
317 llvm::DeleteContainerPointers(GlobalDeclarations);
318 llvm::DeleteContainerPointers(AllThreadContexts); 317 llvm::DeleteContainerPointers(AllThreadContexts);
319 } 318 }
320 319
321 // TODO(stichnot): Consider adding thread-local caches of constant 320 // TODO(stichnot): Consider adding thread-local caches of constant
322 // pool entries to reduce contention. 321 // pool entries to reduce contention.
323 322
324 // All locking is done by the getConstantInt[0-9]+() target function. 323 // All locking is done by the getConstantInt[0-9]+() target function.
325 Constant *GlobalContext::getConstantInt(Type Ty, int64_t Value) { 324 Constant *GlobalContext::getConstantInt(Type Ty, int64_t Value) {
326 switch (Ty) { 325 switch (Ty) {
327 case IceType_i1: 326 case IceType_i1:
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 BaseOS << "Unsupported constant type: " << Ty; 440 BaseOS << "Unsupported constant type: " << Ty;
442 llvm_unreachable(BaseOS.str().c_str()); 441 llvm_unreachable(BaseOS.str().c_str());
443 } break; 442 } break;
444 case IceType_void: 443 case IceType_void:
445 case IceType_NUM: 444 case IceType_NUM:
446 break; 445 break;
447 } 446 }
448 llvm_unreachable("Unknown type"); 447 llvm_unreachable("Unknown type");
449 } 448 }
450 449
451 // No locking because only the bitcode parser thread calls it.
452 // TODO(stichnot,kschimpf): GlobalContext::GlobalDeclarations actually
453 // seems to be unused. If so, remove that field and this method.
454 FunctionDeclaration *
455 GlobalContext::newFunctionDeclaration(const FuncSigType *Signature,
456 unsigned CallingConv, unsigned Linkage,
457 bool IsProto) {
458 FunctionDeclaration *Func = new FunctionDeclaration(
459 *Signature, static_cast<llvm::CallingConv::ID>(CallingConv),
460 static_cast<llvm::GlobalValue::LinkageTypes>(Linkage), IsProto);
461 GlobalDeclarations.push_back(Func);
462 return Func;
463 }
464
465 // No locking because only the bitcode parser thread calls it.
466 // TODO(stichnot,kschimpf): GlobalContext::GlobalDeclarations actually
467 // seems to be unused. If so, remove that field and this method.
468 VariableDeclaration *GlobalContext::newVariableDeclaration() {
469 VariableDeclaration *Var = new VariableDeclaration();
470 GlobalDeclarations.push_back(Var);
471 return Var;
472 }
473
474 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) { 450 TimerStackIdT GlobalContext::newTimerStackID(const IceString &Name) {
475 if (!ALLOW_DUMP) 451 if (!ALLOW_DUMP)
476 return 0; 452 return 0;
477 auto Timers = getTimers(); 453 auto Timers = getTimers();
478 TimerStackIdT NewID = Timers->size(); 454 TimerStackIdT NewID = Timers->size();
479 Timers->push_back(TimerStack(Name)); 455 Timers->push_back(TimerStack(Name));
480 return NewID; 456 return NewID;
481 } 457 }
482 458
483 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID, 459 TimerIdT GlobalContext::getTimerID(TimerStackIdT StackID,
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
538 if (ALLOW_DUMP) { 514 if (ALLOW_DUMP) {
539 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled; 515 Active = Func->getFocusedTiming() || Ctx->getFlags().SubzeroTimingEnabled;
540 if (Active) 516 if (Active)
541 Ctx->pushTimer(ID); 517 Ctx->pushTimer(ID);
542 } 518 }
543 } 519 }
544 520
545 thread_local GlobalContext::ThreadContext *GlobalContext::TLS; 521 thread_local GlobalContext::ThreadContext *GlobalContext::TLS;
546 522
547 } // end of namespace Ice 523 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceGlobalContext.h ('k') | src/IceGlobalInits.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698