forked from OSchip/llvm-project
[Clang][NewPM] Don't bail out if the target machine is empty
This matches the behavior of the old pass manager. There are some targets that don't have target machine at all (e.g. le32, spir) which whose tests would never run with new pass manager. Similarly, we would need to disable tests for targets that are disabled. Differential Revision: https://reviews.llvm.org/D58374 llvm-svn: 360100
This commit is contained in:
parent
2ea088173d
commit
5f2e10e9c3
|
@ -965,13 +965,15 @@ void EmitAssemblyHelper::EmitAssemblyWithNewPassManager(
|
||||||
TimeRegion Region(FrontendTimesIsEnabled ? &CodeGenerationTime : nullptr);
|
TimeRegion Region(FrontendTimesIsEnabled ? &CodeGenerationTime : nullptr);
|
||||||
setCommandLineOpts(CodeGenOpts);
|
setCommandLineOpts(CodeGenOpts);
|
||||||
|
|
||||||
// The new pass manager always makes a target machine available to passes
|
bool RequiresCodeGen = (Action != Backend_EmitNothing &&
|
||||||
// during construction.
|
Action != Backend_EmitBC &&
|
||||||
CreateTargetMachine(/*MustCreateTM*/ true);
|
Action != Backend_EmitLL);
|
||||||
if (!TM)
|
CreateTargetMachine(RequiresCodeGen);
|
||||||
// This will already be diagnosed, just bail.
|
|
||||||
|
if (RequiresCodeGen && !TM)
|
||||||
return;
|
return;
|
||||||
TheModule->setDataLayout(TM->createDataLayout());
|
if (TM)
|
||||||
|
TheModule->setDataLayout(TM->createDataLayout());
|
||||||
|
|
||||||
Optional<PGOOptions> PGOOpt;
|
Optional<PGOOptions> PGOOpt;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
// RUN: %clang_cc1 -O0 -triple spir -emit-llvm %s -o - | FileCheck %s
|
// RUN: %clang_cc1 -O0 -triple spir -emit-llvm %s -o - | FileCheck %s
|
||||||
// RUN: %clang_cc1 -O0 -triple spir64 -emit-llvm %s -o - | FileCheck %s
|
// RUN: %clang_cc1 -O0 -triple spir64 -emit-llvm %s -o - | FileCheck %s
|
||||||
|
// RUN: %clang_cc1 -O0 -triple spir -fexperimental-new-pass-manager -emit-llvm %s -o - | FileCheck %s
|
||||||
|
// RUN: %clang_cc1 -O0 -triple spir64 -fexperimental-new-pass-manager -emit-llvm %s -o - | FileCheck %s
|
||||||
|
|
||||||
// This file tests that using the _Float16 type with the spir target will not
|
// This file tests that using the _Float16 type with the spir target will not
|
||||||
// use the llvm intrinsics but instead will use the half arithmetic
|
// use the llvm intrinsics but instead will use the half arithmetic
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// RUN: %clang -target le32-unknown-nacl -### %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
|
// RUN: %clang -target le32-unknown-nacl -### %s -emit-llvm-only -c 2>&1 | FileCheck %s -check-prefix=ECHO
|
||||||
// RUN: %clang -target le32-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
|
// RUN: %clang -target le32-unknown-nacl %s -emit-llvm -S -c -o - | FileCheck %s
|
||||||
|
// RUN: %clang -target le32-unknown-nacl -fexperimental-new-pass-manager %s -emit-llvm -S -c -o - | FileCheck %s
|
||||||
// RUN: %clang -target le32-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
|
// RUN: %clang -target le32-unknown-nacl %s -emit-llvm -S -c -pthread -o - | FileCheck %s -check-prefix=THREADS
|
||||||
|
|
||||||
// ECHO: {{.*}} "-cc1" {{.*}}le32-unknown-nacl.c
|
// ECHO: {{.*}} "-cc1" {{.*}}le32-unknown-nacl.c
|
||||||
|
|
Loading…
Reference in New Issue