summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFred Hornsey <hornseyf@objectcomputing.com>2018-12-04 12:47:14 -0600
committerFred Hornsey <hornseyf@objectcomputing.com>2018-12-04 12:47:14 -0600
commit09cd46ab639c77bb4bf8c9ce575142f12cf83208 (patch)
tree51a0c54476a8c8a7eb0d02546cb0e8b4551650e9
parent96e4c7daeb8b3a762418a3c9004169b147c955c3 (diff)
downloadATCD-09cd46ab639c77bb4bf8c9ce575142f12cf83208.tar.gz
tao_idl: create default IDL version variable
-rw-r--r--TAO/TAO_IDL/be/be_init.cpp2
-rw-r--r--TAO/TAO_IDL/driver/drv_args.cpp2
-rw-r--r--TAO/TAO_IDL/include/idl_global.h7
-rw-r--r--TAO/TAO_IDL/include/idl_version.h10
-rw-r--r--TAO/TAO_IDL/tao_idl.cpp3
-rw-r--r--TAO/TAO_IDL/util/idl_version.cpp2
-rw-r--r--TAO/tests/IDLv4/annotations/be_init.cpp2
7 files changed, 21 insertions, 7 deletions
diff --git a/TAO/TAO_IDL/be/be_init.cpp b/TAO/TAO_IDL/be/be_init.cpp
index 0bc55c7d168..691eb0056cd 100644
--- a/TAO/TAO_IDL/be/be_init.cpp
+++ b/TAO/TAO_IDL/be/be_init.cpp
@@ -18,6 +18,8 @@ BE_init (int &, ACE_TCHAR *[])
BE_GlobalData,
-1);
+ idl_global->default_idl_version_ = IDL_VERSION_3;
+
return 0;
}
diff --git a/TAO/TAO_IDL/driver/drv_args.cpp b/TAO/TAO_IDL/driver/drv_args.cpp
index e407e665861..5a5377f7849 100644
--- a/TAO/TAO_IDL/driver/drv_args.cpp
+++ b/TAO/TAO_IDL/driver/drv_args.cpp
@@ -617,7 +617,7 @@ process_long_option(long ac, char **av, long &i)
else if (!ACE_OS::strcmp (long_option, "default-idl-version"))
{
ACE_DEBUG ((LM_INFO, ACE_TEXT ("%C\n"),
- IdlVersion (DEFAULT_IDL_VERSION).to_string ()));
+ idl_global->default_idl_version_.to_string ()));
idl_global->parse_args_exit (0);
}
else if (!ACE_OS::strcmp (long_option, "list-idl-versions"))
diff --git a/TAO/TAO_IDL/include/idl_global.h b/TAO/TAO_IDL/include/idl_global.h
index e492620e7ce..b5838e0ff58 100644
--- a/TAO/TAO_IDL/include/idl_global.h
+++ b/TAO/TAO_IDL/include/idl_global.h
@@ -815,6 +815,13 @@ public:
IdlVersion idl_version_;
/**
+ * Default version of IDL to enforce. Compilers extending tao_idl coould set
+ * idl_version_ directly, but this allows Can be set to allow
+ * --default-idl-version to print an accuate default IDL version.
+ */
+ IdlVersion default_idl_version_;
+
+ /**
* Perform the compilation process right up until invoking the backend.
* In other words just check the syntax of the input files, do not create
* any output.
diff --git a/TAO/TAO_IDL/include/idl_version.h b/TAO/TAO_IDL/include/idl_version.h
index 7f7f8a5cec2..d76d79dff12 100644
--- a/TAO/TAO_IDL/include/idl_version.h
+++ b/TAO/TAO_IDL/include/idl_version.h
@@ -45,10 +45,12 @@ enum TAO_IDL_FE_Export SpecificIdlVersion
IDL_VERSION_COUNT
};
-/*
- * Default version of IDL to use if no other options are given.
+/**
+ * Default version of IDL to use if BE does not specify a default version.
+ * This is so that BE can control the version without overriding idl_version_
+ * directly and making --default-idl-version incorrect.
*/
-const SpecificIdlVersion DEFAULT_IDL_VERSION = IDL_VERSION_3;
+const SpecificIdlVersion DEFAULT_DEFAULT_IDL_VERSION = IDL_VERSION_3;
/**
* Class Operations involving SpecificIdlVersion Values
@@ -57,7 +59,7 @@ class TAO_IDL_FE_Export IdlVersion
{
public:
/**
- * New IdlVersion set to DEFAULT_IDL_VERSION.
+ * New IdlVersion set to DEFAULT_DEFAULT_IDL_VERSION.
*/
IdlVersion ();
diff --git a/TAO/TAO_IDL/tao_idl.cpp b/TAO/TAO_IDL/tao_idl.cpp
index 4ea6368baeb..a21592d926c 100644
--- a/TAO/TAO_IDL/tao_idl.cpp
+++ b/TAO/TAO_IDL/tao_idl.cpp
@@ -329,6 +329,9 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[])
throw Bailout ();
}
+ // Give BE chance to set default IDL version using BE_init
+ idl_global->idl_version_ = idl_global->default_idl_version_;
+
// Parse arguments.
DRV_parse_args (atc.get_argc (), atc.get_ASCII_argv ());
diff --git a/TAO/TAO_IDL/util/idl_version.cpp b/TAO/TAO_IDL/util/idl_version.cpp
index 235e894990c..14a70dc821c 100644
--- a/TAO/TAO_IDL/util/idl_version.cpp
+++ b/TAO/TAO_IDL/util/idl_version.cpp
@@ -13,7 +13,7 @@ static const char * idlVersionNames[IDL_VERSION_COUNT] = {
"4"
};
-IdlVersion::IdlVersion () : version_(DEFAULT_IDL_VERSION)
+IdlVersion::IdlVersion () : version_(DEFAULT_DEFAULT_IDL_VERSION)
{
}
diff --git a/TAO/tests/IDLv4/annotations/be_init.cpp b/TAO/tests/IDLv4/annotations/be_init.cpp
index 99d59a827a8..2758a77ae35 100644
--- a/TAO/tests/IDLv4/annotations/be_init.cpp
+++ b/TAO/tests/IDLv4/annotations/be_init.cpp
@@ -38,7 +38,7 @@ BE_init (int&, ACE_TCHAR*[])
ACE_NEW_RETURN (be_global, BE_GlobalData, -1);
// Enable Annotations
- idl_global->idl_version_.version (IDL_VERSION_4);
+ idl_global->default_idl_version_ = IDL_VERSION_4;
// Disable Trying to Parse File Arguments and creating File Output
idl_global->ignore_files_ = true;