зеркало из https://github.com/microsoft/clang-1.git
The explicit bit in LV already tracks exactly the same information as
DHasExplicitVisibility. Simplify the code a bit. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155099 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
ff2579816b
Коммит
415745474c
|
@ -484,18 +484,14 @@ static LinkageInfo getLVForClassMember(const NamedDecl *D, LVFlags F) {
|
||||||
|
|
||||||
LinkageInfo LV;
|
LinkageInfo LV;
|
||||||
|
|
||||||
bool DHasExplicitVisibility = false;
|
|
||||||
// If we have an explicit visibility attribute, merge that in.
|
// If we have an explicit visibility attribute, merge that in.
|
||||||
if (F.ConsiderVisibilityAttributes) {
|
if (F.ConsiderVisibilityAttributes) {
|
||||||
if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility()) {
|
if (llvm::Optional<Visibility> Vis = D->getExplicitVisibility())
|
||||||
LV.mergeVisibility(*Vis, true);
|
LV.mergeVisibility(*Vis, true);
|
||||||
|
|
||||||
DHasExplicitVisibility = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Ignore both global visibility and attributes when computing our
|
// Ignore both global visibility and attributes when computing our
|
||||||
// parent's visibility if we already have an explicit one.
|
// parent's visibility if we already have an explicit one.
|
||||||
LVFlags ClassF = DHasExplicitVisibility ?
|
LVFlags ClassF = LV.visibilityExplicit() ?
|
||||||
LVFlags::CreateOnlyDeclLinkage() : F;
|
LVFlags::CreateOnlyDeclLinkage() : F;
|
||||||
|
|
||||||
// If we're paying attention to global visibility, apply
|
// If we're paying attention to global visibility, apply
|
||||||
|
|
Загрузка…
Ссылка в новой задаче