From: Sean Callanan Date: Thu, 30 Apr 2015 00:44:21 +0000 (+0000) Subject: Use a more reliable method to determine whether X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4239eb2a598fd0c1765cf909b23b8eb2003a4f40;p=clang Use a more reliable method to determine whether a FileID corresponds to a real file or to a memory buffer. The old method didn't work when Clang was built Release, which meant it wasn't a very good method at all. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@236188 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/ASTImporter.cpp b/lib/AST/ASTImporter.cpp index c75eba696c..911f1681ce 100644 --- a/lib/AST/ASTImporter.cpp +++ b/lib/AST/ASTImporter.cpp @@ -5643,8 +5643,7 @@ FileID ASTImporter::Import(FileID FromID) { // Map the FileID for to the "to" source manager. FileID ToID; const SrcMgr::ContentCache *Cache = FromSLoc.getFile().getContentCache(); - if (Cache->OrigEntry && - Cache->OrigEntry->getUniqueID() != llvm::sys::fs::UniqueID()) { + if (Cache->OrigEntry && Cache->OrigEntry->getDir()) { // FIXME: We probably want to use getVirtualFile(), so we don't hit the // disk again // FIXME: We definitely want to re-use the existing MemoryBuffer, rather