Skip to content

Commit f1b559d

Browse files
jansvoboda11ronlieb
andcommitted
[clang] Invert condition refactored in llvm#160935 (llvm#161583)
The PR llvm#160935 incorrectly replaced `llvm::sys::fs::getUniqueID()` with `llvm::vfs::FileSystem::exists()` in a condition. That's incorrect, since the first function returns `std::error_code` that evaluates to `true` when there is an error (file doesn't exist), while the new code does the opposite. This PR fixes that issue by inverting the conditional. Co-authored-by: ronlieb <ron.lieberman@amd.com>
1 parent 8362ffa commit f1b559d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ static llvm::TargetRegionEntryInfo getEntryInfoFromPresumedLoc(
15661566
SourceManager &SM = CGM.getContext().getSourceManager();
15671567
PresumedLoc PLoc = SM.getPresumedLoc(BeginLoc);
15681568

1569-
if (CGM.getFileSystem()->exists(PLoc.getFilename()))
1569+
if (!CGM.getFileSystem()->exists(PLoc.getFilename()))
15701570
PLoc = SM.getPresumedLoc(BeginLoc, /*UseLineDirectives=*/false);
15711571

15721572
return std::pair<std::string, uint64_t>(PLoc.getFilename(), PLoc.getLine());

0 commit comments

Comments
 (0)