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

Unified Diff: tools/clang/blink_gc_plugin/JsonWriter.h

Issue 1145043003: Roll Clang 233105-2:238013-1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Try 238013 Created 5 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 | « build/config/compiler/BUILD.gn ('k') | tools/clang/scripts/update.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/clang/blink_gc_plugin/JsonWriter.h
diff --git a/tools/clang/blink_gc_plugin/JsonWriter.h b/tools/clang/blink_gc_plugin/JsonWriter.h
index 09504b3aaf9feb7e011d0740959aab6c61624a89..3fe79103bbadbadc21770b707584ba1648462ed4 100644
--- a/tools/clang/blink_gc_plugin/JsonWriter.h
+++ b/tools/clang/blink_gc_plugin/JsonWriter.h
@@ -7,24 +7,12 @@
#include "llvm/Support/raw_ostream.h"
-// TODO(hans): Remove this #ifdef after Clang is rolled past r234897.
-#ifdef LLVM_FORCE_HEAD_REVISION
-#define JSON_WRITER_STREAM std::unique_ptr<llvm::raw_ostream>
-#else
-#define JSON_WRITER_STREAM llvm::raw_fd_ostream*
-#endif
-
// Helper to write information for the points-to graph.
class JsonWriter {
public:
- static JsonWriter* from(JSON_WRITER_STREAM os) {
+ static JsonWriter* from(std::unique_ptr<llvm::raw_ostream> os) {
return os ? new JsonWriter(std::move(os)) : 0;
}
-#ifndef LLVM_FORCE_HEAD_REVISION
- ~JsonWriter() {
- delete os_;
- }
-#endif
void OpenList() {
Separator();
*os_ << "[";
@@ -65,7 +53,7 @@ class JsonWriter {
*os_ << "\"" << key << "\":\"" << val << "\"";
}
private:
- JsonWriter(JSON_WRITER_STREAM os) : os_(std::move(os)) {}
+ JsonWriter(std::unique_ptr<llvm::raw_ostream> os) : os_(std::move(os)) {}
void Separator() {
if (state_.empty())
return;
@@ -75,7 +63,7 @@ class JsonWriter {
}
state_.top() = true;
}
- JSON_WRITER_STREAM os_;
+ std::unique_ptr<llvm::raw_ostream> os_;
std::stack<bool> state_;
};
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | tools/clang/scripts/update.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698