diff options
author | Fred Hornsey <hornseyf@objectcomputing.com> | 2020-06-10 02:02:11 -0500 |
---|---|---|
committer | Fred Hornsey <hornseyf@objectcomputing.com> | 2020-06-10 02:02:11 -0500 |
commit | ff725437a997295f0372195cacd04997030381c1 (patch) | |
tree | dd2c9cf1d68b207ee661ee8753066316f3134f2d | |
parent | 757eb4f5a158b60c233062fa0a8543ffaaced513 (diff) | |
download | ATCD-ff725437a997295f0372195cacd04997030381c1.tar.gz |
TAO IDL FE: override for IDL4 anon_type_diagnostic
To allow incompatible backends to avoid having to deal with anonymous
types when using IDL4.
-rw-r--r-- | TAO/TAO_IDL/include/idl_global.h | 1 | ||||
-rw-r--r-- | TAO/TAO_IDL/util/utl_global.cpp | 28 |
2 files changed, 19 insertions, 10 deletions
diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h index 2431423d4ef..89377f4a987 100644 --- a/TAO/TAO_IDL/include/idl_global.h +++ b/TAO/TAO_IDL/include/idl_global.h @@ -1067,6 +1067,7 @@ private: AST_Module *corba_module_; ANON_TYPE_DIAGNOSTIC anon_type_diagnostic_; + bool explicit_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_global.cpp b/TAO/TAO_IDL/util/utl_global.cpp index 38ada2091ad..34a0c11ce19 100644 --- a/TAO/TAO_IDL/util/utl_global.cpp +++ b/TAO/TAO_IDL/util/utl_global.cpp @@ -169,6 +169,7 @@ IDL_GlobalData::IDL_GlobalData (void) included_ami_receps_done_ (false), corba_module_ (0), anon_type_diagnostic_ (ANON_TYPE_ERROR), + explicit_anon_type_diagnostic_ (false), in_typedef_ (false), in_tmpl_mod_no_alias_ (false), in_tmpl_mod_alias_ (false) @@ -226,11 +227,11 @@ IDL_GlobalData::IDL_GlobalData (void) } #if defined (IDL_ANON_ERROR) - this->anon_type_diagnostic_ = ANON_TYPE_ERROR; + anon_type_diagnostic (ANON_TYPE_ERROR); #elif defined (IDL_ANON_WARNING) - this->anon_type_diagnostic_ = ANON_TYPE_WARNING; + anon_type_diagnostic (ANON_TYPE_WARNING); #elif defined (IDL_ANON_SILENT) - this->anon_type_diagnostic_ = ANON_TYPE_SILENT; + anon_type_diagnostic (ANON_TYPE_SILENT); #endif // ambiguous_type_seen_ and basic_type_seen_ are not reset between @@ -1838,28 +1839,35 @@ void IDL_GlobalData::anon_type_diagnostic ( IDL_GlobalData::ANON_TYPE_DIAGNOSTIC val) { - this->anon_type_diagnostic_ = val; + anon_type_diagnostic_ = val; + explicit_anon_type_diagnostic_ = true; } bool IDL_GlobalData::anon_error (void) const { - return anon_type_diagnostic_ == ANON_TYPE_ERROR && - idl_version_ < IDL_VERSION_4; + if (idl_version_ >= IDL_VERSION_4 && !explicit_anon_type_diagnostic_) { + return false; + } + return anon_type_diagnostic_ == ANON_TYPE_ERROR; } bool IDL_GlobalData::anon_warning (void) const { - return anon_type_diagnostic_ == ANON_TYPE_WARNING && - idl_version_ < IDL_VERSION_4; + if (idl_version_ >= IDL_VERSION_4 && !explicit_anon_type_diagnostic_) { + return false; + } + return anon_type_diagnostic_ == ANON_TYPE_WARNING; } bool IDL_GlobalData::anon_silent (void) const { - return anon_type_diagnostic_ == ANON_TYPE_SILENT || - idl_version_ >= IDL_VERSION_4; + if (idl_version_ >= IDL_VERSION_4 && !explicit_anon_type_diagnostic_) { + return true; + } + return anon_type_diagnostic_ == ANON_TYPE_SILENT; } bool |