[llvm] [BitcodeReader] Lazily read and cache target triple (NFC) (PR #208175)
Antonio Frighetto via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 13 07:00:56 PDT 2026
================
@@ -893,6 +889,20 @@ class BitcodeReader : public BitcodeReaderBase, public GVMaterializer {
return readConstantRange(Record, OpNum, BitWidth);
}
+ /// Cache target triple for for upgrading AArch64 memory effects.
+ const Triple &getTargetTriple() {
+ if (!TargetTriple) {
+ BitstreamCursor TripleStream(Stream.getBitcodeBytes());
+ if (Expected<std::string> TripleStr = readTriple(TripleStream))
+ TargetTriple.emplace(*TripleStr);
----------------
antoniofrighetto wrote:
Oh, sure, thanks, let's avoid the std::string copy that would come while constructing a Triple.
https://github.com/llvm/llvm-project/pull/208175
More information about the llvm-commits
mailing list