Commit Graph

39 Commits

Author SHA1 Message Date
jmpenn
5065d96a15
Pre-increment (rather than post-increment) STL iterators in for loops… (#1692)
* Pre-increment (rather than post-increment) STL iterators in for loops. #1594

* Fix a goof. #1594
2024-04-18 11:41:35 -05:00
Derek Bankieris
8e3726eb98 Mark references as such in ICG 2021-02-11 17:36:43 -06:00
Alex Lin
187fa37540
Remove suppression of units conversion warnings in 19 #789 (#814)
Removed checks on dead units conversion messenger.  Units conversion
messages cannot be suppressed.  Added deprecated messages to the functions
that modified the message printouts.
2019-06-18 10:59:51 -05:00
Alex Lin
78b5a0c692 Optionally use 'cio' in place of 'trick_chkpnt_io' field #749
Added an alias to use cio for trick_chkpnt_io and io for trick_io.
2019-06-14 07:43:37 -05:00
Scott Fennell
21c01a5454 scan-build changes
This reverts commit e86027f825.
2018-11-06 11:23:12 -06:00
Scott Fennell
e86027f825 revert scan-build changes, need further testing before merge 2018-10-22 15:11:29 -05:00
Scott Fennell
6619ecb92f move commented prints in FieldDescription to debug_level 4 2018-09-27 08:10:05 -05:00
Scott Fennell
77e0e73b3f various static analyser bug fixes 2018-09-25 10:41:14 -05:00
Thadeus Fleming
db07582616 Only left-shift FieldDescription::io when io_found == true
The `io` field of `FieldDescription` takes a default value of 15. In
`FieldDescription::parseComment`, it may be updated as specified in the comment
text. There are 4 possible cases:

1) Neither IO attributes nor checkpoint IO attributes are found in the comment
2) IO attributes are found in the comment, but checkpoint IO attributes are not
3) Checkpoint IO attributes are found in the comment, but IO attributes are not
4) Both IO attributes and checkpoint IO attributes are found in the comment

In case 2, the IO attributes are copied into the checkpoint IO attributes by the
statement `io |= (io << 2)`. However, this also erroneously runs in case 1,
causing the default value of 15 to change to 63.

By testing `io_found == true`, this logic occurs only in case 2.

Fixes #568
2018-03-27 09:37:26 -05:00
Alex Lin
70a81acc6c ICG handling of \brief in comments differs on Linux and Mac #453
Adjusted regular expression so it will work on the mac.  Changed "\w" to
"[a-zA-Z0-9]".
2017-08-21 14:03:49 -05:00
Derek Bankieris
353905c1ed Generate STL functions only when requested
Remove STL prototypes. They don't appear to be necessary anymore.
Refs #427
2017-05-16 15:31:08 -05:00
Thadeus Fleming
fb1925e0d8 Use std::cerr instead of std::cout for error messages 2016-12-10 11:49:44 -06:00
Alex Lin
d875f837f2 ICG produces non-compilable io_* code for this weird example #334
When saving the list of namespaces and classes a particular type is contained in
we have to save the class name and any template args it includes separately.  This
allows us to mangle the names easier.  And we now search for type names to see
if they follow this pattern template_name<template_args>::embedded_class.  If
we are using a template embedded class we need to create attributes for the embedded class.
2016-11-02 13:56:40 -05:00
Derek Bankieris
bdcfbb4e3a Restore debug functions #341 2016-10-31 09:10:33 -05:00
Derek Bankieris
ef1405c3be Refactor ICG
Hey buddy. I wanted to tell you this before you heard it from someone
else...

I refactored ICG.

Now, it's gonna look a little scary at first. But I promise you'll like
it when you get used to it. It'll be fine. You can trust me. #341
2016-10-28 14:37:12 -05:00
Derek Bankieris
f161ddb18c Made everything about Trick's build process better 2016-10-06 13:54:06 -05:00
Alex Lin
bbba26e057 Merge branch '17.0' 2016-09-16 09:50:12 -05:00
Alex Lin
00a0e8be44 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Missed some bitfield offset calculations.
2016-09-16 09:46:03 -05:00
Alex Lin
c134ffea8f Merge branch '17.0' 2016-09-16 08:43:47 -05:00
Alex Lin
ae07b26243 ICG exclude of class member variables now defines incorrect memory offsets in io_src #311
Added back the code that set the offset of variables with the offsetof function. This
code is running by default.  Any code that includes #ifndef TRICK_ICG in
classes/structures will want this on.

Added a flag to ICG that allows us to turn off writing of these lines.  If the flag
is present, ICG may write out io_src code for private/protected variables that it could
not reach if an offsetof function was required.  Code cannot have any #ifndef TRICK_ICG
present in classes/structures for this to work.
2016-09-16 08:39:37 -05:00
Alex Lin
9801e3d210 ICG not setting default checkpointing io correctly. #308
If a checkpoint_io field is found we were or'ing this in to bits already
set by default.  Clear the bits first.
2016-09-14 09:38:28 -05:00
Alex Lin
256c83a876 ICG not setting default checkpointing io correctly. #308
Changed the default io value from 3 which left out checkpointing to 15 which does
include checkpointing.
2016-09-13 16:37:59 -05:00
Alex Lin
fcb63e0e06 Output "--" if that was specified in the header file.
Used the mods field in the attributes to indicate of "--" was specified in the header file.  We
still save the units as "1" to keep it compatible with udunits.  When outputting the variable
in data recording or variable server we check to see if the mods field for "--" is set.  We
output "--" if the mods field is set.  Also allowed "--" to persist in data products.

refs #254
2016-06-21 16:12:28 -05:00
Alex Lin
3e82f79f28 Use udunits package for units conversions.
FieldDescription.cpp is missing and include for stack.  Strange it compiles
on most platforms.

refs #231
2016-05-18 08:26:14 -05:00
Alex Lin
26cb44e946 Use udunits package for units conversions
So our unit tests did their job, they pointed to quite a few errors.
Fixed them all on my platform (CentOS 7).

refs #231
2016-05-11 09:01:54 -05:00
Alex Lin
d72aa59fdd Use udunits package for units conversions
Converted data products to use udunits.

refs #231
2016-05-10 14:45:31 -05:00
Alex Lin
684f0e6bdc Use udunits package for units conversions
Initial checkin of using udunits for measurement units conversions.  Replaced
our conversion code in ICG and swig code to use udunits.

Also added code to convert unit symbols that we used in Trick that are different
names in udunits.

Added a sim_object that will eventually allow users to specify a custom
set of files to read units information.

refs #231
2016-05-05 14:49:49 -05:00
Alex Lin
f63f44d876 Ignore privacy
Changed the storage of offsets from bytes to bits to better handle bitfields.
Added code to track classes that are defined within other classes and are
private/protected.  These classes cannot be used in templates because our
io_src code declares variables outside of the class that would try and use
these private/protected variables.  When a template is found to use a
private/protected class it is skipped.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
314e962edf Ignore privacy
Removed the requirement of passing flags throughout ICG indicating if we are
in an inherited class or not.  Removed the init_attr friends throughout
Trick core headers.
2016-04-13 16:07:15 -05:00
Alex Lin
34090169fb Ignore privacy
Adjusted code to ignore processing templates in files with ICG:(No).  This
was not being honoroed before.

refs #218
2016-04-13 16:07:15 -05:00
Alex Lin
4dad11bf45 Ignore privacy
Moved field offset calculations for inherited classes to when the inherited
classes are processed.  This removes the need to have to remember if fields
were inherited or not, the offset already reflects the correct offset.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
7dcc65d0bd Ignore privacy
Mostly working.  This removes the use of offsetof from all I/O code.  This was
the only reason we needed friends.  In it's place we put the offset value that
clang has calculated for the field.  Still need to work on virtually inherited
classes and confirm bitfields.

refs #218
2016-04-13 16:07:14 -05:00
Alex Lin
fb7432d096 Add direct STL checkpointing
Modified ICG to save the non-canonical name for STLs.  This is typically more readable
because it is shorter.  Added code to the variable server to filter out requests accessing
STLs, because those accesses will not currently work.

refs #206
2016-04-04 15:07:57 -05:00
Alex Lin
46aec08b80 Add direct STL checkpointing
Initial checkin of STL checkpointing.  This checkin only covers the sequential
STLs, vector, list, deque, set, and multiset.  This checkin does include the
changes in Trick header files to include/exclude our STLs properly to make a
restartable checkpoint.

refs #206
2016-03-29 09:26:49 -05:00
Alex Lin
ce3ae67633 ATTRIBUTES for a member whose type is typedef'd in a template are wrong
I found that in ICG I have access to the canonical type of a variable which
in most cases is the type I should process.  Doing this eliminates the
need for some of the code that resolved typedefs because the canonical type
has already done that.

refs #200
2016-03-16 13:24:59 -05:00
Alex Lin
1754995396 ATTRIBUTES for classes with non-locally typedef'd members is wrong
Interesting case.  I found that we should process the canonical type names where
we were not before.  This resolves all typedefs and should be be more
accurate in the future.  When we process the canonical type we need to ignore
the processing of the non-canonical type.  We set a flag after
the canonical type is processed to ignore any type that is processed after.

refs #198
2016-03-10 10:42:59 -06:00
Alex Lin
c5d0b2a872 /usr/lib64/llvm/clang/3.4.2 not found
Modified the makefile for ICG to be able to use clang from yum, fink, and manual installs.  Removed the requirement for copying the clang friendly header files into Trick.  However Trick will be expecting the clang header files to be in it's search path.

refs #40
2015-06-09 08:44:44 -05:00
Alex Lin
19025d77ad Standardize directory names
Reorganized.  Created a new top level include directory that will hold all of Trick's header files. Moved all of the Trick headers to this directory.  Created a libexec directory that holds all of the executables that users don't need to execute directly.  Changed all of the executables remaining in bin to start with "trick-".  In the sim_services directories changed all source files to find the Trick headers in their new location.  Since all of the include files are gone in sim_services, removed the src directories as well, moving all of the source files up a level.  Moved the makefiles, docs, man, and other architecture independent files into a top level share directory.  Renamed lib_${TRICK_HOST_CPU} to lib64 or lib depending on the platform we're currently on.

refs #63
2015-06-09 08:44:42 -05:00
Alex Lin
f0c594f841 Initial commit of everything. 2015-02-26 09:02:31 -06:00