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

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

Issue 1149913003: Revert "Roll Clang 233105-2:237739-1" (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: 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 3fe79103bbadbadc21770b707584ba1648462ed4..09504b3aaf9feb7e011d0740959aab6c61624a89 100644
--- a/tools/clang/blink_gc_plugin/JsonWriter.h
+++ b/tools/clang/blink_gc_plugin/JsonWriter.h
@@ -7,12 +7,24 @@
#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(std::unique_ptr<llvm::raw_ostream> os) {
+ static JsonWriter* from(JSON_WRITER_STREAM os) {
return os ? new JsonWriter(std::move(os)) : 0;
}
+#ifndef LLVM_FORCE_HEAD_REVISION
+ ~JsonWriter() {
+ delete os_;
+ }
+#endif
void OpenList() {
Separator();
*os_ << "[";
@@ -53,7 +65,7 @@ class JsonWriter {
*os_ << "\"" << key << "\":\"" << val << "\"";
}
private:
- JsonWriter(std::unique_ptr<llvm::raw_ostream> os) : os_(std::move(os)) {}
+ JsonWriter(JSON_WRITER_STREAM os) : os_(std::move(os)) {}
void Separator() {
if (state_.empty())
return;
@@ -63,7 +75,7 @@ class JsonWriter {
}
state_.top() = true;
}
- std::unique_ptr<llvm::raw_ostream> os_;
+ JSON_WRITER_STREAM 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