[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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214189 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Manman Ren
2014-07-29 18:20:39 +00:00
parent 52f23be080
commit 23ab342d96
7 changed files with 22 additions and 71 deletions
+2 -2
View File
@@ -1132,7 +1132,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DIDerivedType DTy) {
void DwarfUnit::constructSubprogramArguments(DIE &Buffer, DITypeArray Args) {
for (unsigned i = 1, N = Args.getNumElements(); i < N; ++i) {
DIType Ty = resolve(Args.getElement(i));
if (Ty.isUnspecifiedParameter()) {
if (!Ty) {
assert(i == N-1 && "Unspecified parameter must be the last argument");
createAndAddDIE(dwarf::DW_TAG_unspecified_parameters, Buffer);
} else {
@@ -1168,7 +1168,7 @@ void DwarfUnit::constructTypeDIE(DIE &Buffer, DICompositeType CTy) {
bool isPrototyped = true;
if (Elements.getNumElements() == 2 &&
resolve(Elements.getElement(1)).isUnspecifiedParameter())
!resolve(Elements.getElement(1)))
isPrototyped = false;
constructSubprogramArguments(Buffer, Elements);