Skip to content

Commit

Permalink
Work around two more instances of __noinline__ conflicts. (llvm#66138)
Browse files Browse the repository at this point in the history
Fixes llvm#57544

(cherry picked from commit 588023d)
  • Loading branch information
Artem-B authored and tru committed Sep 29, 2023
1 parent 9da5b7a commit 87ec1f4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang/lib/Headers/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ set(cuda_wrapper_files

set(cuda_wrapper_bits_files
cuda_wrappers/bits/shared_ptr_base.h
cuda_wrappers/bits/basic_string.h
cuda_wrappers/bits/basic_string.tcc
)

set(ppc_wrapper_files
Expand Down
9 changes: 9 additions & 0 deletions clang/lib/Headers/cuda_wrappers/bits/basic_string.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// CUDA headers define __noinline__ which interferes with libstdc++'s use of
// `__attribute((__noinline__))`. In order to avoid compilation error,
// temporarily unset __noinline__ when we include affected libstdc++ header.

#pragma push_macro("__noinline__")
#undef __noinline__
#include_next "bits/basic_string.h"

#pragma pop_macro("__noinline__")
9 changes: 9 additions & 0 deletions clang/lib/Headers/cuda_wrappers/bits/basic_string.tcc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// CUDA headers define __noinline__ which interferes with libstdc++'s use of
// `__attribute((__noinline__))`. In order to avoid compilation error,
// temporarily unset __noinline__ when we include affected libstdc++ header.

#pragma push_macro("__noinline__")
#undef __noinline__
#include_next "bits/basic_string.tcc"

#pragma pop_macro("__noinline__")

0 comments on commit 87ec1f4

Please sign in to comment.