aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorMircea Trofin <mtrofin@google.com>2020-10-28 12:08:26 -0700
committerMircea Trofin <mtrofin@google.com>2020-10-28 12:33:39 -0700
commit6fa35541a0af9d5493e288f574896ee33a8eae92 (patch)
tree13c974e50c763e8c03f4c6ce6bc10fa7ed00be9e /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parentbed83940478449b7ee08d43e5b74995912bf8206 (diff)
downloadllvm-6fa35541a0af9d5493e288f574896ee33a8eae92.zip
llvm-6fa35541a0af9d5493e288f574896ee33a8eae92.tar.gz
llvm-6fa35541a0af9d5493e288f574896ee33a8eae92.tar.bz2
[NFC][ThinLTO] Change command line passing to EmbedBitcodeInModule
Changing to pass by ref - less null checks to worry about. Differential Revision: https://reviews.llvm.org/D90330
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index d64dcd3..7cfa458 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -4819,7 +4819,7 @@ static const char *getSectionNameForCommandline(const Triple &T) {
void llvm::EmbedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,
bool EmbedBitcode, bool EmbedMarker,
- const std::vector<uint8_t> *CmdArgs) {
+ const std::vector<uint8_t> &CmdArgs) {
// Save llvm.compiler.used and remove it.
SmallVector<Constant *, 2> UsedArray;
SmallPtrSet<GlobalValue *, 4> UsedGlobals;
@@ -4878,8 +4878,8 @@ void llvm::EmbedBitcodeInModule(llvm::Module &M, llvm::MemoryBufferRef Buf,
// Skip if only bitcode needs to be embedded.
if (EmbedMarker) {
// Embed command-line options.
- ArrayRef<uint8_t> CmdData(const_cast<uint8_t *>(CmdArgs->data()),
- CmdArgs->size());
+ ArrayRef<uint8_t> CmdData(const_cast<uint8_t *>(CmdArgs.data()),
+ CmdArgs.size());
llvm::Constant *CmdConstant =
llvm::ConstantDataArray::get(M.getContext(), CmdData);
GV = new llvm::GlobalVariable(M, CmdConstant->getType(), true,