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

Side by Side Diff: src/PNaClTranslator.cpp

Issue 874353006: Write out global initializers and data rel directly to ELF file. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: misc stuff 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
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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 /// Returns the global declaration (variable or function) with the 345 /// Returns the global declaration (variable or function) with the
346 /// given Index. 346 /// given Index.
347 Ice::GlobalDeclaration *getGlobalDeclarationByID(size_t Index) { 347 Ice::GlobalDeclaration *getGlobalDeclarationByID(size_t Index) {
348 if (Index < NumFunctionIds) 348 if (Index < NumFunctionIds)
349 return getFunctionByID(Index); 349 return getFunctionByID(Index);
350 else 350 else
351 return getGlobalVariableByID(Index - NumFunctionIds); 351 return getGlobalVariableByID(Index - NumFunctionIds);
352 } 352 }
353 353
354 /// Returns the list of parsed global variable declarations. 354 /// Returns the list of parsed global variable declarations.
355 const Ice::Translator::VariableDeclarationListType &getGlobalVariables() { 355 const Ice::VariableDeclarationList &getGlobalVariables() {
356 return VariableDeclarations; 356 return VariableDeclarations;
357 } 357 }
358 358
359 private: 359 private:
360 // The translator associated with the parser. 360 // The translator associated with the parser.
361 Ice::Translator &Translator; 361 Ice::Translator &Translator;
362 // The bitcode header. 362 // The bitcode header.
363 NaClBitcodeHeader &Header; 363 NaClBitcodeHeader &Header;
364 // The exit status that should be set to true if an error occurs. 364 // The exit status that should be set to true if an error occurs.
365 bool &ErrorStatus; 365 bool &ErrorStatus;
366 // The number of errors reported. 366 // The number of errors reported.
367 unsigned NumErrors; 367 unsigned NumErrors;
368 // The types associated with each type ID. 368 // The types associated with each type ID.
369 std::vector<ExtendedType> TypeIDValues; 369 std::vector<ExtendedType> TypeIDValues;
370 // The set of functions. 370 // The set of functions.
371 FunctionDeclarationListType FunctionDeclarationList; 371 FunctionDeclarationListType FunctionDeclarationList;
372 // The set of global variables. 372 // The set of global variables.
373 Ice::Translator::VariableDeclarationListType VariableDeclarations; 373 Ice::VariableDeclarationList VariableDeclarations;
374 // Relocatable constants associated with global declarations. 374 // Relocatable constants associated with global declarations.
375 std::vector<Ice::Constant *> ValueIDConstants; 375 std::vector<Ice::Constant *> ValueIDConstants;
376 // The number of function declarations (i.e. IDs). 376 // The number of function declarations (i.e. IDs).
377 unsigned NumFunctionIds; 377 unsigned NumFunctionIds;
378 // The number of function blocks (processed so far). 378 // The number of function blocks (processed so far).
379 unsigned NumFunctionBlocks; 379 unsigned NumFunctionBlocks;
380 // The list of function declaration IDs (in the order found) that 380 // The list of function declaration IDs (in the order found) that
381 // aren't just proto declarations. 381 // aren't just proto declarations.
382 // TODO(kschimpf): Instead of using this list, just use 382 // TODO(kschimpf): Instead of using this list, just use
383 // FunctionDeclarationList, and the isProto member function. 383 // FunctionDeclarationList, and the isProto member function.
(...skipping 2605 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 2989
2990 if (TopLevelBlocks != 1) { 2990 if (TopLevelBlocks != 1) {
2991 errs() << IRFilename 2991 errs() << IRFilename
2992 << ": Contains more than one module. Found: " << TopLevelBlocks 2992 << ": Contains more than one module. Found: " << TopLevelBlocks
2993 << "\n"; 2993 << "\n";
2994 ErrorStatus = true; 2994 ErrorStatus = true;
2995 } 2995 }
2996 } 2996 }
2997 2997
2998 } // end of namespace Ice 2998 } // end of namespace Ice
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698