-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lld][RISCV] Add break to nested switch in mergeAtomic
#99762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This prevent the warnings from compiler.
@llvm/pr-subscribers-lld @llvm/pr-subscribers-lld-elf Author: Brandon Wu (4vtomat) ChangesThis prevent the warnings from compiler. Full diff: https://github.com/llvm/llvm-project/pull/99762.diff 1 Files Affected:
diff --git a/lld/ELF/Arch/RISCV.cpp b/lld/ELF/Arch/RISCV.cpp
index 6af89ce3517b7..56759c28dcf41 100644
--- a/lld/ELF/Arch/RISCV.cpp
+++ b/lld/ELF/Arch/RISCV.cpp
@@ -1131,6 +1131,7 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
case RISCVAttrs::RISCVAtomicAbiTag::A6C:
return;
};
+ break;
case RISCVAtomicAbiTag::A6S:
switch (newTag) {
@@ -1144,6 +1145,7 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
case RISCVAttrs::RISCVAtomicAbiTag::A6S:
return;
};
+ break;
case RISCVAtomicAbiTag::A7:
switch (newTag) {
@@ -1157,6 +1159,7 @@ static void mergeAtomic(DenseMap<unsigned, unsigned>::iterator it,
case RISCVAttrs::RISCVAtomicAbiTag::A7:
return;
};
+ break;
};
// If we get here, then we have an invalid tag, so report it.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change seems fine, but what compiler is warning about this? lld was compiling without warning for me recently with ToT clang.
The warning is
|
Right, but I don’t recall seeing that with a pretty recent clang, and I want to know if you’re using gcc or another compiler so I know if I should see if we should fix that in clang. |
Actually it's during compiling the |
Yes, but are you compiling with clang as the compiler or something else? Because if it’s clang then I don’t need to file a bug and try to run down why we’re not handling that. If you’re using something else, then I do. |
Oh, I got your point, I was using gcc. |
Thanks I’ll take a look at top of tree clang again, and file a bug if we’re missing warnings in that case. |
Summary: This prevent the warnings from compiler. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251271
This prevent the warnings from compiler.