diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-07-27 20:08:06 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2010-07-27 20:08:06 +0000 |
commit | cdaf7bd472f6c6a3fa52d339471058c5a1492fe4 (patch) | |
tree | 7490d815fdefd143917f3768ca69cf1d9076a345 | |
parent | 49285298df77661db12cb1094f908dde7617a0fb (diff) | |
download | ATCD-cdaf7bd472f6c6a3fa52d339471058c5a1492fe4.tar.gz |
ChangeLogTag: Tue Jul 27 20:00:14 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu>
-rw-r--r-- | TAO/ChangeLog | 33 | ||||
-rw-r--r-- | TAO/TAO_IDL/driver/drv_args.cpp | 22 | ||||
-rw-r--r-- | TAO/TAO_IDL/include/idl_global.h | 28 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_err.cpp | 15 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_global.cpp | 34 | ||||
-rw-r--r-- | TAO/docs/compiler.html | 26 | ||||
-rw-r--r-- | TAO/tests/IDL_Test/IDL_Test.mpc | 32 |
7 files changed, 129 insertions, 61 deletions
diff --git a/TAO/ChangeLog b/TAO/ChangeLog index 7950b182f21..204b068542d 100644 --- a/TAO/ChangeLog +++ b/TAO/ChangeLog @@ -1,3 +1,36 @@ +Tue Jul 27 20:00:14 UTC 2010 Jeff Parsons <j.parsons@vanderbilt.edu> + + * TAO_IDL/driver/drv_args.cpp: + * TAO_IDL/util/utl_err.cpp: + * TAO_IDL/util/utl_global.cpp: + * TAO_IDL/include/idl_global.h: + + Modified IDL compiler handling of anonymous types. + Default is now silence, or no output. IDL_ANON_ERROR, + IDL_ANON_WARNING, or IDL_ANON_SILENT may be defined + in config.h to select global behavior of outputting + error, warning or nothing respectively. The command + line options -ae (error), -aw (warning) or -as + (silent) may be used to override this behavior + locally. + + * MPC/config/idl_anon_error.mpb: + * MPC/config/idl_anon_warning.mpb: + * MPC/config/idl_anon_silent.mpb: + + New base project files, which simply add -ae, -aw + or -as, respectively, to the IDL compiler command + line. + + * docs/compiler.html: + + Updated IDL compiler documentation. + + * tests/IDL_Test/IDL_Test.mpc: + + Removed -as option from project, it is now the default + behavior. + Tue Jul 27 11:51:25 UTC 2010 Marcel Smit <msmit@remedy.nl> * examples/CSD_Strategy/ThreadPool5/Foo.idl: diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp index 9a50b723caa..ee69f2cf69a 100644 --- a/TAO/TAO_IDL/driver/drv_args.cpp +++ b/TAO/TAO_IDL/driver/drv_args.cpp @@ -143,13 +143,18 @@ DRV_usage (void) )); ACE_DEBUG (( LM_DEBUG, + ACE_TEXT (" -ae\t\t\tError if anonymous type is seen ") + ACE_TEXT ("(default is silent)\n") + )); + ACE_DEBUG (( + LM_DEBUG, ACE_TEXT (" -aw\t\t\tWarning if anonymous type is seen ") - ACE_TEXT ("(default is error)\n") + ACE_TEXT ("(default is silent)\n") )); ACE_DEBUG (( LM_DEBUG, ACE_TEXT (" -as\t\t\tSilences the anonymous type diagnostic ") - ACE_TEXT ("(default is error)\n") + ACE_TEXT ("(default)\n") )); ACE_DEBUG (( LM_DEBUG, @@ -268,13 +273,20 @@ DRV_parse_args (long ac, char **av) ACE_OS::strcat (idl_global->local_escapes (), " "); break; case 'a': - if (av[i][2] == 'w') + if (av[i][2] == 'e') + { + idl_global->anon_type_diagnostic ( + IDL_GlobalData::ANON_TYPE_ERROR); + } + else if (av[i][2] == 'w') { - idl_global->anon_warning (true); + idl_global->anon_type_diagnostic ( + IDL_GlobalData::ANON_TYPE_WARNING); } else if (av[i][2] == 's') { - idl_global->anon_silent (true); + idl_global->anon_type_diagnostic ( + IDL_GlobalData::ANON_TYPE_SILENT); } else { diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index 0c229e314fe..00c0b456cd5 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -710,13 +710,22 @@ public: Unbounded_Paths_Queue &include_paths (void); // Accessor for the member. - bool anon_warning (void) const; - void anon_warning (bool val); - // Accessors for the member. + enum ANON_TYPE_DIAGNOSTIC + { + ANON_TYPE_ERROR, + ANON_TYPE_WARNING, + ANON_TYPE_SILENT + }; + // Determines which type of diagnostic to emit, if any, upon + // detecting the presence of an anonymous IDL construct. + void anon_type_diagnostic (ANON_TYPE_DIAGNOSTIC val); + // Mutator for the member. + + bool anon_error (void) const; + bool anon_warning (void) const; bool anon_silent (void) const; - void anon_silent (bool val); - // Accessors for the member. + // Simple checks for the value of anon_type_diagnostic_. bool in_typedef (void) const; void in_typedef (bool val); @@ -887,14 +896,7 @@ private: /// For quick access. AST_Module *corba_module_; - /// Anonymous type diagnostic limited to warning? - /// False by default, can be overridden from command line. - /// Error mesesage is default behavior. - bool anon_warning_; - - /// Anonymous type diagnostic completely disabled? - /// False by default. - bool anon_silent_; + ANON_TYPE_DIAGNOSTIC anon_type_diagnostic_; /// Flag set in parser so we can decide whether to emit /// an anonymous type diagnostic. diff --git a/TAO/TAO_IDL/util/utl_err.cpp b/TAO/TAO_IDL/util/utl_err.cpp index bd661a5e594..af81e591ee9 100644 --- a/TAO/TAO_IDL/util/utl_err.cpp +++ b/TAO/TAO_IDL/util/utl_err.cpp @@ -1602,12 +1602,21 @@ UTL_Error::scope_masking_error (AST_Decl *masked, void UTL_Error::anonymous_type_diagnostic (void) { + if (idl_global->anon_silent ()) + { + return; + } + bool aw = idl_global->anon_warning (); bool nw = (idl_global->compile_flags () & IDL_CF_NOWARNINGS); - bool warning = (aw & !nw); + + if (aw && nw) + { + return; + } ErrorCode ec = - (warning ? EIDL_ANONYMOUS_WARNING : EIDL_ANONYMOUS_ERROR); + (aw ? EIDL_ANONYMOUS_WARNING : EIDL_ANONYMOUS_ERROR); idl_error_header (ec, idl_global->lineno (), @@ -1615,7 +1624,7 @@ UTL_Error::anonymous_type_diagnostic (void) ACE_ERROR ((LM_ERROR, "\n")); - if (!warning) + if (ec == EIDL_ANONYMOUS_ERROR) { idl_global->set_err_count (idl_global->err_count () + 1); } diff --git a/TAO/TAO_IDL/util/utl_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index c5e6541895f..2f0bc4362b9 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -152,8 +152,7 @@ IDL_GlobalData::IDL_GlobalData (void) current_params_ (0), included_ami_receps_done_ (false), corba_module_ (0), - anon_warning_ (false), - anon_silent_ (true), + anon_type_diagnostic_ (ANON_TYPE_SILENT), in_typedef_ (false) { // Path for the perfect hash generator(gperf) program. @@ -207,6 +206,14 @@ IDL_GlobalData::IDL_GlobalData (void) ace_root); #endif /* ACE_GPERF */ } + +#if defined (IDL_ANON_ERROR) + this->anon_type_diagnostic_ = ANON_TYPE_ERROR; +#elif defined (IDL_ANON_WARNING) + this->anon_type_diagnostic_ = ANON_TYPE_WARNING; +#elif defined (IDL_ANON_SILENT) + this->anon_type_diagnostic_ = ANON_TYPE_SILENT; +#endif // ambiguous_type_seen_ and basic_type_seen_ are not reset between // command line idl files, so do those here and then reset the rest. @@ -1727,28 +1734,29 @@ IDL_GlobalData::include_paths (void) return this->include_paths_; } -bool -IDL_GlobalData::anon_warning (void) const +void +IDL_GlobalData::anon_type_diagnostic ( + IDL_GlobalData::ANON_TYPE_DIAGNOSTIC val) { - return this->anon_warning_; + this->anon_type_diagnostic_ = val; } -void -IDL_GlobalData::anon_warning (bool val) +bool +IDL_GlobalData::anon_error (void) const { - this->anon_warning_ = val; + return (this->anon_type_diagnostic_ == ANON_TYPE_ERROR); } bool -IDL_GlobalData::anon_silent (void) const +IDL_GlobalData::anon_warning (void) const { - return this->anon_silent_; + return (this->anon_type_diagnostic_ == ANON_TYPE_WARNING); } -void -IDL_GlobalData::anon_silent (bool val) +bool +IDL_GlobalData::anon_silent (void) const { - this->anon_silent_ = val; + return (this->anon_type_diagnostic_ == ANON_TYPE_SILENT); } bool diff --git a/TAO/docs/compiler.html b/TAO/docs/compiler.html index 3edabc455df..c4927e4015a 100644 --- a/TAO/docs/compiler.html +++ b/TAO/docs/compiler.html @@ -755,24 +755,36 @@ also receives other options that are specific to it.<p> <td> </td> </tr> + <tr><a name="ae"> + <td><tt>-ae</tt></td> + + <td>Output an error if an anonymous type is seen. Anonymous types are + deprecated by the OMG spec (default is no output).</td> + + <td>This behavior can be selected globally by defining IDL_ANON_ERROR in + config.h. It may then be overridden locally by + <tt>-aw</tt> or <tt>-as</tt></td> + </tr> + <tr><a name="aw"> <td><tt>-aw</tt></td> <td>Output a warning if an anonymous type is seen. Anonymous types are - deprecated by the OMG spec (default is output of error message).</td> + deprecated by the OMG spec (default is no output).</td> - <td>This option has been added as a nicety for dealing with legacy - IDL files, written before anonymous types were deprecated.</td> + <td>This behavior can be selected globally by defining IDL_ANON_WARNING in + config.h. It may then be overridden locally by + <tt>-ae</tt> or <tt>-as</tt></td> </tr> <tr><a name="as"> <td><tt>-as</tt></td> - <td>Silence any diagnostic output for anonymous types. - (default is output of error message).</td> + <td>Silence any diagnostic output for anonymous types (default).</td> - <td>This option has been added as a nicety for dealing with legacy - IDL files, written before anonymous types were deprecated.</td> + <td>This behavior can be selected globally by defining IDL_ANON_SILENT in + config.h. It may then be overridden locally by + <tt>-aw</tt> or <tt>-ae</tt></td> </tr> <tr><a name="GC flag"> diff --git a/TAO/tests/IDL_Test/IDL_Test.mpc b/TAO/tests/IDL_Test/IDL_Test.mpc index d4c449c42a5..4b865bc15ab 100644 --- a/TAO/tests/IDL_Test/IDL_Test.mpc +++ b/TAO/tests/IDL_Test/IDL_Test.mpc @@ -15,6 +15,7 @@ project(*IDL): taoserver, messaging, gen_ostream { } IDL_Files { + array.idl Bug_2350_Regression.idl Bug_2577_Regression.idl Bug_2582_Regression.idl @@ -24,14 +25,21 @@ project(*IDL): taoserver, messaging, gen_ostream { Bug_3243_Regression.idl Bug_3819_Regression.idl Bug_3821_Regression.idl + enum_in_struct.idl full.idl fwd.idl gperf.idl + included.idl + including.idl + interface.idl nested_scope.idl old_constants.idl simple.idl simple2.idl + old_array.idl + old_sequence.idl + old_struct.idl old_union.idl old_union2.idl @@ -40,13 +48,17 @@ project(*IDL): taoserver, messaging, gen_ostream { struct.idl reopen_include1.idl reopen_include2.idl + sequence.idl typeprefix.idl + union.idl } IDL_Files { idlflags += -GA + anonymous.idl array_only.idl constants.idl + dif2.idl generic_object.idl keywords.idl @@ -58,28 +70,8 @@ project(*IDL): taoserver, messaging, gen_ostream { repo_id_mod.idl typedef.idl typecode.idl - } - - IDL_Files { - idlflags += -GA -as - anonymous.idl - dif2.idl valuetype.idl } - - IDL_Files { - idlflags += -as - array.idl - enum_in_struct.idl - included.idl - including.idl - interface.idl - old_array.idl - old_sequence.idl - old_struct.idl - sequence.idl - union.idl - } } project(*DLL): taoidldefaults, taolib, messaging { |