[cfe-commits] r140055 - /cfe/trunk/include/clang/Basic/SourceManager.h

Argyrios Kyrtzidis akyrtzi at gmail.com
Mon Sep 19 13:40:05 PDT 2011


Author: akirtzidis
Date: Mon Sep 19 15:40:05 2011
New Revision: 140055

URL: http://llvm.org/viewvc/llvm-project?rev=140055&view=rev
Log:
Introduce isLoadedSourceLocation() and isLocalSourceLocation() methods in SourceManager.

Modified:
    cfe/trunk/include/clang/Basic/SourceManager.h

Modified: cfe/trunk/include/clang/Basic/SourceManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/SourceManager.h?rev=140055&r1=140054&r2=140055&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/SourceManager.h (original)
+++ cfe/trunk/include/clang/Basic/SourceManager.h Mon Sep 19 15:40:05 2011
@@ -1223,6 +1223,16 @@
   std::pair<int, unsigned>
   AllocateLoadedSLocEntries(unsigned NumSLocEntries, unsigned TotalSize);
 
+  /// \brief Returns true if \arg Loc came from a PCH/Module.
+  bool isLoadedSourceLocation(SourceLocation Loc) const {
+    return Loc.getOffset() >= CurrentLoadedOffset;
+  }
+
+  /// \brief Returns true if \arg Loc did not come from a PCH/Module.
+  bool isLocalSourceLocation(SourceLocation Loc) const {
+    return Loc.getOffset() < NextLocalOffset;
+  }
+
 private:
   const llvm::MemoryBuffer *getFakeBufferForRecovery() const;
 





More information about the cfe-commits mailing list