瀏覽代碼

Fixed a null DIExpression which survived in the matrix return case. (#2101)

Tristan Labelle 6 年之前
父節點
當前提交
bd40fbf52c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

+ 2 - 2
lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

@@ -6219,9 +6219,9 @@ void SROA_Parameter_HLSL::createFlattenedFunction(Function *F) {
         DIBuilder DIB(*F->getParent(), /*AllowUnresolved*/ false);
         DILocalVariable *RetVar = DIB.createLocalVariable(llvm::dwarf::Tag::DW_TAG_arg_variable, funcDI, F->getName().str() + ".Ret", funcDI->getFile(),
             funcDI->getLine(), RetDIType);
-        DIExpression *Expr = nullptr;
+        DIExpression *Expr = DIB.createExpression();
         // TODO: how to get col?
-        DILocation *DL = DILocation::get(F->getContext(), funcDI->getLine(), 0,  funcDI);
+        DILocation *DL = DILocation::get(F->getContext(), funcDI->getLine(), 0, funcDI);
         DIB.insertDeclare(retValAddr, RetVar, Expr, DL, Builder.GetInsertPoint());
     }
     for (BasicBlock &BB : F->getBasicBlockList()) {