aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorKazu Hirata <kazu@google.com>2025-05-10 13:00:47 -0700
committerGitHub <noreply@github.com>2025-05-10 13:00:47 -0700
commit58014a506dd35df3f24320cf295945ad033d0e8c (patch)
treefc8be33c5f8bfec3272f86978e96603a747ab379 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentf5f8ddc166b1909623f19dc134d18a4320ec485b (diff)
downloadllvm-58014a506dd35df3f24320cf295945ad033d0e8c.zip
llvm-58014a506dd35df3f24320cf295945ad033d0e8c.tar.gz
llvm-58014a506dd35df3f24320cf295945ad033d0e8c.tar.bz2
[IR] Teach getConstraintString to return StringRef (NFC) (#139401)
With this change, some callers get to use StringRef::starts_with. I'm planning to teach getAsmString to return StringRef also, but I'ld like to keep that separate from this patch.
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index ef39787..158b0a6 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -2805,7 +2805,7 @@ void ModuleBitcodeWriter::writeConstants(unsigned FirstVal, unsigned LastVal,
Record.append(AsmStr.begin(), AsmStr.end());
// Add the constraint string.
- const std::string &ConstraintStr = IA->getConstraintString();
+ StringRef ConstraintStr = IA->getConstraintString();
Record.push_back(ConstraintStr.size());
Record.append(ConstraintStr.begin(), ConstraintStr.end());
Stream.EmitRecord(bitc::CST_CODE_INLINEASM, Record);