OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |