r236188 - Use a more reliable method to determine whether
Sean Callanan
scallanan at apple.com
Wed Apr 29 17:44:21 PDT 2015
Author: spyffe
Date: Wed Apr 29 19:44:21 2015
New Revision: 236188
URL: http://llvm.org/viewvc/llvm-project?rev=236188&view=rev
Log:
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.
Modified:
cfe/trunk/lib/AST/ASTImporter.cpp
Modified: cfe/trunk/lib/AST/ASTImporter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTImporter.cpp?rev=236188&r1=236187&r2=236188&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTImporter.cpp (original)
+++ cfe/trunk/lib/AST/ASTImporter.cpp Wed Apr 29 19:44:21 2015
@@ -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
More information about the cfe-commits
mailing list