mirror of
https://github.com/nasa/trick.git
synced 2025-01-30 08:03:51 +00:00
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:
parent
54039b0084
commit
1615e0f13b
@ -389,6 +389,11 @@ bool FieldVisitor::VisitRecordType(clang::RecordType *rt) {
|
|||||||
fdes->setTypeName("std::string") ;
|
fdes->setTypeName("std::string") ;
|
||||||
return false ;
|
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() ;
|
std::string tst_string = rt->desugar().getAsString() ;
|
||||||
// remove class keyword if it exists
|
// 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 ) {
|
while ((pos = tst_string.find(" _Bool")) != std::string::npos ) {
|
||||||
tst_string.replace(pos , 6, " bool") ;
|
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.
|
// Test if we have some type from STL.
|
||||||
if (!tst_string.compare( 0 , 5 , "std::")) {
|
if (!tst_string.compare( 0 , 5 , "std::")) {
|
||||||
|
@ -54,7 +54,7 @@ endif
|
|||||||
all: $(ICG)
|
all: $(ICG)
|
||||||
|
|
||||||
$(ICG): $(OBJECTS) $(UDUNITS_OBJS)
|
$(ICG): $(OBJECTS) $(UDUNITS_OBJS)
|
||||||
$(CXX) -o $@ $(OBJECTS) $(UNITS_CONV_OBJ) $(UDUNITS_OBJS) $(LLVMLDFLAGS) $(CLANGLIBS)
|
$(CXX) -o $@ $(OBJECTS) $(UDUNITS_OBJS) $(LLVMLDFLAGS) $(CLANGLIBS)
|
||||||
|
|
||||||
# Only FieldDescription.cpp includes the units conversion header.
|
# Only FieldDescription.cpp includes the units conversion header.
|
||||||
$(OBJ_DIR)/FieldDescription.o : CXXFLAGS += -I$(TRICK_HOME)/include
|
$(OBJ_DIR)/FieldDescription.o : CXXFLAGS += -I$(TRICK_HOME)/include
|
||||||
@ -67,7 +67,7 @@ $(OBJECTS): $(OBJ_DIR)/%.o : %.cpp
|
|||||||
$(UDUNITS_OBJS): $(OBJ_DIR)/%.o : ${TRICK_HOME}/trick_source/sim_services/UdUnits/%.cpp
|
$(UDUNITS_OBJS): $(OBJ_DIR)/%.o : ${TRICK_HOME}/trick_source/sim_services/UdUnits/%.cpp
|
||||||
$(CXX) -c $< -o $@
|
$(CXX) -c $< -o $@
|
||||||
|
|
||||||
$(OBJECTS) $(UNITS_CONV_OBJ) : | $(OBJ_DIR)
|
$(OBJECTS) $(UDUNITS_OBJS) : | $(OBJ_DIR)
|
||||||
|
|
||||||
$(OBJ_DIR):
|
$(OBJ_DIR):
|
||||||
mkdir -p $(OBJ_DIR)
|
mkdir -p $(OBJ_DIR)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user