[PATCH] D19478: Remove assert mandating you can only use SPIR target with OpenCL

Neil Henning via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 03:38:10 PDT 2016


sheredom created this revision.
sheredom added reviewers: Anastasia, yaxunl, pxli168.
sheredom added a subscriber: cfe-commits.

Remove an assert mandating that OpenCL must be used with the SPIR target. We need to be able to use the SPIR target with non-OpenCL inputs, which worked perfectly well until commit 264241 introduced an assert that requires OpenCL be set in LangOpts.

http://reviews.llvm.org/D19478

Files:
  lib/CodeGen/TargetInfo.cpp

Index: lib/CodeGen/TargetInfo.cpp
===================================================================
--- lib/CodeGen/TargetInfo.cpp
+++ lib/CodeGen/TargetInfo.cpp
@@ -7390,7 +7390,6 @@
 /// Emit SPIR specific metadata: OpenCL and SPIR version.
 void SPIRTargetCodeGenInfo::emitTargetMD(const Decl *D, llvm::GlobalValue *GV,
                                          CodeGen::CodeGenModule &CGM) const {
-  assert(CGM.getLangOpts().OpenCL && "SPIR is only for OpenCL");
   llvm::LLVMContext &Ctx = CGM.getModule().getContext();
   llvm::Type *Int32Ty = llvm::Type::getInt32Ty(Ctx);
   llvm::Module &M = CGM.getModule();


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19478.54828.patch
Type: text/x-patch
Size: 620 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160425/43ac90eb/attachment.bin>


More information about the cfe-commits mailing list