mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Prevent PrintOptions from being implicitly copied.
NFC *except* that I noticed a bug by inspection where we suppress `@escaping` when print enum element types. Since this affects recursive positions, we end up suppressing `@escaping` in places we shouldn't. This is unlikely to affect much real code, but should still obviously be fixed. The new design is a little sketchy in that we're using `const` to prevent direct use (and allow initialization of `const &` parameters) but still relying on modification of the actual object. Essentially, we are treating the `const`-ness of the reference as a promise to leave the original value in the object after computation rather than a guarantee of not modifying the object. This is okay --- a temporary bound to a `const` reference is still a non-`const` object formally and can be modified without invoking UB --- but makes me a little uncomfortable.
This commit is contained in:
@@ -216,7 +216,7 @@ private:
|
||||
|
||||
/// Print this graph node.
|
||||
void print(llvm::raw_ostream &out, unsigned indent,
|
||||
PrintOptions PO = PrintOptions()) const;
|
||||
const PrintOptions &PO = PrintOptions()) const;
|
||||
|
||||
SWIFT_DEBUG_DUMP;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user