Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tao_idl Improvements #1357

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
10 changes: 5 additions & 5 deletions ACE/ACE-INSTALL.html
Original file line number Diff line number Diff line change
Expand Up @@ -1361,7 +1361,7 @@ <h3><a name="VxWorks/SharedLibs">Building Shared Libraries for VxWorks</a>.</h3>
# include "ace/config-vxworks5.x.h"
#endif
</pre><p>
</p></li><li>Set your <code>ACE_ROOT</code>, <code>CPP_LOCATION</code>,
</p></li><li>Set your <code>ACE_ROOT</code>, <code>TAO_IDL_PREPROCESSOR</code>,
<code>WIND_BASE</code>, and <code>WIND_HOST_TYPE</code> environment
variables.<p>
</p></li><li>Build for NT, then build for VxWorks.<p>
Expand Down Expand Up @@ -1411,7 +1411,7 @@ <h3><a name="VxWorks/SharedLibs">Building Shared Libraries for VxWorks</a>.</h3>
SHELL=/bin/sh.exe
TERM=pcbios
TAO_ROOT=/ace/ACE_wrappers.vxworks/TAO
CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.EXE
TAO_IDL_PREPROCESSOR=/Program Files/DevStudio/VC/bin/CL.EXE
GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
WIND_HOST_TYPE=x86-win32
ACE_ROOT=/ace/ACE_wrappers.vxworks
Expand Down Expand Up @@ -1467,13 +1467,13 @@ <h3>TAO on NT Tornado host, VxWorks target.</h3>
<code>ACE_wrappers/apps/gperf/src</code>.<p>

</p></li><li>Build $TAO_ROOT/tao
<pre> CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
<pre> TAO_IDL_PREPROCESSOR=/Program Files/DevStudio/VC/bin/CL.exe
cd $TAO_ROOT/tao
/gnuwin32/b18/H-i386-cygwin32/bin/make
</pre>

</li><li>Build orbsvcs.
<pre> CPP_LOCATION=/Program Files/DevStudio/VC/bin/CL.exe
<pre> TAO_IDL_PREPROCESSOR=/Program Files/DevStudio/VC/bin/CL.exe
cd $TAO_ROOT/orbsvcs/orbsvcs
/gnuwin32/b18/H-i386-cygwin32/bin/make
</pre>
Expand Down Expand Up @@ -1528,7 +1528,7 @@ <h3><a href="mailto:[email protected]">Jaffar Shaikh's</a>
SHELL=/bin/sh.exe
TERM=pcbios
TAO_ROOT=/Corba/ACE_wrapper/Tao
CPP_LOCATION=/Program Files/Microsoft Visual Studio/VC98/Bin/CL.exe
TAO_IDL_PREPROCESSOR=/Program Files/Microsoft Visual Studio/VC98/Bin/CL.exe
GCC_EXEC_PREFIX=/tornado/host/x86-win32/lib/gcc-lib/
WIND_HOST_TYPE=x86-win32
PERL_PATH=/perl/bin/perl.exe
Expand Down
17 changes: 17 additions & 0 deletions TAO/NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,23 @@ USER VISIBLE CHANGES BETWEEN TAO-2.5.12 and TAO-3.0.0

. Add portspan support to DIOP

. TAO IDL:

. IDL 4 is now the default IDL version. Note that IDL 4 support is still
incomplete.

. Version of IDL specification being used is available as the
`__TAO_IDL_IDL_VERSION` preprocessor macro.

. Support for the long deprecated `CPP_LOCATION` and
`TAO_IDL_DEFAULT_CPP_FLAGS` environment variables has been removed; replace
with `TAO_IDL_PREPROCESSOR` and `TAO_IDL_PREPROCESSOR` respectively.

. To make behavior of `#include ".."` consistent with C and C++, how `tao_idl`
calls the C preprocessor by default in most cases has changed from making a
copy of the IDL file to using the IDL file directly. For details, see the
`--preprocessor-input` argument in `docs/compiler.html`.

USER VISIBLE CHANGES BETWEEN TAO-2.5.11 and TAO-2.5.12
======================================================

Expand Down
131 changes: 86 additions & 45 deletions TAO/TAO_IDL/driver/drv_args.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ trademarks or registered trademarks of Sun Microsystems, Inc.
extern long DRV_nfiles;
extern char *DRV_files[];

void process_long_option(long ac, char **av, long &i);
void process_long_option (long ac, char **av, long &i);

// Push a file into the list of files to be processed
void
Expand Down Expand Up @@ -124,46 +124,42 @@ DRV_usage ()
ACE_TEXT ("%C: usage: %C [[flag|file] ...] [-- file ...]\n"),
idl_global->prog_name (),
idl_global->prog_name ()));

ACE_DEBUG ((LM_DEBUG,
ACE_TEXT ("Legal flags:\n")
ACE_TEXT (" -h | --help | -u\tPrint this list and exit successfully\n")
ACE_TEXT (" -A...\t\t\tlocal implementation-specific escape\n")
ACE_TEXT (" -Cw\t\t\tWarning if identifier spellings differ ")
ACE_TEXT ("only in case (default is error)\n")
ACE_TEXT (" -Ce\t\t\tError if identifier spellings differ ")
ACE_TEXT ("only in case (default)\n")
ACE_TEXT (" -ae\t\t\tError if anonymous type is seen ")
ACE_TEXT ("(default)\n")
ACE_TEXT (" -aw\t\t\tWarning if anonymous type is seen ")
ACE_TEXT ("(default is error)\n")
ACE_TEXT (" -as\t\t\tSilences the anonymous type diagnostic ")
ACE_TEXT ("(default is error)\n")
ACE_TEXT (" -d | --dump\t\tPrints a dump of the AST and exits\n")
ACE_TEXT (" -Dname[=value]\t\tdefines name for preprocessor\n")
ACE_TEXT (" -E\t\t\truns preprocessor only, prints on stdout\n")
ACE_TEXT (" -Idir\t\t\tincludes dir in search path for preprocessor\n")
ACE_TEXT (" -t\t\t\tTemporary directory to be used")
ACE_TEXT (" by the IDL compiler.\n")
ACE_TEXT (" -Uname\t\t\tundefines name for preprocessor\n")
ACE_TEXT (" -v\t\t\ttraces compilation stages\n")
ACE_TEXT (" -V | --version\t\tprints version info then exits\n")
ACE_TEXT (" -w\t\t\tsuppresses IDL compiler warning messages\n")
ACE_TEXT (" -Wp,<arg1,...,argn>\tpasses args to preprocessor\n")
ACE_TEXT (" -Yp,path\t\tdefines location of preprocessor\n")
ACE_TEXT (" --idl-version VERSION\tSet the version of IDL to use\n")
ACE_TEXT (" --default-idl-version\tPrint the default IDL version and exit\n")
ACE_TEXT (" --list-idl-versions\tPrint IDL versions supported and exit\n")
ACE_TEXT (" --syntax-only\t\tJust check the syntax, do not create files\n")
ACE_TEXT (" --bison-trace\t\tEnable Bison Tracing (sets yydebug to 1)\n")
ACE_TEXT (" --dump-builtins\tDump the compiler and user defined IDL.\n")
ACE_TEXT (" --just-dump-builtins\tJust dump the compiler defined IDL and exit.\n")
ACE_TEXT (" --unknown-annotations ARG\t")
ACE_TEXT ("Set reaction to unknown annotations. ARG must be one of the following:\n")
ACE_TEXT ("\t\t\t\twarn-once\tThe default, warn once per unique local name\n")
ACE_TEXT ("\t\t\t\twarn-all\tWarn for all unknown annotations\n")
ACE_TEXT ("\t\t\t\terror\t\tCauses the process to exit with a failed return status\n")
ACE_TEXT ("\t\t\t\tignore\t\tDon't report unknown annotations\n")
ACE_TEXT (" -h | --help | -u Print this list and exit successfully\n")
ACE_TEXT (" -A... Local implementation-specific escape\n")
ACE_TEXT (" -Cw Warning if identifier spellings differ\n")
ACE_TEXT (" only in case (default is error)\n")
ACE_TEXT (" -Ce Error if identifier spellings differ only in case\n")
ACE_TEXT (" (default)\n")
ACE_TEXT (" -ae Error if anonymous type is seen (default)\n")
ACE_TEXT (" -aw Warning if anonymous type is seen (default is error)\n")
ACE_TEXT (" -as Silences the anonymous type error (default is error)\n")
ACE_TEXT (" -d | --dump Prints a dump of the AST and exits\n")
ACE_TEXT (" -Dname[=value] Defines name for preprocessor\n")
ACE_TEXT (" -E Runs preprocessor only, prints on stdout\n")
ACE_TEXT (" -Idir Includes dir in search path for preprocessor\n")
ACE_TEXT (" -t Temporary directory to be used by the IDL compiler.\n")
ACE_TEXT (" -Uname Undefines name for preprocessor\n")
ACE_TEXT (" -v Traces compilation stages\n")
ACE_TEXT (" -V | --version Prints version info then exits\n")
ACE_TEXT (" -w Suppresses IDL compiler warning messages\n")
ACE_TEXT (" -Wp,<arg1,...,argn> Passes args to preprocessor\n")
ACE_TEXT (" -Yp,path Defines location of preprocessor\n")
ACE_TEXT (" --idl-version VERSION Set the version of IDL to use\n")
ACE_TEXT (" --default-idl-version Print the default IDL version and exit\n")
ACE_TEXT (" --list-idl-versions Print IDL versions supported and exit\n")
ACE_TEXT (" --syntax-only Just check the syntax, do not create files\n")
ACE_TEXT (" --bison-trace Enable Bison Tracing (sets yydebug to 1)\n")
ACE_TEXT (" --dump-builtins Dump the compiler and user defined IDL.\n")
ACE_TEXT (" --just-dump-builtins Just dump the compiler defined IDL and exit.\n")
ACE_TEXT (" --unknown-annotations ARG Set reaction to unknown annotations.\n")
ACE_TEXT (" ARG must be `warn-once` (default), `warn-all`,\n")
ACE_TEXT (" `error`, or `ignore`.\n")
ACE_TEXT (" --preprocessor-input KIND Set C preprocessor file input method. KIND must \n")
ACE_TEXT (" be `guess` (default), `direct-with-e`, \n")
ACE_TEXT (" `direct-without-e`, `direct-gcc`, or `copy`.\n")
ACE_TEXT (" See docs/compiler.html for more info.\n")
));

be_util::usage ();
Expand Down Expand Up @@ -493,7 +489,7 @@ DRV_parse_args (long ac, char **av)
}
else
{
process_long_option(ac, av, i);
process_long_option (ac, av, i);
}
break;

Expand Down Expand Up @@ -564,7 +560,7 @@ DRV_parse_args (long ac, char **av)
}

void
print_idl_versions()
print_idl_versions ()
{
ACE_DEBUG ((LM_INFO,
ACE_TEXT ("These are the valid IDL versions this compiler will accept:\n")
Expand All @@ -578,7 +574,7 @@ print_idl_versions()
}

void
process_long_option(long ac, char **av, long &i)
process_long_option (long ac, char **av, long &i)
{
const char *long_option = av[i] + 2;
bool no_more_args = i + 1 >= ac;
Expand Down Expand Up @@ -688,21 +684,66 @@ process_long_option(long ac, char **av, long &i)
{
invalid_argument = true;
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("\"%C\" is not a valid argument.\n"),
ACE_TEXT ("\"%C\" is not a valid argument to --unknown-annotations.\n"),
av[i]
));
}
}
if (invalid_argument)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("Use either \"warn-once\", \"warn-all\", ")
ACE_TEXT ("\"error\" or \"ignore\".\n"),
ACE_TEXT ("Use \"warn-once\", \"warn-all\", \"error\" or \"ignore\".\n"),
av[i]
));
idl_global->parse_args_exit (1);
}
}
else if (!ACE_OS::strcmp (long_option, "preprocessor-input"))
{
bool invalid_argument = no_more_args;
if (no_more_args)
{
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("--preprocessor-input is missing its required argument.")));
}
else
{
i++;
if (!ACE_OS::strcmp (av[i], "guess"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can use std::strcmp now without problems

{
idl_global->preprocessor_input_ = IDL_GlobalData::PreprocessorInputGuess;
}
else if (!ACE_OS::strcmp (av[i], "direct-with-e"))
{
idl_global->preprocessor_input_ = IDL_GlobalData::PreprocessorInputDirectWithE;
}
else if (!ACE_OS::strcmp (av[i], "direct-without-e"))
{
idl_global->preprocessor_input_ = IDL_GlobalData::PreprocessorInputDirectWithoutE;
}
else if (!ACE_OS::strcmp (av[i], "direct-gcc"))
{
idl_global->preprocessor_input_ = IDL_GlobalData::PreprocessorInputDirectGcc;
}
else if (!ACE_OS::strcmp (av[i], "copy"))
{
idl_global->preprocessor_input_ = IDL_GlobalData::PreprocessorInputCopy;
}
else
{
invalid_argument = true;
ACE_ERROR ((LM_ERROR,
ACE_TEXT ("\"%C\" is not a valid argument to --preprocessor-input.\n"), av[i]));
}
}
if (invalid_argument)
{
ACE_ERROR ((LM_ERROR, ACE_TEXT ("Use \"guess\", \"direct-with-e\", ")
ACE_TEXT ("\"direct-without-e\", \"direct-gcc\", or \"copy\".\n"),
av[i]));
idl_global->parse_args_exit (1);
}
}
else
{
be_global->parse_args (i, av);
Expand Down
Loading