[cfe-commits] r125679 - /cfe/trunk/lib/Basic/SourceManager.cpp
Douglas Gregor
dgregor at apple.com
Wed Feb 16 11:09:24 PST 2011
Author: dgregor
Date: Wed Feb 16 13:09:24 2011
New Revision: 125679
URL: http://llvm.org/viewvc/llvm-project?rev=125679&view=rev
Log:
Fix a thinko with llvm::Optional, which is clearly the most dangerous class template in the universe
Modified:
cfe/trunk/lib/Basic/SourceManager.cpp
Modified: cfe/trunk/lib/Basic/SourceManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/SourceManager.cpp?rev=125679&r1=125678&r2=125679&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/SourceManager.cpp (original)
+++ cfe/trunk/lib/Basic/SourceManager.cpp Wed Feb 16 13:09:24 2011
@@ -1156,10 +1156,14 @@
SourceFileName = llvm::sys::path::filename(SourceFile->getName());
if (*SourceFileName == llvm::sys::path::filename(MainFile->getName())) {
SourceFileInode = getActualFileInode(SourceFile);
- if (SourceFileInode &&
- *SourceFileInode == getActualFileInode(MainFile)) {
- FirstFID = MainFileID;
- SourceFile = MainFile;
+ if (SourceFileInode) {
+ if (llvm::Optional<ino_t> MainFileInode
+ = getActualFileInode(MainFile)) {
+ if (*SourceFileInode == *MainFileInode) {
+ FirstFID = MainFileID;
+ SourceFile = MainFile;
+ }
+ }
}
}
}
More information about the cfe-commits
mailing list