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

Side by Side Diff: src/IceTranslator.h

Issue 916653004: Subzero: Emit functions and global initializers in a separate thread. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Const change Created 5 years, 10 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/IceThreading.cpp ('k') | src/IceTranslator.cpp » ('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/IceTranslator.h - ICE to machine code --------*- C++ -*-===// 1 //===- subzero/src/IceTranslator.h - ICE to machine code --------*- C++ -*-===//
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 declares the general driver class for translating ICE to 10 // This file declares the general driver class for translating ICE to
(...skipping 16 matching lines...) Expand all
27 class GlobalContext; 27 class GlobalContext;
28 28
29 // Base class for translating ICE to machine code. Derived classes convert 29 // Base class for translating ICE to machine code. Derived classes convert
30 // other intermediate representations down to ICE, and then call the appropriate 30 // other intermediate representations down to ICE, and then call the appropriate
31 // (inherited) methods to convert ICE into machine instructions. 31 // (inherited) methods to convert ICE into machine instructions.
32 class Translator { 32 class Translator {
33 Translator(const Translator &) = delete; 33 Translator(const Translator &) = delete;
34 Translator &operator=(const Translator &) = delete; 34 Translator &operator=(const Translator &) = delete;
35 35
36 public: 36 public:
37 Translator(GlobalContext *Ctx, const ClFlags &Flags); 37 Translator(GlobalContext *Ctx);
38 38
39 ~Translator(); 39 ~Translator();
40 const ErrorCode &getErrorStatus() const { return ErrorStatus; } 40 const ErrorCode &getErrorStatus() const { return ErrorStatus; }
41 41
42 GlobalContext *getContext() const { return Ctx; } 42 GlobalContext *getContext() const { return Ctx; }
43 43
44 const ClFlags &getFlags() const { return Flags; } 44 const ClFlags &getFlags() const { return Ctx->getFlags(); }
45 45
46 /// Translates the constructed ICE function Fcn to machine code. 46 /// Translates the constructed ICE function Fcn to machine code.
47 /// Takes ownership of Func. 47 /// Takes ownership of Func.
48 void translateFcn(std::unique_ptr<Cfg> Func); 48 void translateFcn(std::unique_ptr<Cfg> Func);
49 49
50 /// Emits the constant pool. 50 /// Emits the constant pool.
51 void emitConstants(); 51 void emitConstants();
52 52
53 /// If there was an error during bitcode reading/parsing, copy the 53 /// If there was an error during bitcode reading/parsing, copy the
54 /// error code into the GlobalContext. 54 /// error code into the GlobalContext.
55 void transferErrorCode() const; 55 void transferErrorCode() const;
56 56
57 /// Lowers the given list of global addresses to target. Generates 57 /// Lowers the given list of global addresses to target. Generates
58 /// list of corresponding variable declarations. 58 /// list of corresponding variable declarations.
59 void lowerGlobals(const VariableDeclarationList &VariableDeclarations); 59 void
60 lowerGlobals(std::unique_ptr<VariableDeclarationList> VariableDeclarations);
60 61
61 /// Creates a name using the given prefix and corresponding index. 62 /// Creates a name using the given prefix and corresponding index.
62 std::string createUnnamedName(const IceString &Prefix, SizeT Index); 63 std::string createUnnamedName(const IceString &Prefix, SizeT Index);
63 64
64 /// Reports if there is a (potential) conflict between Name, and using 65 /// Reports if there is a (potential) conflict between Name, and using
65 /// Prefix to name unnamed names. Errors are put on Ostream. 66 /// Prefix to name unnamed names. Errors are put on Ostream.
66 /// Returns true if there isn't a potential conflict. 67 /// Returns true if there isn't a potential conflict.
67 bool checkIfUnnamedNameSafe(const IceString &Name, const char *Kind, 68 bool checkIfUnnamedNameSafe(const IceString &Name, const char *Kind,
68 const IceString &Prefix); 69 const IceString &Prefix);
69 70
71 uint32_t getNextSequenceNumber() { return NextSequenceNumber++; }
72
70 protected: 73 protected:
71 GlobalContext *Ctx; 74 GlobalContext *Ctx;
72 const ClFlags &Flags; 75 uint32_t NextSequenceNumber;
73 std::unique_ptr<TargetDataLowering> DataLowering;
74 // Exit status of the translation. False is successful. True otherwise. 76 // Exit status of the translation. False is successful. True otherwise.
75 ErrorCode ErrorStatus; 77 ErrorCode ErrorStatus;
76 }; 78 };
77 79
78 } // end of namespace Ice 80 } // end of namespace Ice
79 81
80 #endif // SUBZERO_SRC_ICETRANSLATOR_H 82 #endif // SUBZERO_SRC_ICETRANSLATOR_H
OLDNEW
« no previous file with comments | « src/IceThreading.cpp ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698