diff options
| author | Devang Patel <dpatel@apple.com> | 2009-10-08 18:53:37 +0000 | 
|---|---|---|
| committer | Devang Patel <dpatel@apple.com> | 2009-10-08 18:53:37 +0000 | 
| commit | abf71fa9fc875cf61503ce9803e0ad2a86b8ca59 (patch) | |
| tree | 58b1e4e94ba0b073e16c311546b4cefc5d9b31b8 | |
| parent | fac9476589f1350513638ad1c5509573ea6908d4 (diff) | |
| download | bcm5719-llvm-abf71fa9fc875cf61503ce9803e0ad2a86b8ca59.tar.gz bcm5719-llvm-abf71fa9fc875cf61503ce9803e0ad2a86b8ca59.zip  | |
Record location info before emiting alloca for arguments. This allows arguments to have proper location info.
llvm-svn: 83567
| -rw-r--r-- | clang/lib/CodeGen/CGDecl.cpp | 9 | 
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp index 73bc0a04a0c..cc8f5471912 100644 --- a/clang/lib/CodeGen/CGDecl.cpp +++ b/clang/lib/CodeGen/CGDecl.cpp @@ -550,6 +550,11 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) {           "Invalid argument to EmitParmDecl");    QualType Ty = D.getType(); +  if (CGDebugInfo *DI = getDebugInfo()) { +    DI->setLocation(D.getLocation()); +    DI->EmitStopPoint(CurFn, Builder); +  } +    llvm::Value *DeclPtr;    if (!Ty->isConstantSizeType()) {      // Variable sized values always are passed by-reference. @@ -578,9 +583,7 @@ void CodeGenFunction::EmitParmDecl(const VarDecl &D, llvm::Value *Arg) {    DMEntry = DeclPtr;    // Emit debug info for param declaration. -  if (CGDebugInfo *DI = getDebugInfo()) { -    DI->setLocation(D.getLocation()); +  if (CGDebugInfo *DI = getDebugInfo())      DI->EmitDeclareOfArgVariable(&D, DeclPtr, Builder); -  }  }  | 

