[Mlir-commits] [clang] [llvm] [mlir] [TableGen] Change `DefInit::Def` to a const Record pointer (PR #110747)
Rahul Joshi
llvmlistbot at llvm.org
Wed Oct 2 08:27:50 PDT 2024
================
@@ -1660,7 +1660,7 @@ class Record {
// this record.
SmallVector<SMLoc, 4> Locs;
SmallVector<SMLoc, 0> ForwardDeclarationLocs;
- SmallVector<SMRange, 0> ReferenceLocs;
+ mutable SmallVector<SMRange, 0> ReferenceLocs;
----------------
jurahul wrote:
No, this is for another case. Essentially, `appendReferenceLoc` is only called from TGParser, and now that all those pointers are const (because in most cases, reference locs is added post creation of the record) all those functions need to either work with const pointers (by making the `ReferenceLocs` mutable) or we just const_cast<> in TGParser at the point where it's called. Either way works. Let me know what you think is better, and I will make all of them consistent.
Maybe const_cast<> so that the change is localized to the actual place?
https://github.com/llvm/llvm-project/pull/110747
More information about the Mlir-commits
mailing list