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

Unified Diff: src/IceTranslator.h

Issue 870653002: Subzero: Initial implementation of multithreaded translation. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTranslator.h
diff --git a/src/IceTranslator.h b/src/IceTranslator.h
index a0c04098c3f3f73a403ac65b2d7bb45f099af308..630997b798f53f6e0d9e5aa2e63aba68452ef898 100644
--- a/src/IceTranslator.h
+++ b/src/IceTranslator.h
@@ -15,8 +15,6 @@
#ifndef SUBZERO_SRC_ICETRANSLATOR_H
#define SUBZERO_SRC_ICETRANSLATOR_H
-#include <memory>
-
namespace llvm {
class Module;
}
@@ -38,24 +36,25 @@ class Translator {
public:
typedef std::vector<VariableDeclaration *> VariableDeclarationListType;
- Translator(GlobalContext *Ctx, const ClFlags &Flags)
- : Ctx(Ctx), Flags(Flags), ErrorStatus(0) {}
-
+ Translator(GlobalContext *Ctx, const ClFlags &Flags);
~Translator();
- bool getErrorStatus() const { return ErrorStatus; }
+ const ErrorCode &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);
+ /// Takes ownership of Func.
+ void translateFcn(Cfg *Func);
/// Emits the constant pool.
void emitConstants();
+ /// If there was an error during bitcode reading/parsing, copy the
+ /// error code into the GlobalContext.
+ void transferErrorCode() const;
+
/// Lowers the given list of global addresses to target. Generates
/// list of corresponding variable declarations.
void lowerGlobals(const VariableDeclarationListType &VariableDeclarations);
@@ -72,18 +71,9 @@ public:
protected:
GlobalContext *Ctx;
const ClFlags &Flags;
- // The exit status of the translation. False is successful. True
- // otherwise.
- bool ErrorStatus;
- // Ideally, Func would be inside the methods that converts IR to
- // functions. However, emitting the constant pool requires a valid
- // Cfg object, so we need to defer deleting the last non-empty Cfg
- // object to emit the constant pool (via emitConstants). TODO:
- // Since all constants are globally pooled in the GlobalContext
- // object, change all Constant related functions to use
- // GlobalContext instead of Cfg, and then make emitConstantPool use
- // that.
- std::unique_ptr<Cfg> Func;
+ std::unique_ptr<TargetGlobalLowering> GlobalLowering;
+ // Exit status of the translation. False is successful. True otherwise.
+ ErrorCode ErrorStatus;
};
} // end of namespace Ice
« no previous file with comments | « src/IceTargetLoweringX8632.cpp ('k') | src/IceTranslator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698