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
Loading
Please sign in to comment