clover/llvm: undefine __IMAGE_SUPPORT__ for devices without image support
[mesa.git] / src / gallium / frontends / clover / llvm / invocation.cpp
index a305299f507d846ba352f8a54d12f72c8633cbdc..173894fa799961ba4eb961bee975d54d4103bbc6 100644 (file)
@@ -300,6 +300,10 @@ namespace {
          compat::add_link_bitcode_file(c.getCodeGenOpts(),
                                        LIBCLC_LIBEXECDIR + dev.ir_target() + ".bc");
 
+      // undefine __IMAGE_SUPPORT__ for device without image support
+      if (!dev.image_support())
+         c.getPreprocessorOpts().addMacroUndef("__IMAGE_SUPPORT__");
+
       // Compile the code
       clang::EmitLLVMOnlyAction act(&ctx);
       if (!c.ExecuteAction(act))