llvm-project
173f268d - [NFC] Move PaddingClearer functionality into ASTContext (#215823)

Commit
31 days ago
[NFC] Move PaddingClearer functionality into ASTContext (#215823) CIR needs to use this functionality to support `__builtin_clear_padding`, and a `bit-cast-padding` warning could also apparently use it as well. This patch moves this logic to a function in `ASTContext`, which returns a vector of effectively 'pair' objects. This result is now ALSO cached, so we don't have to generate it multiple times for the same objects, as suggested by Eli. The logic is effectively copy/pasted with some minor changes to remove the dependency on CodeGen/LLVM-IR. The conversion of the 'pair' objects to IR is done in CodeGen, but that function is generally only mildly changed.
Author
Parents
Loading