aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/BasicBlock.cpp
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse@sony.com>2025-01-28 15:55:45 +0000
committerGitHub <noreply@github.com>2025-01-28 15:55:45 +0000
commit48df9480dab57f99aa466ade1df6c46e71da25b5 (patch)
tree1fdfa5ecc6421d3d64243dc5c7d556f2ce6f20a8 /llvm/lib/IR/BasicBlock.cpp
parent75622e3f8d9d18de693988f95c44a0011de9208f (diff)
downloadllvm-48df9480dab57f99aa466ade1df6c46e71da25b5.zip
llvm-48df9480dab57f99aa466ade1df6c46e71da25b5.tar.gz
llvm-48df9480dab57f99aa466ade1df6c46e71da25b5.tar.bz2
[NFC] Suppress spurious deprecation warning with MSVC (#124764)
gcc and clang won't complain about calls to deprecated functions, if you're calling from a function that is deprecated too. However, MSVC does care, and expands into maaany deprecation warnings for getFirstNonPHI. Suppress this by converting the inlineable copy of getFirstNonPHI into a non-inline copy.
Diffstat (limited to 'llvm/lib/IR/BasicBlock.cpp')
-rw-r--r--llvm/lib/IR/BasicBlock.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 8eaa6e5..dca42a5 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -371,6 +371,13 @@ const Instruction* BasicBlock::getFirstNonPHI() const {
return nullptr;
}
+Instruction *BasicBlock::getFirstNonPHI() {
+ for (Instruction &I : *this)
+ if (!isa<PHINode>(I))
+ return &I;
+ return nullptr;
+}
+
BasicBlock::const_iterator BasicBlock::getFirstNonPHIIt() const {
for (const Instruction &I : *this) {
if (isa<PHINode>(I))