diff options
author | Manman Ren <manman.ren@gmail.com> | 2014-07-29 18:20:39 +0000 |
---|---|---|
committer | Manman Ren <manman.ren@gmail.com> | 2014-07-29 18:20:39 +0000 |
commit | f93ac4bfadc705760853c3bcb6463b1d58c7d1dc (patch) | |
tree | dc3888dbb8062675ae437f96aafdca67b762e47d /llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | |
parent | a3a6c12c0315d03fd8139606793b0d22ef2a57f6 (diff) | |
download | bcm5719-llvm-f93ac4bfadc705760853c3bcb6463b1d58c7d1dc.tar.gz bcm5719-llvm-f93ac4bfadc705760853c3bcb6463b1d58c7d1dc.zip |
[Debug Info] remove DITrivialType and use null to represent unspecified param.
Per feedback on r214111, we are going to use null to represent unspecified
parameter. If the type array is {null}, it means a function that returns void;
If the type array is {null, null}, it means a variadic function that returns
void. In summary if we have more than one element in the type array and the last
element is null, it is a variadic function.
rdar://17628609
llvm-svn: 214189
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index d58e47eaf03..d0958c0e975 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -469,11 +469,13 @@ DIE *DwarfDebug::createScopeChildrenDIE( // If this is a variadic function, add an unspecified parameter. DISubprogram SP(Scope->getScopeNode()); DITypeArray FnArgs = SP.getType().getTypeArray(); - if (resolve(FnArgs.getElement(FnArgs.getNumElements() - 1)) - .isUnspecifiedParameter()) { + // If we have a single element of null, it is a function that returns void. + // If we have more than one elements and the last one is null, it is a + // variadic function. + if (FnArgs.getNumElements() > 1 && + !resolve(FnArgs.getElement(FnArgs.getNumElements() - 1))) Children.push_back( make_unique<DIE>(dwarf::DW_TAG_unspecified_parameters)); - } } // Collect lexical scope children first. |