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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 /// Returns the global declaration (variable or function) with the | 346 /// Returns the global declaration (variable or function) with the |
347 /// given Index. | 347 /// given Index. |
348 Ice::GlobalDeclaration *getGlobalDeclarationByID(size_t Index) { | 348 Ice::GlobalDeclaration *getGlobalDeclarationByID(size_t Index) { |
349 if (Index < NumFunctionIds) | 349 if (Index < NumFunctionIds) |
350 return getFunctionByID(Index); | 350 return getFunctionByID(Index); |
351 else | 351 else |
352 return getGlobalVariableByID(Index - NumFunctionIds); | 352 return getGlobalVariableByID(Index - NumFunctionIds); |
353 } | 353 } |
354 | 354 |
355 /// Returns the list of parsed global variable declarations. | 355 /// Returns the list of parsed global variable declarations. |
356 const Ice::Translator::VariableDeclarationListType &getGlobalVariables() { | 356 const Ice::VariableDeclarationList &getGlobalVariables() { |
357 return VariableDeclarations; | 357 return VariableDeclarations; |
358 } | 358 } |
359 | 359 |
360 private: | 360 private: |
361 // The translator associated with the parser. | 361 // The translator associated with the parser. |
362 Ice::Translator &Translator; | 362 Ice::Translator &Translator; |
363 // The bitcode header. | 363 // The bitcode header. |
364 NaClBitcodeHeader &Header; | 364 NaClBitcodeHeader &Header; |
365 // The exit status that should be set to true if an error occurs. | 365 // The exit status that should be set to true if an error occurs. |
366 Ice::ErrorCode &ErrorStatus; | 366 Ice::ErrorCode &ErrorStatus; |
367 // The number of errors reported. | 367 // The number of errors reported. |
368 unsigned NumErrors; | 368 unsigned NumErrors; |
369 // The types associated with each type ID. | 369 // The types associated with each type ID. |
370 std::vector<ExtendedType> TypeIDValues; | 370 std::vector<ExtendedType> TypeIDValues; |
371 // The set of functions. | 371 // The set of functions. |
372 FunctionDeclarationListType FunctionDeclarationList; | 372 FunctionDeclarationListType FunctionDeclarationList; |
373 // The set of global variables. | 373 // The set of global variables. |
374 Ice::Translator::VariableDeclarationListType VariableDeclarations; | 374 Ice::VariableDeclarationList VariableDeclarations; |
375 // Relocatable constants associated with global declarations. | 375 // Relocatable constants associated with global declarations. |
376 std::vector<Ice::Constant *> ValueIDConstants; | 376 std::vector<Ice::Constant *> ValueIDConstants; |
377 // The number of function declarations (i.e. IDs). | 377 // The number of function declarations (i.e. IDs). |
378 unsigned NumFunctionIds; | 378 unsigned NumFunctionIds; |
379 // The number of function blocks (processed so far). | 379 // The number of function blocks (processed so far). |
380 unsigned NumFunctionBlocks; | 380 unsigned NumFunctionBlocks; |
381 // The list of function declaration IDs (in the order found) that | 381 // The list of function declaration IDs (in the order found) that |
382 // aren't just proto declarations. | 382 // aren't just proto declarations. |
383 // TODO(kschimpf): Instead of using this list, just use | 383 // TODO(kschimpf): Instead of using this list, just use |
384 // FunctionDeclarationList, and the isProto member function. | 384 // FunctionDeclarationList, and the isProto member function. |
(...skipping 2593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2978 | 2978 |
2979 if (TopLevelBlocks != 1) { | 2979 if (TopLevelBlocks != 1) { |
2980 errs() << IRFilename | 2980 errs() << IRFilename |
2981 << ": Contains more than one module. Found: " << TopLevelBlocks | 2981 << ": Contains more than one module. Found: " << TopLevelBlocks |
2982 << "\n"; | 2982 << "\n"; |
2983 ErrorStatus.assign(EC_Bitcode); | 2983 ErrorStatus.assign(EC_Bitcode); |
2984 } | 2984 } |
2985 } | 2985 } |
2986 | 2986 |
2987 } // end of namespace Ice | 2987 } // end of namespace Ice |
OLD | NEW |