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

Unified Diff: src/IceCompileServer.cpp

Issue 1961743002: Subzero: Update for LLVM 3.9 (trunk). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero@master
Patch Set: Remove unnecessary variable Created 4 years, 7 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/IceClFlags.cpp ('k') | src/IceCompiler.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceCompileServer.cpp
diff --git a/src/IceCompileServer.cpp b/src/IceCompileServer.cpp
index e700b1ee125674aecefa28ac0db77bbe87479675..e93f47daa50f93bf08f00e0b3747ba2df92d5e55 100644
--- a/src/IceCompileServer.cpp
+++ b/src/IceCompileServer.cpp
@@ -50,8 +50,12 @@ class TextDataStreamer : public llvm::DataStreamer {
public:
TextDataStreamer() = default;
~TextDataStreamer() final = default;
- static TextDataStreamer *create(const std::string &Filename,
- std::string *Err);
+#ifdef PNACL_LLVM
+ using CreateType = TextDataStreamer *;
+#else // !PNACL_LLVM
+ using CreateType = std::unique_ptr<TextDataStreamer>;
+#endif // !PNACL_LLVM
+ static CreateType create(const std::string &Filename, std::string *Err);
size_t GetBytes(unsigned char *Buf, size_t Len) final;
private:
@@ -59,8 +63,9 @@ private:
size_t Cursor = 0;
};
-TextDataStreamer *TextDataStreamer::create(const std::string &Filename,
- std::string *Err) {
+TextDataStreamer::CreateType
+TextDataStreamer::create(const std::string &Filename, std::string *Err) {
+#ifdef PNACL_LLVM
TextDataStreamer *Streamer = new TextDataStreamer();
llvm::raw_string_ostream ErrStrm(*Err);
if (std::error_code EC = llvm::readNaClRecordTextAndBuildBitcode(
@@ -72,6 +77,9 @@ TextDataStreamer *TextDataStreamer::create(const std::string &Filename,
}
ErrStrm.flush();
return Streamer;
+#else // !PNACL_LLVM
+ return CreateType();
+#endif // !PNACL_LLVM
}
size_t TextDataStreamer::GetBytes(unsigned char *Buf, size_t Len) {
« no previous file with comments | « src/IceClFlags.cpp ('k') | src/IceCompiler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698