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

Side by Side Diff: src/ostreams.h

Issue 2050213002: [wasm] Implement AST printing into an ostream (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@refactor-function-names-table
Patch Set: address ahaas' comments Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/ostreams.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_OSTREAMS_H_ 5 #ifndef V8_OSTREAMS_H_
6 #define V8_OSTREAMS_H_ 6 #define V8_OSTREAMS_H_
7 7
8 #include <cstddef> 8 #include <cstddef>
9 #include <cstdio> 9 #include <cstdio>
10 #include <cstring> 10 #include <cstring>
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 struct AsReversiblyEscapedUC16 { 59 struct AsReversiblyEscapedUC16 {
60 explicit AsReversiblyEscapedUC16(uint16_t v) : value(v) {} 60 explicit AsReversiblyEscapedUC16(uint16_t v) : value(v) {}
61 uint16_t value; 61 uint16_t value;
62 }; 62 };
63 63
64 struct AsEscapedUC16ForJSON { 64 struct AsEscapedUC16ForJSON {
65 explicit AsEscapedUC16ForJSON(uint16_t v) : value(v) {} 65 explicit AsEscapedUC16ForJSON(uint16_t v) : value(v) {}
66 uint16_t value; 66 uint16_t value;
67 }; 67 };
68 68
69 struct AsHex {
70 explicit AsHex(uint64_t v, uint8_t min_width = 0)
71 : value(v), min_width(min_width) {}
72 uint64_t value;
73 uint8_t min_width;
74 };
69 75
70 // Writes the given character to the output escaping everything outside of 76 // Writes the given character to the output escaping everything outside of
71 // printable/space ASCII range. Additionally escapes '\' making escaping 77 // printable/space ASCII range. Additionally escapes '\' making escaping
72 // reversible. 78 // reversible.
73 std::ostream& operator<<(std::ostream& os, const AsReversiblyEscapedUC16& c); 79 std::ostream& operator<<(std::ostream& os, const AsReversiblyEscapedUC16& c);
74 80
75 // Same as AsReversiblyEscapedUC16 with additional escaping of \n, \r, " and '. 81 // Same as AsReversiblyEscapedUC16 with additional escaping of \n, \r, " and '.
76 std::ostream& operator<<(std::ostream& os, const AsEscapedUC16ForJSON& c); 82 std::ostream& operator<<(std::ostream& os, const AsEscapedUC16ForJSON& c);
77 83
78 // Writes the given character to the output escaping everything outside 84 // Writes the given character to the output escaping everything outside
79 // of printable ASCII range. 85 // of printable ASCII range.
80 std::ostream& operator<<(std::ostream& os, const AsUC16& c); 86 std::ostream& operator<<(std::ostream& os, const AsUC16& c);
81 87
82 // Writes the given character to the output escaping everything outside 88 // Writes the given character to the output escaping everything outside
83 // of printable ASCII range. 89 // of printable ASCII range.
84 std::ostream& operator<<(std::ostream& os, const AsUC32& c); 90 std::ostream& operator<<(std::ostream& os, const AsUC32& c);
85 91
92 // Writes the given number to the output in hexadecimal notation.
93 std::ostream& operator<<(std::ostream& os, const AsHex& v);
94
86 } // namespace internal 95 } // namespace internal
87 } // namespace v8 96 } // namespace v8
88 97
89 #endif // V8_OSTREAMS_H_ 98 #endif // V8_OSTREAMS_H_
OLDNEW
« no previous file with comments | « src/compiler/wasm-compiler.cc ('k') | src/ostreams.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698