diff options
Diffstat (limited to 'clang-tools-extra/clangd/SourceCode.h')
| -rw-r--r-- | clang-tools-extra/clangd/SourceCode.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang-tools-extra/clangd/SourceCode.h b/clang-tools-extra/clangd/SourceCode.h index 8e58e66f4db..4bbf3cf49fc 100644 --- a/clang-tools-extra/clangd/SourceCode.h +++ b/clang-tools-extra/clangd/SourceCode.h @@ -75,6 +75,14 @@ llvm::Optional<Range> getTokenRange(const SourceManager &SM, llvm::Expected<SourceLocation> sourceLocationInMainFile(const SourceManager &SM, Position P); +/// Returns true iff \p Loc is inside the main file. This function handles +/// file & macro locations. For macro locations, returns iff the macro is being +/// expanded inside the main file. +/// +/// The function is usually used to check whether a declaration is inside the +/// the main file. +bool isInsideMainFile(SourceLocation Loc, const SourceManager &SM); + /// Turns a token range into a half-open range and checks its correctness. /// The resulting range will have only valid source location on both sides, both /// of which are file locations. |

