add typedefs to the list of validTypes

release/4.3a0
Duy-Nguyen Ta 2016-11-13 23:59:56 -05:00
parent a18f11097c
commit 6cbd613b43
2 changed files with 7 additions and 3 deletions

View File

@ -228,7 +228,7 @@ void Module::parseMarkup(const std::string& data) {
// Dependency check list
vector<string> validTypes = GenerateValidTypes(expandedClasses,
forward_declarations);
forward_declarations, typedefs);
// Check that all classes have been defined somewhere
verifyArguments<GlobalFunction>(validTypes, global_functions);
@ -446,7 +446,7 @@ vector<Class> Module::ExpandTypedefInstantiations(const vector<Class>& classes,
}
/* ************************************************************************* */
vector<string> Module::GenerateValidTypes(const vector<Class>& classes, const vector<ForwardDeclaration> forwardDeclarations) {
vector<string> Module::GenerateValidTypes(const vector<Class>& classes, const vector<ForwardDeclaration>& forwardDeclarations, const vector<TypedefPair>& typedefs) {
vector<string> validTypes;
for(const ForwardDeclaration& fwDec: forwardDeclarations) {
validTypes.push_back(fwDec.name);
@ -465,6 +465,9 @@ vector<string> Module::GenerateValidTypes(const vector<Class>& classes, const ve
for(const Class& cls: classes) {
validTypes.push_back(cls.qualifiedName("::"));
}
for(const TypedefPair& p: typedefs) {
validTypes.push_back(p.newType.qualifiedName("::"));
}
return validTypes;
}

View File

@ -84,7 +84,8 @@ private:
const std::vector<TemplateInstantiationTypedef> instantiations);
static std::vector<std::string> GenerateValidTypes(
const std::vector<Class>& classes,
const std::vector<ForwardDeclaration> forwardDeclarations);
const std::vector<ForwardDeclaration>& forwardDeclarations,
const std::vector<TypedefPair>& typedefs);
static void WriteCollectorsAndCleanupFcn(FileWriter& wrapperFile,
const std::string& moduleName, const std::vector<Class>& classes);
static void WriteRTTIRegistry(FileWriter& wrapperFile,