================ @@ -551,18 +552,18 @@ std::string BitsInit::getAsString() const { // resolveReferences - If there are any field references that refer to fields // that have been filled in, we can propagate the values now. -Init *BitsInit::resolveReferences(Resolver &R) const { +const Init *BitsInit::resolveReferences(Resolver &R) const { bool Changed = false; - SmallVector<Init *, 16> NewBits(getNumBits()); + SmallVector<const Init *, 16> NewBits(getNumBits()); - Init *CachedBitVarRef = nullptr; - Init *CachedBitVarResolved = nullptr; + const Init *CachedBitVarRef = nullptr; + const Init *CachedBitVarResolved = nullptr; for (unsigned i = 0, e = getNumBits(); i != e; ++i) { - Init *CurBit = getBit(i); - Init *NewBit = CurBit; + const Init *CurBit = getBit(i); + const Init *NewBit = CurBit; - if (VarBitInit *CurBitVar = dyn_cast<VarBitInit>(CurBit)) { + if (const VarBitInit *CurBitVar = dyn_cast<VarBitInit>(CurBit)) { ---------------- topperc wrote:
Could use `auto *CurBitVar` here and on all the other dyn_cast/cast. But you don't have to. https://github.com/llvm/llvm-project/pull/112705 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits