Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC][hwasan] Do not include sanitizer_placement_new.h in header files #82993

Merged
merged 1 commit into from
Feb 26, 2024

Conversation

Enna1
Copy link
Contributor

@Enna1 Enna1 commented Feb 26, 2024

Do not include sanitizer_placement_new.h into header files, only into source files.

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 26, 2024

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Enna1 (Enna1)

Changes

Do not include sanitizer_placement_new.h into header files, only into source files.


Full diff: https://github.com/llvm/llvm-project/pull/82993.diff

3 Files Affected:

  • (modified) compiler-rt/lib/hwasan/hwasan_report.cpp (+1)
  • (modified) compiler-rt/lib/hwasan/hwasan_thread_list.cpp (+1)
  • (modified) compiler-rt/lib/hwasan/hwasan_thread_list.h (-1)
diff --git a/compiler-rt/lib/hwasan/hwasan_report.cpp b/compiler-rt/lib/hwasan/hwasan_report.cpp
index 016ec182dea0fd..9fbf38ae6a1f48 100644
--- a/compiler-rt/lib/hwasan/hwasan_report.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_report.cpp
@@ -27,6 +27,7 @@
 #include "sanitizer_common/sanitizer_flags.h"
 #include "sanitizer_common/sanitizer_internal_defs.h"
 #include "sanitizer_common/sanitizer_mutex.h"
+#include "sanitizer_common/sanitizer_placement_new.h"
 #include "sanitizer_common/sanitizer_report_decorator.h"
 #include "sanitizer_common/sanitizer_stackdepot.h"
 #include "sanitizer_common/sanitizer_stacktrace_printer.h"
diff --git a/compiler-rt/lib/hwasan/hwasan_thread_list.cpp b/compiler-rt/lib/hwasan/hwasan_thread_list.cpp
index 7df4dd3d785181..e56d19aad26738 100644
--- a/compiler-rt/lib/hwasan/hwasan_thread_list.cpp
+++ b/compiler-rt/lib/hwasan/hwasan_thread_list.cpp
@@ -1,5 +1,6 @@
 #include "hwasan_thread_list.h"
 
+#include "sanitizer_common/sanitizer_placement_new.h"
 #include "sanitizer_common/sanitizer_thread_arg_retval.h"
 
 namespace __hwasan {
diff --git a/compiler-rt/lib/hwasan/hwasan_thread_list.h b/compiler-rt/lib/hwasan/hwasan_thread_list.h
index 82f6c70a03f808..d0eebd1b373a37 100644
--- a/compiler-rt/lib/hwasan/hwasan_thread_list.h
+++ b/compiler-rt/lib/hwasan/hwasan_thread_list.h
@@ -47,7 +47,6 @@
 #include "hwasan_allocator.h"
 #include "hwasan_flags.h"
 #include "hwasan_thread.h"
-#include "sanitizer_common/sanitizer_placement_new.h"
 #include "sanitizer_common/sanitizer_thread_arg_retval.h"
 
 namespace __hwasan {

@Enna1 Enna1 force-pushed the users/Enna1/hwasan-nfc-placement-new-header branch from 6244304 to b29c7a7 Compare February 26, 2024 13:25
@Enna1 Enna1 changed the title [NFC][hwasan] Move sanitizer_placement_new.h from header files into source files [NFC][hwasan] Do not include sanitizer_placement_new.h in header files Feb 26, 2024
Copy link
Member

@MaskRay MaskRay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The file comment discourages inclusion into header files.

@vitalybuka vitalybuka merged commit 371e6d0 into main Feb 26, 2024
4 checks passed
@vitalybuka vitalybuka deleted the users/Enna1/hwasan-nfc-placement-new-header branch February 26, 2024 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants