ICG should ignore FILE * variables

In ICG if we encounter a FILE * variable, we ignore it setting the IO specification to 0.

refs #244
This commit is contained in:
Alex Lin
2016-06-02 08:43:12 -05:00
parent 54039b0084
commit 1615e0f13b
2 changed files with 7 additions and 3 deletions

View File

@ -389,6 +389,11 @@ bool FieldVisitor::VisitRecordType(clang::RecordType *rt) {
fdes->setTypeName("std::string") ;
return false ;
}
// FILE * types resolve to these typenames. We need to ignore them
if (!type_name.compare("__sFILE") || !type_name.compare("_IO_FILE")) {
fdes->setIO(0) ;
return false ;
}
std::string tst_string = rt->desugar().getAsString() ;
// remove class keyword if it exists
@ -406,7 +411,6 @@ bool FieldVisitor::VisitRecordType(clang::RecordType *rt) {
while ((pos = tst_string.find(" _Bool")) != std::string::npos ) {
tst_string.replace(pos , 6, " bool") ;
}
// NOTE: clang also changes FILE * to struct _SFILE *. We may need to change that too.
// Test if we have some type from STL.
if (!tst_string.compare( 0 , 5 , "std::")) {