1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00

DIBuilder: Add function and method definitions to the list of all subprograms

Previously we seemed to be assuming that all functions were definitions and all
methods were declarations. This may be consistent with how Clang uses DIBuilder
but doesn't have to be true of all clients (such as DragonEgg).

llvm-svn: 175423
This commit is contained in:
David Blaikie 2013-02-18 07:10:22 +00:00
parent 5dfa2c744d
commit 5a469eb56d

View File

@ -924,7 +924,8 @@ DISubprogram DIBuilder::createFunction(DIDescriptor Context,
MDNode *Node = MDNode::get(VMContext, Elts);
// Create a named metadata so that we do not lose this mdnode.
AllSubprograms.push_back(Node);
if (isDefinition)
AllSubprograms.push_back(Node);
return DISubprogram(Node);
}
@ -968,6 +969,8 @@ DISubprogram DIBuilder::createMethod(DIDescriptor Context,
ConstantInt::get(Type::getInt32Ty(VMContext), LineNo)
};
MDNode *Node = MDNode::get(VMContext, Elts);
if (isDefinition)
AllSubprograms.push_back(Node);
return DISubprogram(Node);
}