diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Frontend/CompilerInvocation.cpp | 4 | ||||
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 3 |
3 files changed, 3 insertions, 7 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 40e18e6e350..a1e4511ada6 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -539,8 +539,7 @@ void CodeGenModule::Release() { if (LangOpts.OpenCL) { EmitOpenCLMetadata(); // Emit SPIR version. - if (getTriple().getArch() == llvm::Triple::spir || - getTriple().getArch() == llvm::Triple::spir64) { + if (getTriple().isSPIR()) { // SPIR v2.0 s2.12 - The SPIR version used by the module is stored in the // opencl.spir.version named metadata. llvm::Metadata *SPIRVerElts[] = { diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 12846b18c07..ca95dec1618 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3349,10 +3349,8 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, Res.getFrontendOpts().ProgramAction); // Turn on -Wspir-compat for SPIR target. - auto Arch = T.getArch(); - if (Arch == llvm::Triple::spir || Arch == llvm::Triple::spir64) { + if (T.isSPIR()) Res.getDiagnosticOpts().Warnings.push_back("spir-compat"); - } // If sanitizer is enabled, disable OPT_ffine_grained_bitfield_accesses. if (Res.getCodeGenOpts().FineGrainedBitfieldAccesses && diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 5aa2ea3fba1..cc479dd010f 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -1072,8 +1072,7 @@ static void InitializePredefinedMacros(const TargetInfo &TI, Builder.defineMacro(#Ext); #include "clang/Basic/OpenCLExtensions.def" - auto Arch = TI.getTriple().getArch(); - if (Arch == llvm::Triple::spir || Arch == llvm::Triple::spir64) + if (TI.getTriple().isSPIR()) Builder.defineMacro("__IMAGE_SUPPORT__"); } |