summaryrefslogtreecommitdiff
path: root/CIAO/CIDLC/ExecutorMappingGenerator.cpp
diff options
context:
space:
mode:
authorparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-05-28 14:11:33 +0000
committerparsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2009-05-28 14:11:33 +0000
commit9159ba48b1feeb64cf1ab9a5f684a851321335b9 (patch)
treecb90dc099d0747183e9c965aea287605fb2a3946 /CIAO/CIDLC/ExecutorMappingGenerator.cpp
parentd3528a35da5a657089baf3b1c93abf49c935ae19 (diff)
downloadATCD-9159ba48b1feeb64cf1ab9a5f684a851321335b9.tar.gz
ChangeLogTag: Thu May 28 14:01:45 UTC 2009 Jeff Parsons <j.parsons@vanderbilt.edu>
Diffstat (limited to 'CIAO/CIDLC/ExecutorMappingGenerator.cpp')
-rw-r--r--CIAO/CIDLC/ExecutorMappingGenerator.cpp36
1 files changed, 32 insertions, 4 deletions
diff --git a/CIAO/CIDLC/ExecutorMappingGenerator.cpp b/CIAO/CIDLC/ExecutorMappingGenerator.cpp
index e5aa0a8b445..8bd8f38d7a6 100644
--- a/CIAO/CIDLC/ExecutorMappingGenerator.cpp
+++ b/CIAO/CIDLC/ExecutorMappingGenerator.cpp
@@ -1649,8 +1649,9 @@ namespace
Traversal::BracketIncludes,
Emitter
{
- IncludesEmitter (Context& c, ostream& os)
- : Emitter (c, os)
+ IncludesEmitter (Context& c, ostream& os, CommandLine const& cl)
+ : Emitter (c, os),
+ cl_ (cl)
{
}
@@ -1658,6 +1659,14 @@ namespace
traverse (SemanticGraph::QuoteIncludes& qi)
{
os << "#include \"" << qi.file ().string () << "\"" << endl;
+
+ string enclosing = cl_.get_value ("lem-enclosing-module", "");
+
+ if (enclosing != "")
+ {
+ os << endl << "module " << enclosing << endl
+ << "{";
+ }
}
virtual void
@@ -1665,6 +1674,9 @@ namespace
{
os << "#include <" << bi.file ().string () << ">" << endl;
}
+
+ private:
+ CommandLine const& cl_;
};
}
@@ -1693,6 +1705,14 @@ options (CL::Description& d)
"Use provided regular expression when constructing "
"name of local executor mapping file.",
CL::OptionType::value));
+
+ d.add_option (CL::OptionDescription (
+ "lem-enclosing-module",
+ "name",
+ "Adds an enclosing module to the entire IDL file "
+ "to disambiguate repeated code generation of "
+ "inherited facets.",
+ CL::OptionType::value));
}
@@ -1942,7 +1962,7 @@ generate (CommandLine const& cl,
{
os << "#include <ciao/Contexts/Swapping/CIAO_UpgradeableContext.idl>" << endl;
}
-
+
Traversal::TranslationUnit unit;
// Layer 1
@@ -1968,7 +1988,7 @@ generate (CommandLine const& cl,
Traversal::ContainsRoot contains_root;
Traversal::QuoteIncludes quote_includes;
Traversal::BracketIncludes bracket_includes;
- IncludesEmitter includes_emitter (ctx, os);
+ IncludesEmitter includes_emitter (ctx, os, cl);
principal_region.edge_traverser (includes_emitter);
@@ -2095,5 +2115,13 @@ generate (CommandLine const& cl,
// end
unit.traverse (tu);
+
+ string enclosing = cl.get_value ("lem-enclosing-module", "");
+
+ if (enclosing != "")
+ {
+ os << endl
+ << "};" << endl;
+ }
}
}