Start processing function blocks. Handle binops and returns. BUG= https://code.google.com/p/nativeclient/issues/detail?id=3894 R=jvoung@chromium.org, stichnot@chromium.org Review URL: https://codereview.chromium.org/395193005
diff --git a/src/IceTranslator.h b/src/IceTranslator.h index 51e4df0..ec5c032 100644 --- a/src/IceTranslator.h +++ b/src/IceTranslator.h
@@ -29,13 +29,27 @@ // machine instructions. class Translator { public: - Translator(GlobalContext *Ctx) : Ctx(Ctx), ErrorStatus(0) {} + Translator(GlobalContext *Ctx, const ClFlags &Flags) + : Ctx(Ctx), Flags(Flags), ErrorStatus(0) {} ~Translator(); bool getErrorStatus() const { return ErrorStatus; } + GlobalContext *getContext() const { return Ctx; } + + const ClFlags &getFlags() const { return Flags; } + + /// Translates the constructed ICE function Fcn to machine code. + /// Takes ownership of Fcn. Note: As a side effect, Field Func is + /// set to Fcn. + void translateFcn(Cfg *Fcn); + + /// Emits the constant pool. + void emitConstants(); + protected: GlobalContext *Ctx; + const ClFlags &Flags; // The exit status of the translation. False is successful. True // otherwise. bool ErrorStatus; @@ -49,13 +63,6 @@ // that. llvm::OwningPtr<Cfg> Func; - /// Translates the constructed ICE function Fcn to machine code. - /// Note: As a side effect, Field Func is set to Fcn. - void translateFcn(Cfg *Fcn); - - /// Emits the constant pool. - void emitConstants(); - private: Translator(const Translator &) LLVM_DELETED_FUNCTION; Translator &operator=(const Translator &) LLVM_DELETED_FUNCTION;