diff options
author | Sean Callanan <scallanan@apple.com> | 2015-04-30 00:44:21 +0000 |
---|---|---|
committer | Sean Callanan <scallanan@apple.com> | 2015-04-30 00:44:21 +0000 |
commit | 25d34af88a88721915a430150ecb45eaf561ce4f (patch) | |
tree | 59cbc8a9109e61a200a70230eb042c541eaa81b7 /clang/lib | |
parent | b8cbb2678ff93dfa32b4dae4a2f4bbb1c1e2f34c (diff) | |
download | bcm5719-llvm-25d34af88a88721915a430150ecb45eaf561ce4f.tar.gz bcm5719-llvm-25d34af88a88721915a430150ecb45eaf561ce4f.zip |
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.
llvm-svn: 236188
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/AST/ASTImporter.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/lib/AST/ASTImporter.cpp b/clang/lib/AST/ASTImporter.cpp index c75eba696cc..911f1681ce6 100644 --- a/clang/lib/AST/ASTImporter.cpp +++ b/clang/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 |