diff --git a/IDEHelper/Backend/BeIRCodeGen.cpp b/IDEHelper/Backend/BeIRCodeGen.cpp index 0e02de3d..940a7dd9 100644 --- a/IDEHelper/Backend/BeIRCodeGen.cpp +++ b/IDEHelper/Backend/BeIRCodeGen.cpp @@ -1754,10 +1754,10 @@ void BeIRCodeGen::HandleNextCmd() { CMD_PARAM(BeType*, varType); CMD_PARAM(bool, isConstant); - BfIRLinkageType linkageType = (BfIRLinkageType)mStream->Read(); - CMD_PARAM(BeConstant*, initializer); + BfIRLinkageType linkageType = (BfIRLinkageType)mStream->Read(); CMD_PARAM(String, name); CMD_PARAM(bool, isTLS); + CMD_PARAM(BeConstant*, initializer); auto globalVariable = mBeModule->mGlobalVariables.Alloc(); globalVariable->mModule = mBeModule; diff --git a/IDEHelper/Compiler/BfIRBuilder.cpp b/IDEHelper/Compiler/BfIRBuilder.cpp index 6e62b3af..606eeb21 100644 --- a/IDEHelper/Compiler/BfIRBuilder.cpp +++ b/IDEHelper/Compiler/BfIRBuilder.cpp @@ -4307,7 +4307,7 @@ BfIRValue BfIRBuilder::CreateGlobalVariable(BfIRType varType, bool isConstant, B if (initializer) mHasGlobalDefs = true; - BfIRValue retVal = WriteCmd(BfIRCmd_GlobalVariable, varType, isConstant, (uint8)linkageType, initializer, name, isTLS); + BfIRValue retVal = WriteCmd(BfIRCmd_GlobalVariable, varType, isConstant, (uint8)linkageType, name, isTLS, initializer); constGV->mStreamId = retVal.mId; retVal.mFlags = BfIRValueFlags_Const; #ifdef CHECK_CONSTHOLDER diff --git a/IDEHelper/Compiler/BfIRCodeGen.cpp b/IDEHelper/Compiler/BfIRCodeGen.cpp index fb61aab7..91a80419 100644 --- a/IDEHelper/Compiler/BfIRCodeGen.cpp +++ b/IDEHelper/Compiler/BfIRCodeGen.cpp @@ -1905,10 +1905,10 @@ void BfIRCodeGen::HandleNextCmd() { CMD_PARAM(llvm::Type*, varType); CMD_PARAM(bool, isConstant); - BfIRLinkageType linkageType = (BfIRLinkageType)mStream->Read(); - CMD_PARAM(llvm::Constant*, initializer); + BfIRLinkageType linkageType = (BfIRLinkageType)mStream->Read(); CMD_PARAM(String, name); CMD_PARAM(bool, isTLS); + CMD_PARAM(llvm::Constant*, initializer); auto globalVariable = new llvm::GlobalVariable( *mLLVMModule,