From 47b2ed2e166ddf3135f76d3d2d13374d91d9d1b0 Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 7 Sep 2018 14:50:25 +0000 Subject: [PATCH] Revert "[OPENMP][NVPTX] Disable runtime-type info for CUDA devices." Still need the RTTI for NVPTX target to pass sema checks. llvm-svn: 341668 --- clang/lib/Frontend/CompilerInvocation.cpp | 5 -- clang/test/OpenMP/nvptx_target_rtti_messages.cpp | 68 ------------------------ 2 files changed, 73 deletions(-) delete mode 100644 clang/test/OpenMP/nvptx_target_rtti_messages.cpp diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index 2a05d6f..aea8106 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2648,11 +2648,6 @@ static void ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, 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)) { diff --git a/clang/test/OpenMP/nvptx_target_rtti_messages.cpp b/clang/test/OpenMP/nvptx_target_rtti_messages.cpp deleted file mode 100644 index 8e2819e..0000000 --- a/clang/test/OpenMP/nvptx_target_rtti_messages.cpp +++ /dev/null @@ -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 -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 -T FA() { - TemplateClass 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(); - (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 -- 2.7.4