diff options
author | Nathan James <n.james93@hotmail.co.uk> | 2020-11-17 13:02:58 +0000 |
---|---|---|
committer | Nathan James <n.james93@hotmail.co.uk> | 2020-11-17 13:02:58 +0000 |
commit | d44edfc1094ceece13e30e36dcc4a51b6eeebdaa (patch) | |
tree | 31728855ab7107773efee615d17668f78ad8fee6 /clang/lib/Serialization/GlobalModuleIndex.cpp | |
parent | 0765d78a41320c9924164e71befdbb9e974efd35 (diff) | |
download | llvm-d44edfc1094ceece13e30e36dcc4a51b6eeebdaa.zip llvm-d44edfc1094ceece13e30e36dcc4a51b6eeebdaa.tar.gz llvm-d44edfc1094ceece13e30e36dcc4a51b6eeebdaa.tar.bz2 |
[clang][NFC] Use SmallString instead of SmallVector<char
Simplifies code in some places and is more explicit about what is being used.
No additional includes were added here so no impact on compile time.
Diffstat (limited to 'clang/lib/Serialization/GlobalModuleIndex.cpp')
-rw-r--r-- | clang/lib/Serialization/GlobalModuleIndex.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Serialization/GlobalModuleIndex.cpp b/clang/lib/Serialization/GlobalModuleIndex.cpp index 9192b3b..52ce17d 100644 --- a/clang/lib/Serialization/GlobalModuleIndex.cpp +++ b/clang/lib/Serialization/GlobalModuleIndex.cpp @@ -905,7 +905,7 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, } // The output buffer, into which the global index will be written. - SmallVector<char, 16> OutputBuffer; + SmallString<16> OutputBuffer; { llvm::BitstreamWriter OutputStream(OutputBuffer); if (Builder.writeIndex(OutputStream)) @@ -913,9 +913,8 @@ GlobalModuleIndex::writeIndex(FileManager &FileMgr, "failed writing index"); } - return llvm::writeFileAtomically( - (IndexPath + "-%%%%%%%%").str(), IndexPath, - llvm::StringRef(OutputBuffer.data(), OutputBuffer.size())); + return llvm::writeFileAtomically((IndexPath + "-%%%%%%%%").str(), IndexPath, + OutputBuffer); } namespace { |