diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-10-23 00:16:05 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-10-23 00:16:05 +0000 |
commit | f299947bfaef176300de04c50e6dbbda863c2c96 (patch) | |
tree | efcfad988b8b4811b1fe1983bf24794627828380 /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | 2b22b1e9a26c32cb3ab0499882d352812d91a6f3 (diff) | |
download | bcm5719-llvm-f299947bfaef176300de04c50e6dbbda863c2c96.tar.gz bcm5719-llvm-f299947bfaef176300de04c50e6dbbda863c2c96.zip |
[DebugInfo] Sink DwarfDebug::addCurrentFnArgument down into DwarfFile.
Variable handling will be sunk into DwarfFile so that abstract variables
and the like can be shared across multiple CUs (to handle cross-CU
inlining, for example).
llvm-svn: 220453
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index eb2d25ec2d4..151790ccfe8 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -794,29 +794,6 @@ DwarfDebug::ensureAbstractVariableIsCreatedIfScoped(const DIVariable &DV, createAbstractVariable(Cleansed, Scope); } -// If Var is a current function argument then add it to CurrentFnArguments list. -bool DwarfDebug::addCurrentFnArgument(DbgVariable *Var, LexicalScope *Scope) { - if (Scope->getParent()) - return false; - DIVariable DV = Var->getVariable(); - if (DV.getTag() != dwarf::DW_TAG_arg_variable) - return false; - unsigned ArgNo = DV.getArgNumber(); - if (ArgNo == 0) - return false; - - size_t Size = CurrentFnArguments.size(); - if (Size == 0) - CurrentFnArguments.resize(CurFn->getFunction()->arg_size()); - // llvm::Function argument size is not good indicator of how many - // arguments does the function have at source level. - if (ArgNo > Size) - CurrentFnArguments.resize(ArgNo * 2); - assert(!CurrentFnArguments[ArgNo - 1]); - CurrentFnArguments[ArgNo - 1] = Var; - return true; -} - // Collect variable information from side table maintained by MMI. void DwarfDebug::collectVariableInfoFromMMITable( SmallPtrSetImpl<const MDNode *> &Processed) { @@ -1277,7 +1254,7 @@ void DwarfDebug::beginFunction(const MachineFunction *MF) { } void DwarfDebug::addScopeVariable(LexicalScope *LS, DbgVariable *Var) { - if (addCurrentFnArgument(Var, LS)) + if (InfoHolder.addCurrentFnArgument(Var, LS)) return; addNonArgumentScopeVariable(LS, Var); } |