LLVM 22.0.0git
Twine.h
Go to the documentation of this file.
1//===- Twine.h - Fast Temporary String Concatenation ------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLVM_ADT_TWINE_H
10#define LLVM_ADT_TWINE_H
11
13#include "llvm/ADT/StringRef.h"
16#include <cassert>
17#include <cstdint>
18#include <string>
19#include <string_view>
20
21namespace llvm {
22
24class raw_ostream;
25
26/// Twine - A lightweight data structure for efficiently representing the
27/// concatenation of temporary values as strings.
28///
29/// A Twine is a kind of rope, it represents a concatenated string using a
30/// binary-tree, where the string is the preorder of the nodes. Since the
31/// Twine can be efficiently rendered into a buffer when its result is used,
32/// it avoids the cost of generating temporary values for intermediate string
33/// results -- particularly in cases when the Twine result is never
34/// required. By explicitly tracking the type of leaf nodes, we can also avoid
35/// the creation of temporary strings for conversions operations (such as
36/// appending an integer to a string).
37///
38/// A Twine is not intended for use directly and should not be stored, its
39/// implementation relies on the ability to store pointers to temporary stack
40/// objects which may be deallocated at the end of a statement. Twines should
41/// only be used as const references in arguments, when an API wishes
42/// to accept possibly-concatenated strings.
43///
44/// Twines support a special 'null' value, which always concatenates to form
45/// itself, and renders as an empty string. This can be returned from APIs to
46/// effectively nullify any concatenations performed on the result.
47///
48/// \b Implementation
49///
50/// Given the nature of a Twine, it is not possible for the Twine's
51/// concatenation method to construct interior nodes; the result must be
52/// represented inside the returned value. For this reason a Twine object
53/// actually holds two values, the left- and right-hand sides of a
54/// concatenation. We also have nullary Twine objects, which are effectively
55/// sentinel values that represent empty strings.
56///
57/// Thus, a Twine can effectively have zero, one, or two children. The \see
58/// isNullary(), \see isUnary(), and \see isBinary() predicates exist for
59/// testing the number of children.
60///
61/// We maintain a number of invariants on Twine objects (FIXME: Why):
62/// - Nullary twines are always represented with their Kind on the left-hand
63/// side, and the Empty kind on the right-hand side.
64/// - Unary twines are always represented with the value on the left-hand
65/// side, and the Empty kind on the right-hand side.
66/// - If a Twine has another Twine as a child, that child should always be
67/// binary (otherwise it could have been folded into the parent).
68///
69/// These invariants are check by \see isValid().
70///
71/// \b Efficiency Considerations
72///
73/// The Twine is designed to yield efficient and small code for common
74/// situations. For this reason, the concat() method is inlined so that
75/// concatenations of leaf nodes can be optimized into stores directly into a
76/// single stack allocated object.
77///
78/// In practice, not all compilers can be trusted to optimize concat() fully,
79/// so we provide two additional methods (and accompanying operator+
80/// overloads) to guarantee that particularly important cases (cstring plus
81/// StringRef) codegen as desired.
82class Twine {
83 /// NodeKind - Represent the type of an argument.
84 enum NodeKind : unsigned char {
85 /// An empty string; the result of concatenating anything with it is also
86 /// empty.
87 NullKind,
88
89 /// The empty string.
90 EmptyKind,
91
92 /// A pointer to a Twine instance.
93 TwineKind,
94
95 /// A pointer to a C string instance.
96 CStringKind,
97
98 /// A pointer to an std::string instance.
99 StdStringKind,
100
101 /// A Pointer and Length representation. Used for std::string_view,
102 /// StringRef, and SmallString. Can't use a StringRef here
103 /// because they are not trivally constructible.
104 PtrAndLengthKind,
105
106 /// A pointer and length representation that's also null-terminated.
107 /// Guaranteed to be constructed from a compile-time string literal.
108 StringLiteralKind,
109
110 /// A pointer to a formatv_object_base instance.
111 FormatvObjectKind,
112
113 /// A char value, to render as a character.
114 CharKind,
115
116 /// An unsigned int value, to render as an unsigned decimal integer.
117 DecUIKind,
118
119 /// An int value, to render as a signed decimal integer.
120 DecIKind,
121
122 /// A pointer to an unsigned long value, to render as an unsigned decimal
123 /// integer.
124 DecULKind,
125
126 /// A pointer to a long value, to render as a signed decimal integer.
127 DecLKind,
128
129 /// A pointer to an unsigned long long value, to render as an unsigned
130 /// decimal integer.
131 DecULLKind,
132
133 /// A pointer to a long long value, to render as a signed decimal integer.
134 DecLLKind,
135
136 /// A pointer to a uint64_t value, to render as an unsigned hexadecimal
137 /// integer.
138 UHexKind
139 };
140
141 union Child {
142 const Twine *twine;
143 const char *cString;
144 const std::string *stdString;
145 struct {
146 const char *ptr;
147 size_t length;
148 } ptrAndLength;
149 const formatv_object_base *formatvObject;
150 char character;
151 unsigned int decUI;
152 int decI;
153 const unsigned long *decUL;
154 const long *decL;
155 const unsigned long long *decULL;
156 const long long *decLL;
157 const uint64_t *uHex;
158 };
159
160 /// LHS - The prefix in the concatenation, which may be uninitialized for
161 /// Null or Empty kinds.
162 Child LHS;
163
164 /// RHS - The suffix in the concatenation, which may be uninitialized for
165 /// Null or Empty kinds.
166 Child RHS;
167
168 /// LHSKind - The NodeKind of the left hand side, \see getLHSKind().
169 NodeKind LHSKind = EmptyKind;
170
171 /// RHSKind - The NodeKind of the right hand side, \see getRHSKind().
172 NodeKind RHSKind = EmptyKind;
173
174 /// Construct a nullary twine; the kind must be NullKind or EmptyKind.
175 explicit Twine(NodeKind Kind) : LHSKind(Kind) {
176 assert(isNullary() && "Invalid kind!");
177 }
178
179 /// Construct a binary twine.
180 explicit Twine(const Twine &LHS, const Twine &RHS)
181 : LHSKind(TwineKind), RHSKind(TwineKind) {
182 this->LHS.twine = &LHS;
183 this->RHS.twine = &RHS;
184 assert(isValid() && "Invalid twine!");
185 }
186
187 /// Construct a twine from explicit values.
188 explicit Twine(Child LHS, NodeKind LHSKind, Child RHS, NodeKind RHSKind)
189 : LHS(LHS), RHS(RHS), LHSKind(LHSKind), RHSKind(RHSKind) {
190 assert(isValid() && "Invalid twine!");
191 }
192
193 /// Check for the null twine.
194 bool isNull() const { return getLHSKind() == NullKind; }
195
196 /// Check for the empty twine.
197 bool isEmpty() const { return getLHSKind() == EmptyKind; }
198
199 /// Check if this is a nullary twine (null or empty).
200 bool isNullary() const { return isNull() || isEmpty(); }
201
202 /// Check if this is a unary twine.
203 bool isUnary() const { return getRHSKind() == EmptyKind && !isNullary(); }
204
205 /// Check if this is a binary twine.
206 bool isBinary() const {
207 return getLHSKind() != NullKind && getRHSKind() != EmptyKind;
208 }
209
210 /// Check if this is a valid twine (satisfying the invariants on
211 /// order and number of arguments).
212 bool isValid() const {
213 // Nullary twines always have Empty on the RHS.
214 if (isNullary() && getRHSKind() != EmptyKind)
215 return false;
216
217 // Null should never appear on the RHS.
218 if (getRHSKind() == NullKind)
219 return false;
220
221 // The RHS cannot be non-empty if the LHS is empty.
222 if (getRHSKind() != EmptyKind && getLHSKind() == EmptyKind)
223 return false;
224
225 // A twine child should always be binary.
226 if (getLHSKind() == TwineKind && !LHS.twine->isBinary())
227 return false;
228 if (getRHSKind() == TwineKind && !RHS.twine->isBinary())
229 return false;
230
231 return true;
232 }
233
234 /// Get the NodeKind of the left-hand side.
235 NodeKind getLHSKind() const { return LHSKind; }
236
237 /// Get the NodeKind of the right-hand side.
238 NodeKind getRHSKind() const { return RHSKind; }
239
240 /// Print one child from a twine.
241 void printOneChild(raw_ostream &OS, Child Ptr, NodeKind Kind) const;
242
243 /// Print the representation of one child from a twine.
244 void printOneChildRepr(raw_ostream &OS, Child Ptr, NodeKind Kind) const;
245
246public:
247 /// @name Constructors
248 /// @{
249
250 /// Construct from an empty string.
251 /*implicit*/ Twine() { assert(isValid() && "Invalid twine!"); }
252
253 Twine(const Twine &) = default;
254
255 /// Construct from a C string.
256 ///
257 /// We take care here to optimize "" into the empty twine -- this will be
258 /// optimized out for string constants. This allows Twine arguments have
259 /// default "" values, without introducing unnecessary string constants.
260 /*implicit*/ Twine(const char *Str) {
261 if (Str[0] != '\0') {
262 LHS.cString = Str;
263 LHSKind = CStringKind;
264 } else {
265 LHSKind = EmptyKind;
266 }
267
268 assert(isValid() && "Invalid twine!");
269 }
270 /// Delete the implicit conversion from nullptr as Twine(const char *)
271 /// cannot take nullptr.
272 /*implicit*/ Twine(std::nullptr_t) = delete;
273
274 /// Construct from an std::string.
275 /*implicit*/ Twine(const std::string &Str) : LHSKind(StdStringKind) {
276 LHS.stdString = &Str;
277 assert(isValid() && "Invalid twine!");
278 }
279
280 /// Construct from an std::string_view by converting it to a pointer and
281 /// length. This handles string_views on a pure API basis, and avoids
282 /// storing one (or a pointer to one) inside a Twine, which avoids problems
283 /// when mixing code compiled under various C++ standards.
284 /*implicit*/ Twine(const std::string_view &Str) : LHSKind(PtrAndLengthKind) {
285 LHS.ptrAndLength.ptr = Str.data();
286 LHS.ptrAndLength.length = Str.length();
287 assert(isValid() && "Invalid twine!");
288 }
289
290 /// Construct from a StringRef.
291 /*implicit*/ Twine(const StringRef &Str) : LHSKind(PtrAndLengthKind) {
292 LHS.ptrAndLength.ptr = Str.data();
293 LHS.ptrAndLength.length = Str.size();
294 assert(isValid() && "Invalid twine!");
295 }
296
297 /// Construct from a StringLiteral.
298 /*implicit*/ Twine(const StringLiteral &Str) : LHSKind(StringLiteralKind) {
299 LHS.ptrAndLength.ptr = Str.data();
300 LHS.ptrAndLength.length = Str.size();
301 assert(isValid() && "Invalid twine!");
302 }
303
304 /// Construct from a SmallString.
305 /*implicit*/ Twine(const SmallVectorImpl<char> &Str)
306 : LHSKind(PtrAndLengthKind) {
307 LHS.ptrAndLength.ptr = Str.data();
308 LHS.ptrAndLength.length = Str.size();
309 assert(isValid() && "Invalid twine!");
310 }
311
312 /// Construct from a formatv_object_base.
313 /*implicit*/ Twine(const formatv_object_base &Fmt)
314 : LHSKind(FormatvObjectKind) {
315 LHS.formatvObject = &Fmt;
316 assert(isValid() && "Invalid twine!");
317 }
318
319 /// Construct from a char.
320 explicit Twine(char Val) : LHSKind(CharKind) { LHS.character = Val; }
321
322 /// Construct from a signed char.
323 explicit Twine(signed char Val) : LHSKind(CharKind) {
324 LHS.character = static_cast<char>(Val);
325 }
326
327 /// Construct from an unsigned char.
328 explicit Twine(unsigned char Val) : LHSKind(CharKind) {
329 LHS.character = static_cast<char>(Val);
330 }
331
332 /// Construct a twine to print \p Val as an unsigned decimal integer.
333 explicit Twine(unsigned Val) : LHSKind(DecUIKind) { LHS.decUI = Val; }
334
335 /// Construct a twine to print \p Val as a signed decimal integer.
336 explicit Twine(int Val) : LHSKind(DecIKind) { LHS.decI = Val; }
337
338 /// Construct a twine to print \p Val as an unsigned decimal integer.
339 explicit Twine(const unsigned long &Val) : LHSKind(DecULKind) {
340 LHS.decUL = &Val;
341 }
342
343 /// Construct a twine to print \p Val as a signed decimal integer.
344 explicit Twine(const long &Val) : LHSKind(DecLKind) { LHS.decL = &Val; }
345
346 /// Construct a twine to print \p Val as an unsigned decimal integer.
347 explicit Twine(const unsigned long long &Val) : LHSKind(DecULLKind) {
348 LHS.decULL = &Val;
349 }
350
351 /// Construct a twine to print \p Val as a signed decimal integer.
352 explicit Twine(const long long &Val) : LHSKind(DecLLKind) {
353 LHS.decLL = &Val;
354 }
355
356 // FIXME: Unfortunately, to make sure this is as efficient as possible we
357 // need extra binary constructors from particular types. We can't rely on
358 // the compiler to be smart enough to fold operator+()/concat() down to the
359 // right thing. Yet.
360
361 /// Construct as the concatenation of a C string and a StringRef.
362 /*implicit*/ Twine(const char *LHS, const StringRef &RHS)
363 : LHSKind(CStringKind), RHSKind(PtrAndLengthKind) {
364 this->LHS.cString = LHS;
365 this->RHS.ptrAndLength.ptr = RHS.data();
366 this->RHS.ptrAndLength.length = RHS.size();
367 assert(isValid() && "Invalid twine!");
368 }
369
370 /// Construct as the concatenation of a StringRef and a C string.
371 /*implicit*/ Twine(const StringRef &LHS, const char *RHS)
372 : LHSKind(PtrAndLengthKind), RHSKind(CStringKind) {
373 this->LHS.ptrAndLength.ptr = LHS.data();
374 this->LHS.ptrAndLength.length = LHS.size();
375 this->RHS.cString = RHS;
376 assert(isValid() && "Invalid twine!");
377 }
378
379 /// Since the intended use of twines is as temporary objects, assignments
380 /// when concatenating might cause undefined behavior or stack corruptions
381 Twine &operator=(const Twine &) = delete;
382
383 /// Create a 'null' string, which is an empty string that always
384 /// concatenates to form another empty string.
385 static Twine createNull() { return Twine(NullKind); }
386
387 /// @}
388 /// @name Numeric Conversions
389 /// @{
390
391 // Construct a twine to print \p Val as an unsigned hexadecimal integer.
392 static Twine utohexstr(const uint64_t &Val) {
393 Child LHS, RHS;
394 LHS.uHex = &Val;
395 RHS.twine = nullptr;
396 return Twine(LHS, UHexKind, RHS, EmptyKind);
397 }
398
399 /// @}
400 /// @name Predicate Operations
401 /// @{
402
403 /// Check if this twine is trivially empty; a false return value does not
404 /// necessarily mean the twine is empty.
405 bool isTriviallyEmpty() const { return isNullary(); }
406
407 /// Check if this twine is guaranteed to refer to single string literal.
409 return isUnary() && getLHSKind() == StringLiteralKind;
410 }
411
412 /// Return true if this twine can be dynamically accessed as a single
413 /// StringRef value with getSingleStringRef().
414 bool isSingleStringRef() const {
415 if (getRHSKind() != EmptyKind)
416 return false;
417
418 switch (getLHSKind()) {
419 case EmptyKind:
420 case CStringKind:
421 case StdStringKind:
422 case PtrAndLengthKind:
423 case StringLiteralKind:
424 return true;
425 default:
426 return false;
427 }
428 }
429
430 /// @}
431 /// @name String Operations
432 /// @{
433
434 Twine concat(const Twine &Suffix) const;
435
436 /// @}
437 /// @name Output & Conversion.
438 /// @{
439
440 /// Return the twine contents as a std::string.
441 LLVM_ABI std::string str() const;
442
443 /// Append the concatenated string into the given SmallString or SmallVector.
444 LLVM_ABI void toVector(SmallVectorImpl<char> &Out) const;
445
446 /// This returns the twine as a single StringRef. This method is only valid
447 /// if isSingleStringRef() is true.
449 assert(isSingleStringRef() && "This cannot be had as a single stringref!");
450 switch (getLHSKind()) {
451 default:
452 llvm_unreachable("Out of sync with isSingleStringRef");
453 case EmptyKind:
454 return StringRef();
455 case CStringKind:
456 return StringRef(LHS.cString);
457 case StdStringKind:
458 return StringRef(*LHS.stdString);
459 case PtrAndLengthKind:
460 case StringLiteralKind:
461 return StringRef(LHS.ptrAndLength.ptr, LHS.ptrAndLength.length);
462 }
463 }
464
465 /// This returns the twine as a single StringRef if it can be
466 /// represented as such. Otherwise the twine is written into the given
467 /// SmallVector and a StringRef to the SmallVector's data is returned.
469 if (isSingleStringRef())
470 return getSingleStringRef();
471 toVector(Out);
472 return StringRef(Out.data(), Out.size());
473 }
474
475 /// This returns the twine as a single null terminated StringRef if it
476 /// can be represented as such. Otherwise the twine is written into the
477 /// given SmallVector and a StringRef to the SmallVector's data is returned.
478 ///
479 /// The returned StringRef's size does not include the null terminator.
482
483 /// Write the concatenated string represented by this twine to the
484 /// stream \p OS.
485 LLVM_ABI void print(raw_ostream &OS) const;
486
487 /// Write the representation of this twine to the stream \p OS.
488 LLVM_ABI void printRepr(raw_ostream &OS) const;
489
490#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
491 /// Dump the concatenated string represented by this twine to stderr.
492 LLVM_DUMP_METHOD void dump() const;
493
494 /// Dump the representation of this twine to stderr.
495 LLVM_DUMP_METHOD void dumpRepr() const;
496#endif
497
498 /// @}
499};
500
501/// @name Twine Inline Implementations
502/// @{
503
504inline Twine Twine::concat(const Twine &Suffix) const {
505 // Concatenation with null is null.
506 if (isNull() || Suffix.isNull())
507 return Twine(NullKind);
508
509 // Concatenation with empty yields the other side.
510 if (isEmpty())
511 return Suffix;
512 if (Suffix.isEmpty())
513 return *this;
514
515 // Otherwise we need to create a new node, taking care to fold in unary
516 // twines.
517 Child NewLHS, NewRHS;
518 NewLHS.twine = this;
519 NewRHS.twine = &Suffix;
520 NodeKind NewLHSKind = TwineKind, NewRHSKind = TwineKind;
521 if (isUnary()) {
522 NewLHS = LHS;
523 NewLHSKind = getLHSKind();
524 }
525 if (Suffix.isUnary()) {
526 NewRHS = Suffix.LHS;
527 NewRHSKind = Suffix.getLHSKind();
528 }
529
530 return Twine(NewLHS, NewLHSKind, NewRHS, NewRHSKind);
531}
532
533inline Twine operator+(const Twine &LHS, const Twine &RHS) {
534 return LHS.concat(RHS);
535}
536
537/// Additional overload to guarantee simplified codegen; this is equivalent to
538/// concat().
539
540inline Twine operator+(const char *LHS, const StringRef &RHS) {
541 return Twine(LHS, RHS);
542}
543
544/// Additional overload to guarantee simplified codegen; this is equivalent to
545/// concat().
546
547inline Twine operator+(const StringRef &LHS, const char *RHS) {
548 return Twine(LHS, RHS);
549}
550
552 RHS.print(OS);
553 return OS;
554}
555
556/// @}
557
558} // end namespace llvm
559
560#endif // LLVM_ADT_TWINE_H
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_ABI
Definition Compiler.h:213
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
Definition Compiler.h:638
This file defines the SmallVector class.
Value * RHS
Value * LHS
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
pointer data()
Return a pointer to the vector's buffer, even if empty().
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition StringRef.h:862
StringRef - Represent a constant reference to a string, i.e.
Definition StringRef.h:55
constexpr size_t size() const
size - Get the string size.
Definition StringRef.h:154
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
Definition StringRef.h:148
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition Twine.h:82
Twine()
Construct from an empty string.
Definition Twine.h:251
Twine(const formatv_object_base &Fmt)
Construct from a formatv_object_base.
Definition Twine.h:313
Twine & operator=(const Twine &)=delete
Since the intended use of twines is as temporary objects, assignments when concatenating might cause ...
Twine(const long long &Val)
Construct a twine to print Val as a signed decimal integer.
Definition Twine.h:352
bool isSingleStringRef() const
Return true if this twine can be dynamically accessed as a single StringRef value with getSingleStrin...
Definition Twine.h:414
Twine(const unsigned long &Val)
Construct a twine to print Val as an unsigned decimal integer.
Definition Twine.h:339
Twine(const SmallVectorImpl< char > &Str)
Construct from a SmallString.
Definition Twine.h:305
LLVM_ABI std::string str() const
Return the twine contents as a std::string.
Definition Twine.cpp:17
Twine concat(const Twine &Suffix) const
Definition Twine.h:504
Twine(unsigned Val)
Construct a twine to print Val as an unsigned decimal integer.
Definition Twine.h:333
LLVM_ABI void print(raw_ostream &OS) const
Write the concatenated string represented by this twine to the stream OS.
Definition Twine.cpp:164
LLVM_ABI StringRef toNullTerminatedStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single null terminated StringRef if it can be represented as such.
Definition Twine.cpp:37
Twine(const std::string &Str)
Construct from an std::string.
Definition Twine.h:275
Twine(unsigned char Val)
Construct from an unsigned char.
Definition Twine.h:328
LLVM_DUMP_METHOD void dump() const
Dump the concatenated string represented by this twine to stderr.
Definition Twine.cpp:178
Twine(const char *LHS, const StringRef &RHS)
Construct as the concatenation of a C string and a StringRef.
Definition Twine.h:362
Twine(std::nullptr_t)=delete
Delete the implicit conversion from nullptr as Twine(const char *) cannot take nullptr.
bool isTriviallyEmpty() const
Check if this twine is trivially empty; a false return value does not necessarily mean the twine is e...
Definition Twine.h:405
bool isSingleStringLiteral() const
Check if this twine is guaranteed to refer to single string literal.
Definition Twine.h:408
static Twine createNull()
Create a 'null' string, which is an empty string that always concatenates to form another empty strin...
Definition Twine.h:385
Twine(const long &Val)
Construct a twine to print Val as a signed decimal integer.
Definition Twine.h:344
LLVM_ABI void printRepr(raw_ostream &OS) const
Write the representation of this twine to the stream OS.
Definition Twine.cpp:169
Twine(signed char Val)
Construct from a signed char.
Definition Twine.h:323
Twine(const Twine &)=default
Twine(const std::string_view &Str)
Construct from an std::string_view by converting it to a pointer and length.
Definition Twine.h:284
Twine(const StringLiteral &Str)
Construct from a StringLiteral.
Definition Twine.h:298
Twine(const StringRef &LHS, const char *RHS)
Construct as the concatenation of a StringRef and a C string.
Definition Twine.h:371
StringRef toStringRef(SmallVectorImpl< char > &Out) const
This returns the twine as a single StringRef if it can be represented as such.
Definition Twine.h:468
static Twine utohexstr(const uint64_t &Val)
Definition Twine.h:392
Twine(int Val)
Construct a twine to print Val as a signed decimal integer.
Definition Twine.h:336
Twine(const StringRef &Str)
Construct from a StringRef.
Definition Twine.h:291
StringRef getSingleStringRef() const
This returns the twine as a single StringRef.
Definition Twine.h:448
LLVM_ABI void toVector(SmallVectorImpl< char > &Out) const
Append the concatenated string into the given SmallString or SmallVector.
Definition Twine.cpp:32
Twine(char Val)
Construct from a char.
Definition Twine.h:320
LLVM_DUMP_METHOD void dumpRepr() const
Dump the representation of this twine to stderr.
Definition Twine.cpp:180
Twine(const unsigned long long &Val)
Construct a twine to print Val as an unsigned decimal integer.
Definition Twine.h:347
Twine(const char *Str)
Construct from a C string.
Definition Twine.h:260
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition raw_ostream.h:53
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
This is an optimization pass for GlobalISel generic memory operations.
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
APInt operator+(APInt a, const APInt &b)
Definition APInt.h:2193