From 746d474b28e4df3becec7fbde42d3732f94d7c33 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 18 Nov 2008 06:51:15 +0000 Subject: SourceManager::getLineNumber is logically const except for caching. Use mutable to make it so. llvm-svn: 59498 --- clang/lib/Basic/SourceManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib') diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp index b8b72878f52..44a6d66c1a6 100644 --- a/clang/lib/Basic/SourceManager.cpp +++ b/clang/lib/Basic/SourceManager.cpp @@ -238,7 +238,7 @@ static void ComputeLineNumbers(ContentCache* FI) { /// for the position indicated. This requires building and caching a table of /// line offsets for the MemoryBuffer, so this is not cheap: use only when /// about to emit a diagnostic. -unsigned SourceManager::getLineNumber(SourceLocation Loc) { +unsigned SourceManager::getLineNumber(SourceLocation Loc) const { unsigned FileID = Loc.getFileID(); if (FileID == 0) return 0; -- cgit v1.2.3