Merge pull request #997 from jbrodman/master
Fix to support function pointers in header file generation.
This commit is contained in:
11
module.cpp
11
module.cpp
@@ -1678,6 +1678,7 @@ lGetExportedTypes(const Type *type,
|
|||||||
std::vector<const VectorType *> *exportedVectorTypes) {
|
std::vector<const VectorType *> *exportedVectorTypes) {
|
||||||
const ArrayType *arrayType = CastType<ArrayType>(type);
|
const ArrayType *arrayType = CastType<ArrayType>(type);
|
||||||
const StructType *structType = CastType<StructType>(type);
|
const StructType *structType = CastType<StructType>(type);
|
||||||
|
const FunctionType *ftype = CastType<FunctionType>(type);
|
||||||
|
|
||||||
if (CastType<ReferenceType>(type) != NULL)
|
if (CastType<ReferenceType>(type) != NULL)
|
||||||
lGetExportedTypes(type->GetReferenceTarget(), exportedStructTypes,
|
lGetExportedTypes(type->GetReferenceTarget(), exportedStructTypes,
|
||||||
@@ -1701,6 +1702,16 @@ lGetExportedTypes(const Type *type,
|
|||||||
lAddTypeIfNew(type, exportedEnumTypes);
|
lAddTypeIfNew(type, exportedEnumTypes);
|
||||||
else if (CastType<VectorType>(type) != NULL)
|
else if (CastType<VectorType>(type) != NULL)
|
||||||
lAddTypeIfNew(type, exportedVectorTypes);
|
lAddTypeIfNew(type, exportedVectorTypes);
|
||||||
|
else if (ftype != NULL) {
|
||||||
|
// Handle Return Types
|
||||||
|
lGetExportedTypes(ftype->GetReturnType(), exportedStructTypes,
|
||||||
|
exportedEnumTypes, exportedVectorTypes);
|
||||||
|
|
||||||
|
// And now the parameter types...
|
||||||
|
for (int j = 0; j < ftype->GetNumParameters(); ++j)
|
||||||
|
lGetExportedTypes(ftype->GetParameterType(j), exportedStructTypes,
|
||||||
|
exportedEnumTypes, exportedVectorTypes);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
Assert(CastType<AtomicType>(type) != NULL);
|
Assert(CastType<AtomicType>(type) != NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user