Bläddra i källkod

Fix debug info for arguments in EmitParmDecl during CodeGen (#1766)

Fixes #1705

- Declare of arg variable would point to non-pointer value, which was not
  legal llvm.
- This change fixes that, but SROA_HLSL will be unable to find the arg's
  debug info in certain cases.  That code has to be changed anyways,
  so that fix needs to come in a later change.
Tex Riddell 6 år sedan
förälder
incheckning
3f6ec55dae
1 ändrade filer med 1 tillägg och 5 borttagningar
  1. 1 5
      tools/clang/lib/CodeGen/CGDecl.cpp

+ 1 - 5
tools/clang/lib/CodeGen/CGDecl.cpp

@@ -1865,11 +1865,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg,
   if (CGDebugInfo *DI = getDebugInfo()) {
     if (CGM.getCodeGenOpts().getDebugInfo()
           >= CodeGenOptions::LimitedDebugInfo) {
-      // HLSL Change Begins.
-      // Use the Arg directly instead of DeclPtr for HLSL.
-      // The DeclPtr will be promoted in later pass.
-      DI->EmitDeclareOfArgVariable(&D, Arg, ArgNo, Builder);
-      // HLSL Change Ends.
+      DI->EmitDeclareOfArgVariable(&D, DeclPtr, ArgNo, Builder);
     }
   }