diff options
author | Mark Spruiell <mes@zeroc.com> | 2010-03-09 16:01:54 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2010-03-09 16:01:54 -0800 |
commit | d14b4973bf8f25282b70e72ec5f577f71dfcded7 (patch) | |
tree | 3651f5139695829d2bf882b7422116662a2d39f8 /cpp/src/slice2cpp | |
parent | bug 4704 - template error in nested Slice definition (diff) | |
download | ice-d14b4973bf8f25282b70e72ec5f577f71dfcded7.tar.bz2 ice-d14b4973bf8f25282b70e72ec5f577f71dfcded7.tar.xz ice-d14b4973bf8f25282b70e72ec5f577f71dfcded7.zip |
Cleaning up translator and adding tests related to bug 4704.
This commit does NOT need to be included in the official patch for
this bug.
Diffstat (limited to 'cpp/src/slice2cpp')
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 22 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.h | 2 |
2 files changed, 5 insertions, 19 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 4e68b64aa84..998dd7ed2ec 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -6621,14 +6621,11 @@ Slice::Gen::StreamVisitor::StreamVisitor(Output& h, Output& c) : bool Slice::Gen::StreamVisitor::visitModuleStart(const ModulePtr& m) { - if(!m->hasOtherConstructedOrExceptions()) - { - return false; - } - else if(m->structs().empty() && m->enums().empty() && m->exceptions().empty()) + if(m->structs().empty() && m->enums().empty() && m->exceptions().empty()) { return false; } + if(UnitPtr::dynamicCast(m->container())) { // @@ -6641,6 +6638,7 @@ Slice::Gen::StreamVisitor::visitModuleStart(const ModulePtr& m) H.restoreIndent(); H << nl << "namespace Ice" << nl << '{'; } + return true; } @@ -6671,12 +6669,7 @@ Slice::Gen::StreamVisitor::visitExceptionStart(const ExceptionPtr& p) H << nl << "static const ::Ice::StreamTraitType type = ::Ice::StreamTraitTypeUserException;"; H << eb << ";" << nl; } - return true; -} - -void -Slice::Gen::StreamVisitor::visitExceptionEnd(const ExceptionPtr&) -{ + return false; } bool @@ -6707,12 +6700,7 @@ Slice::Gen::StreamVisitor::visitStructStart(const StructPtr& p) H << nl << "static const int minWireSize = " << p->minWireSize() << ";"; H << eb << ";" << nl; } - return true; -} - -void -Slice::Gen::StreamVisitor::visitStructEnd(const StructPtr&) -{ + return false; } void diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index 3a514499bf0..b262fbae6fb 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -445,9 +445,7 @@ private: virtual bool visitModuleStart(const ModulePtr&); virtual void visitModuleEnd(const ModulePtr&); virtual bool visitStructStart(const StructPtr&); - virtual void visitStructEnd(const StructPtr&); virtual bool visitExceptionStart(const ExceptionPtr&); - virtual void visitExceptionEnd(const ExceptionPtr&); virtual void visitEnum(const EnumPtr&); private: |