| 202 | |
| 203 | if(clang::scanSourceForDependencyDirectives(entry_ptr->source, |
| 204 | entry_ptr->tokens, |
| 205 | entry_ptr->directives)) { |
| 206 | // Scan failed — remove the entry. |
| 207 | if(cache) { |
| 208 | cache->entries.erase(path); |
| 209 | } else { |
| 210 | local_entries.pop_back(); |
| 211 | } |
| 212 | return std::nullopt; |
| 213 | } |
| 214 | |
| 215 | return llvm::ArrayRef(entry_ptr->directives); |
| 216 | } |
| 217 | |
| 218 | /// Lexed by clang's ordinary lexer, not from its directives: the main |
| 219 | /// file is the text being typed, and the directives lexer breaks on |
| 220 | /// half-typed directives (an `#if(` cut off at the end of the buffer, |
| 221 | /// `import <header>;`) where the ordinary lexer reports an error — the |
| 222 | /// scan runs in the master process, where a crash ends the server. |
| 223 | clang::OptionalFileEntryRef main_file; |
| 224 | |
| 225 | private: |
| 226 | SharedScanCache* cache; |
| 227 | clang::FileManager* file_mgr; |
| 228 | std::deque<SharedScanCache::CachedEntry> local_entries; |
| 229 | }; |
| 230 | |
| 231 | /// PPCallbacks for precise mode: single ScanResult with accurate |
| 232 | /// conditional tracking via preprocessor callbacks. |
| 233 | class PreciseScanPPCallbacks : public clang::PPCallbacks { |
| 234 | public: |
| 235 | explicit PreciseScanPPCallbacks(ScanResult& result) : result(result) {} |
nothing calls this directly
no outgoing calls
no test coverage detected