Skip to content

Commit 39410df

Browse files
[clang] Invert condition refactored in #160935 (#161583)
The PR #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 <[email protected]>
1 parent 1a85027 commit 39410df

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

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

1545-
if (CGM.getFileSystem()->exists(PLoc.getFilename()))
1545+
if (!CGM.getFileSystem()->exists(PLoc.getFilename()))
15461546
PLoc = SM.getPresumedLoc(BeginLoc, /*UseLineDirectives=*/false);
15471547

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

clang/test/OpenMP/amdgcn_save_temps.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11

22
// REQUIRES: amdgpu-registered-target
33

4-
// XFAIL: *
5-
64
// RUN: %clang_cc1 -E -fopenmp -x c -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -save-temps=cwd %s -o %t-openmp-amdgcn-amd-amdhsa-gfx90a.i
75
// RUN: %clang_cc1 -fopenmp -x c -triple x86_64-unknown-unknown -fopenmp-targets=amdgcn-amd-amdhsa -save-temps=cwd -emit-llvm-bc %s -o %t-x86_64-unknown-unknown.bc
86
// RUN: %clang_cc1 -fopenmp -x c -triple amdgcn-amd-amdhsa -fopenmp-targets=amdgcn-amd-amdhsa -save-temps=cwd -emit-llvm -fopenmp-is-target-device -x cpp-output %t-openmp-amdgcn-amd-amdhsa-gfx90a.i -fopenmp-host-ir-file-path %t-x86_64-unknown-unknown.bc -o - | FileCheck %s

0 commit comments

Comments
 (0)