Skip to content

Commit c24fb45

Browse files
[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.
1 parent 0886440 commit c24fb45

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/include/llvm/SandboxIR/SandboxIR.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1432,8 +1432,7 @@ class CastInst : public UnaryInstruction {
14321432
CastInst(llvm::CastInst *CI, Context &Ctx)
14331433
: UnaryInstruction(ClassID::Cast, getCastOpcode(CI->getOpcode()), CI,
14341434
Ctx) {}
1435-
friend Context; // for SBCastInstruction()
1436-
friend class PtrToInt; // For constructor.
1435+
friend Context; // for SBCastInstruction()
14371436
Use getOperandUseInternal(unsigned OpIdx, bool Verify) const final {
14381437
return getOperandUseDefault(OpIdx, Verify);
14391438
}

llvm/include/llvm/SandboxIR/Use.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ class Context;
2222
class Value;
2323
class User;
2424
class CallBase;
25+
class CallBrInst;
2526
class PHINode;
2627

2728
/// Represents a Def-use/Use-def edge in SandboxIR.

0 commit comments

Comments
 (0)