aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Basic/SourceManager.cpp2
-rw-r--r--include/clang/Basic/SourceManager.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Basic/SourceManager.cpp b/Basic/SourceManager.cpp
index 4d525fc2bd..96da763451 100644
--- a/Basic/SourceManager.cpp
+++ b/Basic/SourceManager.cpp
@@ -234,7 +234,7 @@ unsigned SourceManager::getColumnNumber(SourceLocation Loc) const {
/// getSourceName - This method returns the name of the file or buffer that
/// the SourceLocation specifies. This can be modified with #line directives,
/// etc.
-const char *SourceManager::getSourceName(SourceLocation Loc) {
+const char *SourceManager::getSourceName(SourceLocation Loc) const {
unsigned FileID = Loc.getFileID();
if (FileID == 0) return "";
return getFileInfo(FileID)->Buffer->getBufferIdentifier();
diff --git a/include/clang/Basic/SourceManager.h b/include/clang/Basic/SourceManager.h
index 825e7dee65..f479b94e5d 100644
--- a/include/clang/Basic/SourceManager.h
+++ b/include/clang/Basic/SourceManager.h
@@ -240,7 +240,7 @@ public:
/// getSourceName - This method returns the name of the file or buffer that
/// the SourceLocation specifies. This can be modified with #line directives,
/// etc.
- const char *getSourceName(SourceLocation Loc);
+ const char *getSourceName(SourceLocation Loc) const;
/// Given a SourceLocation object, return the logical location referenced by
/// the ID. This logical location is subject to #line directives, etc.