llvm-project/clang/lib/Frontend
Petr Hosek 821b38f526 [Sema] Provide -fvisibility-global-new-delete-hidden option
When the global new and delete operators aren't declared, Clang
provides and implicit declaration, but this declaration currently
always uses the default visibility. This is a problem when the
C++ library itself is being built with non-default visibility because
the implicit declaration will force the new and delete operators to
have the default visibility unlike the rest of the library.

The existing workaround is to use assembly to enforce the visiblity:
https://fuchsia.googlesource.com/zircon/+/master/system/ulib/zxcpp/new.cpp#108
but that solution is not always available, e.g. in the case of of
libFuzzer which is using an internal version of libc++ that's also built
with -fvisibility=hidden where the existing behavior is causing issues.

This change introduces a new option -fvisibility-global-new-delete-hidden
which makes the implicit declaration of the global new and delete
operators hidden.

Differential Revision: https://reviews.llvm.org/D53787

llvm-svn: 348234
2018-12-04 03:25:25 +00:00
..
Rewrite Pass the function type instead of the return type to FunctionDecl::Create 2018-11-11 00:56:15 +00:00
ASTConsumers.cpp [Frontend] Delete -print-decl-contexts 2018-10-03 03:50:44 +00:00
ASTMerge.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
ASTUnit.cpp NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
CMakeLists.txt Use special new Clang flag 'FrontendTimesIsEnabled' instead of 'llvm::TimePassesIsEnabled' inside -ftime-report feature. 2018-04-23 09:22:30 +00:00
CacheTokens.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
ChainedDiagnosticConsumer.cpp
ChainedIncludesSource.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
CodeGenOptions.cpp Use an enum value instead of a string. 2018-01-18 00:20:03 +00:00
CompilerInstance.cpp Sink BuryPointer from Clang into LLVM for reuse there 2018-11-17 18:04:13 +00:00
CompilerInvocation.cpp [Sema] Provide -fvisibility-global-new-delete-hidden option 2018-12-04 03:25:25 +00:00
CreateInvocationFromCommandLine.cpp Revert "Make clang-based tools find libc++ on MacOS" 2018-11-12 16:59:50 +00:00
DependencyFile.cpp Add a callback for `__has_include` and use it for dependency scanning. 2018-09-18 23:27:02 +00:00
DependencyGraph.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
DiagnosticRenderer.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-26 22:16:28 +00:00
FrontendAction.cpp Sink BuryPointer from Clang into LLVM for reuse there 2018-11-17 18:04:13 +00:00
FrontendActions.cpp [Frontend] Delete -print-decl-contexts 2018-10-03 03:50:44 +00:00
FrontendOptions.cpp [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-26 21:45:04 +00:00
FrontendTiming.cpp Use special new Clang flag 'FrontendTimesIsEnabled' instead of 'llvm::TimePassesIsEnabled' inside -ftime-report feature. 2018-04-23 09:22:30 +00:00
HeaderIncludeGen.cpp [clang-cl] Print /showIncludes to stderr, if used in combination with /E, /EP or /P 2018-05-04 15:58:31 +00:00
InitHeaderSearch.cpp Add Hurd target to Clang driver (2/2) 2018-11-29 03:49:14 +00:00
InitPreprocessor.cpp [c++20] Implement P0482R6: enable -fchar8_t by default in C++20 mode. 2018-11-14 21:04:34 +00:00
LangStandards.cpp Don't accept -std= values that would switch us to a different source language. 2017-04-26 23:44:33 +00:00
LayoutOverrideSource.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
LogDiagnosticPrinter.cpp
ModuleDependencyCollector.cpp [VFS] Remove 'ignore-non-existent-contents' attribute for YAML-based VFS. 2018-10-24 22:39:38 +00:00
MultiplexConsumer.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
PCHContainerOperations.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
PrecompiledPreamble.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
PrintPreprocessedOutput.cpp Fix combining pragma __debug dump & parser_crash with -E 2018-11-15 03:04:21 +00:00
SerializedDiagnosticPrinter.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
SerializedDiagnosticReader.cpp [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-26 21:45:04 +00:00
TestModuleFileExtension.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
TestModuleFileExtension.h
TextDiagnostic.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
TextDiagnosticBuffer.cpp [Frontend] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2018-03-22 00:53:26 +00:00
TextDiagnosticPrinter.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
VerifyDiagnosticConsumer.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00