Skip to content

Commit 8af1bc7

Browse files
sarnexfrederik-h
authored andcommitted
[clang][NFCI] Fix getGridValues for unsupported targets (llvm#131023)
I broke this in llvm@f3cd223, I should have added this to the `SPIRV64` subclass, but I accidentally added it to base `TargetInfo`. Using an unsupported target should error in the driver way before this though. Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 92bf30b commit 8af1bc7

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

clang/include/clang/Basic/TargetInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1675,7 +1675,7 @@ class TargetInfo : public TransferrableTargetInfo,
16751675
// access target-specific GPU grid values that must be consistent between
16761676
// host RTL (plugin), deviceRTL and clang.
16771677
virtual const llvm::omp::GV &getGridValue() const {
1678-
return llvm::omp::SPIRVGridValues;
1678+
llvm_unreachable("getGridValue not implemented on this target");
16791679
}
16801680

16811681
/// Retrieve the name of the platform as it is used in the

clang/lib/Basic/Targets/SPIR.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,10 @@ class LLVM_LIBRARY_VISIBILITY SPIRV64TargetInfo : public BaseSPIRVTargetInfo {
370370

371371
void getTargetDefines(const LangOptions &Opts,
372372
MacroBuilder &Builder) const override;
373+
374+
const llvm::omp::GV &getGridValue() const override {
375+
return llvm::omp::SPIRVGridValues;
376+
}
373377
};
374378

375379
class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final

0 commit comments

Comments
 (0)