-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
[SPIRV] Fix return type mismatch for createSPIRVEmitNonSemanticDIPass #105889
Conversation
The declaration in SPIRV.h had this returning a `MachineFunctionPass *`, but the implementation returned a `FunctionPass *`. This showed up as a build error on windows, but it was clearly a mistake regardless. I also updated the pass to include SPIRV.h rather than using its own declarations for pass initialization, as this results in better errors for this kind of typo.
@llvm/pr-subscribers-backend-spir-v Author: Justin Bogner (bogner) ChangesThe declaration in SPIRV.h had this returning a I also updated the pass to include SPIRV.h rather than using its own declarations for pass initialization, as this results in better errors for this kind of typo. Full diff: https://github.com/llvm/llvm-project/pull/105889.diff 1 Files Affected:
diff --git a/llvm/lib/Target/SPIRV/SPIRVEmitNonSemanticDI.cpp b/llvm/lib/Target/SPIRV/SPIRVEmitNonSemanticDI.cpp
index cc506356e39043..01c03215fb9e75 100644
--- a/llvm/lib/Target/SPIRV/SPIRVEmitNonSemanticDI.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVEmitNonSemanticDI.cpp
@@ -1,3 +1,4 @@
+#include "SPIRV.h"
#include "MCTargetDesc/SPIRVBaseInfo.h"
#include "MCTargetDesc/SPIRVMCTargetDesc.h"
#include "SPIRVGlobalRegistry.h"
@@ -33,12 +34,6 @@ struct SPIRVEmitNonSemanticDI : public MachineFunctionPass {
bool IsGlobalDIEmitted = false;
bool emitGlobalDI(MachineFunction &MF);
};
-
-void initializeSPIRVEmitNonSemanticDIPass(PassRegistry &);
-
-FunctionPass *createSPIRVEmitNonSemanticDIPass(SPIRVTargetMachine *TM) {
- return new SPIRVEmitNonSemanticDI(TM);
-}
} // namespace llvm
using namespace llvm;
@@ -48,6 +43,11 @@ INITIALIZE_PASS(SPIRVEmitNonSemanticDI, DEBUG_TYPE,
char SPIRVEmitNonSemanticDI::ID = 0;
+MachineFunctionPass *
+llvm::createSPIRVEmitNonSemanticDIPass(SPIRVTargetMachine *TM) {
+ return new SPIRVEmitNonSemanticDI(TM);
+}
+
SPIRVEmitNonSemanticDI::SPIRVEmitNonSemanticDI(SPIRVTargetMachine *TM)
: MachineFunctionPass(ID), TM(TM) {
initializeSPIRVEmitNonSemanticDIPass(*PassRegistry::getPassRegistry());
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
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.
@bogner Thanks for catching this and the fix!
…#105889) The declaration in SPIRV.h had this returning a `MachineFunctionPass *`, but the implementation returned a `FunctionPass *`. This showed up as a build error on windows, but it was clearly a mistake regardless. I also updated the pass to include SPIRV.h rather than using its own declarations for pass initialization, as this results in better errors for this kind of typo. Fixes a build break after #97558
…#105965) I don't know if this is the right thing to do or if the emitter should be normalizing path separators, but this gets this test to pass on windows where `sys::path::append` will use "\" instead of "/". This is another follow up to #97558, as #105889 managed to fix the build, but not all of the tests.
…llvm#105965) I don't know if this is the right thing to do or if the emitter should be normalizing path separators, but this gets this test to pass on windows where `sys::path::append` will use "\" instead of "/". This is another follow up to llvm#97558, as llvm#105889 managed to fix the build, but not all of the tests.
…llvm#105889) The declaration in SPIRV.h had this returning a `MachineFunctionPass *`, but the implementation returned a `FunctionPass *`. This showed up as a build error on windows, but it was clearly a mistake regardless. I also updated the pass to include SPIRV.h rather than using its own declarations for pass initialization, as this results in better errors for this kind of typo. Fixes a build break after llvm#97558
…llvm#105965) I don't know if this is the right thing to do or if the emitter should be normalizing path separators, but this gets this test to pass on windows where `sys::path::append` will use "\" instead of "/". This is another follow up to llvm#97558, as llvm#105889 managed to fix the build, but not all of the tests.
The declaration in SPIRV.h had this returning a
MachineFunctionPass *
, but the implementation returned aFunctionPass *
. This showed up as a build error on windows, but it was clearly a mistake regardless.I also updated the pass to include SPIRV.h rather than using its own declarations for pass initialization, as this results in better errors for this kind of typo.
Fixes a build break after #97558