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

Side by Side Diff: src/PNaClTranslator.cpp

Issue 589003002: Subzero: Refactor tracking of Defs and block-local Variables. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: "Mark args as being used in the entry node" was unnecessary. Created 6 years, 3 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/IceTargetLoweringX8632.cpp ('k') | tests_lit/llvm2ice_tests/align-spill-locations.ll » ('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/PNaClTranslator.cpp - ICE from bitcode -----------------===// 1 //===- subzero/src/PNaClTranslator.cpp - ICE from bitcode -----------------===//
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 implements the PNaCl bitcode file to Ice, to machine code 10 // This file implements the PNaCl bitcode file to Ice, to machine code
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 return getBasicBlock(Index); 939 return getBasicBlock(Index);
940 } 940 }
941 941
942 // Generate an instruction variable with type Ty. 942 // Generate an instruction variable with type Ty.
943 Ice::Variable *createInstVar(Ice::Type Ty) { 943 Ice::Variable *createInstVar(Ice::Type Ty) {
944 if (Ty == Ice::IceType_void) { 944 if (Ty == Ice::IceType_void) {
945 Error("Can't define instruction value using type void"); 945 Error("Can't define instruction value using type void");
946 // Recover since we can't throw an exception. 946 // Recover since we can't throw an exception.
947 Ty = Ice::IceType_i32; 947 Ty = Ice::IceType_i32;
948 } 948 }
949 return Func->makeVariable(Ty, CurrentNode); 949 return Func->makeVariable(Ty);
950 } 950 }
951 951
952 // Generates the next available local variable using the given type. 952 // Generates the next available local variable using the given type.
953 Ice::Variable *getNextInstVar(Ice::Type Ty) { 953 Ice::Variable *getNextInstVar(Ice::Type Ty) {
954 assert(NextLocalInstIndex >= CachedNumGlobalValueIDs); 954 assert(NextLocalInstIndex >= CachedNumGlobalValueIDs);
955 // Before creating one, see if a forwardtyperef has already defined it. 955 // Before creating one, see if a forwardtyperef has already defined it.
956 uint32_t LocalIndex = NextLocalInstIndex - CachedNumGlobalValueIDs; 956 uint32_t LocalIndex = NextLocalInstIndex - CachedNumGlobalValueIDs;
957 if (LocalIndex < LocalOperands.size()) { 957 if (LocalIndex < LocalOperands.size()) {
958 Ice::Operand *Op = LocalOperands[LocalIndex]; 958 Ice::Operand *Op = LocalOperands[LocalIndex];
959 if (Op != NULL) { 959 if (Op != NULL) {
(...skipping 1452 matching lines...) Expand 10 before | Expand all | Expand 10 after
2412 2412
2413 if (TopLevelBlocks != 1) { 2413 if (TopLevelBlocks != 1) {
2414 errs() << IRFilename 2414 errs() << IRFilename
2415 << ": Contains more than one module. Found: " << TopLevelBlocks 2415 << ": Contains more than one module. Found: " << TopLevelBlocks
2416 << "\n"; 2416 << "\n";
2417 ErrorStatus = true; 2417 ErrorStatus = true;
2418 } 2418 }
2419 } 2419 }
2420 2420
2421 } // end of namespace Ice 2421 } // end of namespace Ice
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | tests_lit/llvm2ice_tests/align-spill-locations.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698