[llvm] c24fb45 - [llvm][SandboxIR] Fix some clang-cl warnings on Windows (#101660)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 5 01:14:06 PDT 2024
Author: David Spickett
Date: 2024-08-05T09:14:03+01:00
New Revision: c24fb452651f53bb4d2730703ed7304c6ef71cc2
URL: https://github.com/llvm/llvm-project/commit/c24fb452651f53bb4d2730703ed7304c6ef71cc2
DIFF: https://github.com/llvm/llvm-project/commit/c24fb452651f53bb4d2730703ed7304c6ef71cc2.diff
LOG: [llvm][SandboxIR] Fix some clang-cl warnings on Windows (#101660)
```
[4958/6355] Building CXX object lib\SandboxIR\CMakeFiles\LLVMSandboxIR.dir\Tracker.cpp.obj In file included from C:\Work\david.spickett\llvm-project\llvm\lib\SandboxIR\Tracker.cpp:9: In file included from C:\Work\david.spickett\llvm-project\llvm\include\llvm/SandboxIR/Tracker.h:48: C:\Work\david.spickett\llvm-project\llvm\include\llvm/SandboxIR/Use.h(46,16): warning: unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier [-Wmicrosoft-unqualified-friend]
46 | friend class CallBrInst; // For constructor
| ^
| ::llvm::
In file included from C:\Work\david.spickett\llvm-project\llvm\lib\SandboxIR\Tracker.cpp:13:
C:\Work\david.spickett\llvm-project\llvm\include\llvm/SandboxIR/SandboxIR.h(1433,16): warning:
unqualified friend declaration referring to type outside of the nearest enclosing namespace is a Microsoft extension; add a nested name specifier [-Wmicrosoft-unqualified-friend]
1433 | friend class PtrToInt; // For constructor.
| ^
| ::llvm::
```
First one I think is a missing forward declaration and I couldn't find
the right class for the second one but it appears to be unused anyway.
Added:
Modified:
llvm/include/llvm/SandboxIR/SandboxIR.h
llvm/include/llvm/SandboxIR/Use.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/SandboxIR/SandboxIR.h b/llvm/include/llvm/SandboxIR/SandboxIR.h
index ed0aaeb4f9a8e..9e5db20b24877 100644
--- a/llvm/include/llvm/SandboxIR/SandboxIR.h
+++ b/llvm/include/llvm/SandboxIR/SandboxIR.h
@@ -1432,8 +1432,7 @@ class CastInst : public UnaryInstruction {
CastInst(llvm::CastInst *CI, Context &Ctx)
: UnaryInstruction(ClassID::Cast, getCastOpcode(CI->getOpcode()), CI,
Ctx) {}
- friend Context; // for SBCastInstruction()
- friend class PtrToInt; // For constructor.
+ friend Context; // for SBCastInstruction()
Use getOperandUseInternal(unsigned OpIdx, bool Verify) const final {
return getOperandUseDefault(OpIdx, Verify);
}
diff --git a/llvm/include/llvm/SandboxIR/Use.h b/llvm/include/llvm/SandboxIR/Use.h
index 35d01daf39f6e..5b55337b12bc2 100644
--- a/llvm/include/llvm/SandboxIR/Use.h
+++ b/llvm/include/llvm/SandboxIR/Use.h
@@ -22,6 +22,7 @@ class Context;
class Value;
class User;
class CallBase;
+class CallBrInst;
class PHINode;
/// Represents a Def-use/Use-def edge in SandboxIR.
More information about the llvm-commits
mailing list