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

Side by Side Diff: src/IceTranslator.h

Issue 678533005: Subzero: Add basic ELFObjectWriter (text section, symtab, strtab, headers) (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: cleanup Created 6 years, 1 month 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/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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 /// set to Fcn. 53 /// set to Fcn.
54 void translateFcn(Cfg *Fcn); 54 void translateFcn(Cfg *Fcn);
55 55
56 /// Emits the constant pool. 56 /// Emits the constant pool.
57 void emitConstants(); 57 void emitConstants();
58 58
59 /// Lowers the given list of global addresses to target. Generates 59 /// Lowers the given list of global addresses to target. Generates
60 /// list of corresponding variable declarations. 60 /// list of corresponding variable declarations.
61 void lowerGlobals(const VariableDeclarationListType &VariableDeclarations); 61 void lowerGlobals(const VariableDeclarationListType &VariableDeclarations);
62 62
63 /// Write the final object file after completing translation.
64 void writeObjectFile();
65
63 /// Creates a name using the given prefix and corresponding index. 66 /// Creates a name using the given prefix and corresponding index.
64 std::string createUnnamedName(const IceString &Prefix, SizeT Index); 67 std::string createUnnamedName(const IceString &Prefix, SizeT Index);
65 68
66 /// Reports if there is a (potential) conflict between Name, and using 69 /// Reports if there is a (potential) conflict between Name, and using
67 /// Prefix to name unnamed names. Errors are put on Ostream. 70 /// Prefix to name unnamed names. Errors are put on Ostream.
68 /// Returns true if there isn't a potential conflict. 71 /// Returns true if there isn't a potential conflict.
69 bool checkIfUnnamedNameSafe(const IceString &Name, const char *Kind, 72 bool checkIfUnnamedNameSafe(const IceString &Name, const char *Kind,
70 const IceString &Prefix, Ostream &Stream); 73 const IceString &Prefix, Ostream &Stream);
71 74
72 protected: 75 protected:
73 GlobalContext *Ctx; 76 GlobalContext *Ctx;
74 const ClFlags &Flags; 77 const ClFlags &Flags;
75 // The exit status of the translation. False is successful. True 78 // The exit status of the translation. False is successful. True
76 // otherwise. 79 // otherwise.
77 bool ErrorStatus; 80 bool ErrorStatus;
78 // Ideally, Func would be inside the methods that converts IR to 81 // Ideally, Func would be inside the methods that converts IR to
79 // functions. However, emitting the constant pool requires a valid 82 // functions. However, emitting the constant pool requires a valid
80 // Cfg object, so we need to defer deleting the last non-empty Cfg 83 // Cfg object, so we need to defer deleting the last non-empty Cfg
81 // object to emit the constant pool (via emitConstants). TODO: 84 // object to emit the constant pool (via emitConstants). TODO:
82 // Since all constants are globally pooled in the GlobalContext 85 // Since all constants are globally pooled in the GlobalContext
83 // object, change all Constant related functions to use 86 // object, change all Constant related functions to use
84 // GlobalContext instead of Cfg, and then make emitConstantPool use 87 // GlobalContext instead of Cfg, and then make emitConstantPool use
85 // that. 88 // that.
86 std::unique_ptr<Cfg> Func; 89 std::unique_ptr<Cfg> Func;
87 }; 90 };
88 91
89 } // end of namespace Ice 92 } // end of namespace Ice
90 93
91 #endif // SUBZERO_SRC_ICETRANSLATOR_H 94 #endif // SUBZERO_SRC_ICETRANSLATOR_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698