forked from OSchip/llvm-project
[clang-tidy] Reuse FileID in getLocation
One FileID per warning will increase and overflow NextLocalOffset when input file is large with many warnings. Reusing FileID avoids this problem. This requires changes in getColumnNumber, D31406, rL299681. Differential Revision: http://reviews.llvm.org/D31406 llvm-svn: 299700
This commit is contained in:
parent
579540a8f7
commit
90fccec5ee
|
@ -239,7 +239,7 @@ private:
|
|||
return SourceLocation();
|
||||
|
||||
const FileEntry *File = SourceMgr.getFileManager().getFile(FilePath);
|
||||
FileID ID = SourceMgr.createFileID(File, SourceLocation(), SrcMgr::C_User);
|
||||
FileID ID = SourceMgr.getOrCreateFileID(File, SrcMgr::C_User);
|
||||
return SourceMgr.getLocForStartOfFile(ID).getLocWithOffset(Offset);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue