diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-20 08:09:57 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2009-06-20 08:09:57 +0000 |
commit | 10b46d2f0b976676d10681d73fe061b5ae409b36 (patch) | |
tree | 1902939e092b9a4b3bfe2e2023d48b54b4a0078b /include/clang/Basic/SourceManager.h | |
parent | 8cff90e1f74ebd5e6ca37c1c96f7f73937bbad23 (diff) |
Introduce SourceManager::getLocation() to get a source location out of a "file:line:column" triplet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73823 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Basic/SourceManager.h')
-rw-r--r-- | include/clang/Basic/SourceManager.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h index 57ae9a4511..bcfb83b894 100644 --- a/include/clang/Basic/SourceManager.h +++ b/include/clang/Basic/SourceManager.h @@ -68,7 +68,12 @@ namespace SrcMgr { /// NumLines - The number of lines in this ContentCache. This is only valid /// if SourceLineCache is non-null. unsigned NumLines; - + + /// FirstFID - First FileID that was created for this ContentCache. + /// Represents the first source inclusion of the file associated with this + /// ContentCache. + mutable FileID FirstFID; + /// getBuffer - Returns the memory buffer for the associated content. const llvm::MemoryBuffer *getBuffer() const; @@ -624,6 +629,13 @@ public: //===--------------------------------------------------------------------===// // Other miscellaneous methods. //===--------------------------------------------------------------------===// + + /// \brief Get the source location for the given file:line:col triplet. + /// + /// If the source file is included multiple times, the source location will + /// be based upon the first inclusion. + SourceLocation getLocation(const FileEntry *SourceFile, + unsigned Line, unsigned Col) const; // Iterators over FileInfos. typedef llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*> |