From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Fri, 8 Sep 2023 00:42:17 +0200 Subject: [PATCH] [clang] Add -fvisibility-inlines-hidden-function-templates --- clang/include/clang/Basic/LangOptions.def | 3 +++ clang/include/clang/Driver/Options.td | 6 ++++++ clang/lib/AST/Decl.cpp | 18 ++++++++++++------ clang/lib/Driver/ToolChains/Clang.cpp | 2 ++ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/clang/include/clang/Basic/LangOptions.def b/clang/include/clang/Basic/LangOptions.def index 4942dcaa086e..677ad6273e3a 100644 --- a/clang/include/clang/Basic/LangOptions.def +++ b/clang/include/clang/Basic/LangOptions.def @@ -310,6 +310,9 @@ BENIGN_LANGOPT(IgnoreXCOFFVisibility, 1, 0, "All the visibility attributes that BENIGN_LANGOPT(VisibilityInlinesHiddenStaticLocalVar, 1, 0, "hidden visibility for static local variables in inline C++ " "methods when -fvisibility-inlines hidden is enabled") +BENIGN_LANGOPT(VisibilityInlinesHiddenFunctionTemplate, 1, 0, + "hidden visibility for implicitly instantiated C++ function " + "templates when -fvisibility-inlines-hidden is enabled") ENUM_LANGOPT(GlobalAllocationFunctionVisibility, VisibilityForcedKinds, 3, VisibilityForcedKinds::ForceDefault, "How to apply visibility to global operator new and delete declarations") LANGOPT(NewInfallible , 1, 0, "Treats throwing global C++ operator new as always returning valid memory (annotates with __attribute__((returns_nonnull)) and throw()). This is detectable in source.") diff --git a/clang/include/clang/Driver/Options.td b/clang/include/clang/Driver/Options.td index 175bedbfb4d0..7cc661956e3a 100644 --- a/clang/include/clang/Driver/Options.td +++ b/clang/include/clang/Driver/Options.td @@ -3918,6 +3918,12 @@ defm visibility_inlines_hidden_static_local_var : BoolFOption<"visibility-inline NegFlag, BothFlags< [], [ClangOption, CC1Option]>>; +defm visibility_inlines_hidden_function_template : BoolFOption<"visibility-inlines-hidden-function-template", + LangOpts<"VisibilityInlinesHiddenFunctionTemplate">, DefaultFalse, + PosFlag