[clang] [CIR] Support for static variables (PR #143980)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Thu Jun 12 15:20:38 PDT 2025
================
@@ -208,8 +208,25 @@ void CIRGenFunction::emitVarDecl(const VarDecl &d) {
if (d.hasExternalStorage())
return;
- if (d.getStorageDuration() != SD_Automatic)
- cgm.errorNYI(d.getSourceRange(), "emitVarDecl automatic storage duration");
+ if (d.getStorageDuration() != SD_Automatic) {
+ // Static sampler variables translated to function calls.
+ if (d.getType()->isSamplerT()) {
+ // Nothing needs to be done here, but let's flag it as an error until we
+ // have a test. It requires OpenCL support.
+ cgm.errorNYI(d.getSourceRange(), "emitVarDecl static sampler type");
+ return;
+ }
+
+ cir::GlobalLinkageKind linkage =
+ cgm.getCIRLinkageVarDefinition(&d, /*IsConstant=*/false);
+
+ // FIXME: We need to force the emission/use of a guard variable for
----------------
erichkeane wrote:
is this a 'real' fixme from the existing source, or should we have a 'not implemented' or something here?
https://github.com/llvm/llvm-project/pull/143980
More information about the cfe-commits
mailing list