diff options
author | Ed Schouten <ed@FreeBSD.org> | 2009-06-27 10:45:02 +0000 |
---|---|---|
committer | Ed Schouten <ed@FreeBSD.org> | 2009-06-27 10:45:02 +0000 |
commit | 4ebdf5c4f587daef4e0be499802eac3a7a49bf2f (patch) | |
tree | 2c5a83521a20c02e7805581a174008aa9bc23579 /include/clang/Basic/SourceManager.h | |
parent | f698f7e71940663e26a4806a96fb0bdfa160c886 (diff) |
Notes
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index bcfb83b8942c..249ca89f717d 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -326,6 +326,11 @@ class SourceManager { // Statistics for -print-stats. mutable unsigned NumLinearScans, NumBinaryProbes; + // Cache results for the isBeforeInTranslationUnit method. + mutable FileID LastLFIDForBeforeTUCheck; + mutable FileID LastRFIDForBeforeTUCheck; + mutable bool LastResForBeforeTUCheck; + // SourceManager doesn't support copy construction. explicit SourceManager(const SourceManager&); void operator=(const SourceManager&); @@ -637,6 +642,11 @@ public: SourceLocation getLocation(const FileEntry *SourceFile, unsigned Line, unsigned Col) const; + /// \brief Determines the order of 2 source locations in the translation unit. + /// + /// \returns true if LHS source location comes before RHS, false otherwise. + bool isBeforeInTranslationUnit(SourceLocation LHS, SourceLocation RHS) const; + // Iterators over FileInfos. typedef llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> ::const_iterator fileinfo_iterator; |