Index: src/IceCompileServer.h |
diff --git a/src/IceCompileServer.h b/src/IceCompileServer.h |
index 9b02f92c85259263ff07f89787d811b741f6c80d..ca02577b78b302faa08f3df6d9f6336266e59c4d 100644 |
--- a/src/IceCompileServer.h |
+++ b/src/IceCompileServer.h |
@@ -41,12 +41,11 @@ namespace Ice { |
/// request immediately. When run in the browser, it blocks waiting for a |
/// request. |
class CompileServer { |
- CompileServer() = delete; |
CompileServer(const CompileServer &) = delete; |
CompileServer &operator=(const CompileServer &) = delete; |
public: |
- explicit CompileServer(Compiler &Comp) : Comp(Comp) {} |
+ CompileServer() = default; |
virtual ~CompileServer() = default; |
@@ -55,10 +54,15 @@ public: |
virtual ErrorCode &getErrorCode() { return LastError; } |
void transferErrorCode(ErrorCodes Code) { LastError.assign(Code); } |
+ int runAndReturnErrorCode() { |
+ run(); |
+ return getErrorCode().value(); |
+ } |
+ |
protected: |
- Compiler &getCompiler() const { return Comp; } |
+ Compiler &getCompiler() { return Comp; } |
- Compiler &Comp; |
+ Compiler Comp; |
ErrorCode LastError; |
}; |
@@ -69,8 +73,7 @@ class CLCompileServer : public CompileServer { |
CLCompileServer &operator=(const CLCompileServer &) = delete; |
public: |
- CLCompileServer(Compiler &Comp, int argc, char **argv) |
- : CompileServer(Comp), argc(argc), argv(argv) {} |
+ CLCompileServer(int argc, char **argv) : argc(argc), argv(argv) {} |
~CLCompileServer() final = default; |