r341668 - Revert "[OPENMP][NVPTX] Disable runtime-type info for CUDA devices."
Alexey Bataev via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 7 07:50:25 PDT 2018
Author: abataev
Date: Fri Sep 7 07:50:25 2018
New Revision: 341668
URL: http://llvm.org/viewvc/llvm-project?rev=341668&view=rev
Log:
Revert "[OPENMP][NVPTX] Disable runtime-type info for CUDA devices."
Still need the RTTI for NVPTX target to pass sema checks.
Removed:
cfe/trunk/test/OpenMP/nvptx_target_rtti_messages.cpp
Modified:
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=341668&r1=341667&r2=341668&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Sep 7 07:50:25 2018
@@ -2648,11 +2648,6 @@ static void ParseLangArgs(LangOptions &O
Opts.Exceptions = 0;
Opts.CXXExceptions = 0;
}
- // NVPTX does not support RTTI.
- if (Opts.OpenMPIsDevice && T.isNVPTX()) {
- Opts.RTTI = 0;
- Opts.RTTIData = 0;
- }
// Get the OpenMP target triples if any.
if (Arg *A = Args.getLastArg(options::OPT_fopenmp_targets_EQ)) {
Removed: cfe/trunk/test/OpenMP/nvptx_target_rtti_messages.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/OpenMP/nvptx_target_rtti_messages.cpp?rev=341667&view=auto
==============================================================================
--- cfe/trunk/test/OpenMP/nvptx_target_rtti_messages.cpp (original)
+++ cfe/trunk/test/OpenMP/nvptx_target_rtti_messages.cpp (removed)
@@ -1,68 +0,0 @@
-// RUN: %clang_cc1 -fopenmp -x c++ -triple powerpc64le-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm-bc %s -o %t-ppc-host.bc -fexceptions -fcxx-exceptions
-// RUN: %clang_cc1 -verify -fopenmp -x c++ -triple nvptx64-unknown-unknown -fopenmp-targets=nvptx64-nvidia-cuda -emit-llvm %s -fopenmp-is-device -fopenmp-host-ir-file-path %t-ppc-host.bc -o - -ferror-limit 100
-
-#ifndef HEADER
-#define HEADER
-
-namespace std {
- class type_info;
-}
-
-template <typename T>
-class TemplateClass {
- T a;
-public:
- TemplateClass() { (void)typeid(int); } // expected-error {{use of typeid requires -frtti}}
- T f_method() const { return a; }
-};
-
-int foo();
-
-int baz1();
-
-int baz2();
-
-int baz4() { return 5; }
-
-template <typename T>
-T FA() {
- TemplateClass<T> s;
- return s.f_method();
-}
-
-#pragma omp declare target
-struct S {
- int a;
- S(int a) : a(a) { (void)typeid(int); } // expected-error {{use of typeid requires -frtti}}
-};
-
-int foo() { return 0; }
-int b = 15;
-int d;
-#pragma omp end declare target
-int c;
-
-int bar() { return 1 + foo() + bar() + baz1() + baz2(); }
-
-int maini1() {
- int a;
- static long aa = 32;
-#pragma omp target map(tofrom \
- : a, b)
- {
- S s(a);
- static long aaa = 23;
- a = foo() + bar() + b + c + d + aa + aaa + FA<int>();
- (void)typeid(int); // expected-error {{use of typeid requires -frtti}}
- }
- return baz4();
-}
-
-int baz3() { return 2 + baz2(); }
-int baz2() {
-#pragma omp target
- (void)typeid(int); // expected-error {{use of typeid requires -frtti}}
- return 2 + baz3();
-}
-
-#endif // HEADER
More information about the cfe-commits
mailing list