[PATCH] D31406: [clang-tidy] Reuse FileID in getLocation

Chih-Hung Hsieh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 6 13:32:03 PDT 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL299700: [clang-tidy] Reuse FileID in getLocation (authored by chh).

Repository:
  rL LLVM

https://reviews.llvm.org/D31406

Files:
  clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp


Index: clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
===================================================================
--- clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
+++ clang-tools-extra/trunk/clang-tidy/ClangTidy.cpp
@@ -239,7 +239,7 @@
       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);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31406.94431.patch
Type: text/x-patch
Size: 588 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170406/da2c7343/attachment.bin>


More information about the llvm-commits mailing list