aboutsummaryrefslogtreecommitdiff
path: root/clang/unittests/Frontend/CompilerInvocationTest.cpp
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-11-10 10:25:48 -0500
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2020-12-08 12:52:17 -0800
commit51f3432f4b5217b35dc2694c6e46d6cfc7defad6 (patch)
tree1b3c1684b80b6932fa813e3523ccaebb5e4c4af2 /clang/unittests/Frontend/CompilerInvocationTest.cpp
parenta65dc08d105e147c98ef17a47b9504210f6058c5 (diff)
downloadllvm-51f3432f4b5217b35dc2694c6e46d6cfc7defad6.zip
llvm-51f3432f4b5217b35dc2694c6e46d6cfc7defad6.tar.gz
llvm-51f3432f4b5217b35dc2694c6e46d6cfc7defad6.tar.bz2
Frontend: Clarify logic for using the preamble in ASTUnit::CodeComplete, almost NFC
Clarify the logic for using the preamble (and overriding the main file buffer) in `ASTUnit::CodeComplete` by factoring out a couple of lambdas (`getUniqueID` and `hasSameUniqueID`). While refactoring the logic, hoist the check for `Line > 1` and locally check if the filenames are equal (both to avoid unnecessary `stat` calls) and skip copying out the filenames to `std::string`. Besides fewer calls to `stat`, there's no functionality change here. Differential Revision: https://reviews.llvm.org/D91296
Diffstat (limited to 'clang/unittests/Frontend/CompilerInvocationTest.cpp')
0 files changed, 0 insertions, 0 deletions