https://github.com/DKLoehr closed
https://github.com/llvm/llvm-project/pull/143537
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
https://github.com/zmodem approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/143537
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
https://github.com/DKLoehr updated
https://github.com/llvm/llvm-project/pull/143537
>From 8ff6b6828604b25ded852adba37dd82e5cf7f771 Mon Sep 17 00:00:00 2001
From: Devon Loehr
Date: Tue, 10 Jun 2025 13:57:06 +
Subject: [PATCH 1/3] Enable UOD warning for windows
---
clang/include/clang/Basic
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
https://github.com/DKLoehr updated
https://github.com/llvm/llvm-project/pull/143537
>From 8ff6b6828604b25ded852adba37dd82e5cf7f771 Mon Sep 17 00:00:00 2001
From: Devon Loehr
Date: Tue, 10 Jun 2025 13:57:06 +
Subject: [PATCH 1/2] Enable UOD warning for windows
---
clang/include/clang/Basic
@@ -825,13 +827,15 @@ The warning can be resolved by removing one of the
conditions above. In rough
order of preference, this may be done by:
1. Marking the object ``const`` (if possible)
2. Moving the object's definition to a source file
-3. Giving the object non-hidden visib
@@ -806,7 +806,9 @@ def UniqueObjectDuplication :
DiagGroup<"unique-object-duplication"> {
Warns when objects which are supposed to be globally unique might get
duplicated
when built into a shared library.
-If an object with hidden visibility is built into a shared library,
@@ -13518,8 +13518,29 @@ bool
Sema::GloballyUniqueObjectMightBeAccidentallyDuplicated(
// If the object isn't hidden, the dynamic linker will prevent duplication.
clang::LinkageInfo Lnk = Target->getLinkageAndVisibility();
- if (Lnk.getVisibility() != HiddenVisibility)
+
https://github.com/DKLoehr updated
https://github.com/llvm/llvm-project/pull/143537
>From 8ff6b6828604b25ded852adba37dd82e5cf7f771 Mon Sep 17 00:00:00 2001
From: Devon Loehr
Date: Tue, 10 Jun 2025 13:57:06 +
Subject: [PATCH 1/2] Enable UOD warning for windows
---
clang/include/clang/Basic
https://github.com/DKLoehr created
https://github.com/llvm/llvm-project/pull/143537
Followup to #125526. This expands the logic of the unique-object-duplication
warning so that it also works for windows code.
For the most part, the logic is unchanged, merely substituting "has no
import/export
DKLoehr wrote:
@zmodem, @nico
https://github.com/llvm/llvm-project/pull/143537
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
llvmbot wrote:
@llvm/pr-subscribers-clang
Author: Devon Loehr (DKLoehr)
Changes
Followup to #125526. This expands the logic of the
unique-object-duplication warning so that it also works for windows code.
For the most part, the logic is unchanged, merely substituting "has no
import/expo
19 matches
Mail list logo