Pipe through source file locations of structure element declarations; these are now supplied to the llvm::DIBuilder::createMemberType() method rather than giving it the position of the overall struct declaration for each one. Fixes issue #31

This commit is contained in:
Matt Pharr
2011-06-29 05:38:42 +01:00
parent 86de910ecd
commit cb58c78c1a
5 changed files with 41 additions and 27 deletions

View File

@@ -318,9 +318,10 @@ Declaration::Print() const {
///////////////////////////////////////////////////////////////////////////
void
GetStructTypesAndNames(const std::vector<StructDeclaration *> &sd,
std::vector<const Type *> *elementTypes,
std::vector<std::string> *elementNames) {
GetStructTypesNamesPositions(const std::vector<StructDeclaration *> &sd,
std::vector<const Type *> *elementTypes,
std::vector<std::string> *elementNames,
std::vector<SourcePos> *elementPositions) {
for (unsigned int i = 0; i < sd.size(); ++i) {
const Type *type = sd[i]->type;
// FIXME: making this fake little DeclSpecs here is really
@@ -343,6 +344,7 @@ GetStructTypesAndNames(const std::vector<StructDeclaration *> &sd,
elementTypes->push_back(d->sym->type);
elementNames->push_back(d->sym->name);
elementPositions->push_back(d->sym->pos);
}
}
}