diff options
author | John McCall <rjmccall@apple.com> | 2012-01-29 01:20:30 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-01-29 01:20:30 +0000 |
commit | 4188760f6bb20f91c6883dffd89204419f852dee (patch) | |
tree | 75f3d71f39ec6a83537a33904c5abfa8a7115133 /include | |
parent | de2fdc249e9c04757a7aaec029b231f4d7e6dbd7 (diff) |
Complain about attempts to use 'protected' visibility on targets
like Darwin that don't support it. We should also complain about
invalid -fvisibility=protected, but that information doesn't seem
to exist at the most appropriate time, so I've left a FIXME behind.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 3 | ||||
-rw-r--r-- | include/clang/Basic/TargetInfo.h | 13 |
2 files changed, 16 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index 948236edc6..7888ce555c 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -1740,6 +1740,9 @@ def warn_transparent_union_attribute_zero_fields : Warning< def warn_attribute_type_not_supported : Warning< "'%0' attribute argument not supported: %1">; def warn_attribute_unknown_visibility : Warning<"unknown visibility '%0'">; +def warn_attribute_protected_visibility : + Warning<"target does not support 'protected' visibility; using 'default'">, + InGroup<DiagGroup<"unsupported-visibility">>; def err_unknown_machine_mode : Error<"unknown machine mode %0">; def err_unsupported_machine_mode : Error<"unsupported machine mode %0">; def err_mode_not_primitive : Error< diff --git a/include/clang/Basic/TargetInfo.h b/include/clang/Basic/TargetInfo.h index b1e1cbdf66..966797c4ff 100644 --- a/include/clang/Basic/TargetInfo.h +++ b/include/clang/Basic/TargetInfo.h @@ -479,6 +479,19 @@ public: const unsigned RegNum; }; + /// hasProtectedVisibility - Does this target support "protected" + /// visibility? + /// + /// Any target which dynamic libraries will naturally support + /// something like "default" (meaning that the symbol is visible + /// outside this shared object) and "hidden" (meaning that it isn't) + /// visibilities, but "protected" is really an ELF-specific concept + /// with wierd semantics designed around the convenience of dynamic + /// linker implementations. Which is not to suggest that there's + /// consistent target-independent semantics for "default" visibility + /// either; the entire thing is pretty badly mangled. + virtual bool hasProtectedVisibility() const { return true; } + virtual bool useGlobalsForAutomaticVariables() const { return false; } /// getCFStringSection - Return the section to use for CFString |