Commit 36bfb94e authored by Kevin Modzelewski's avatar Kevin Modzelewski

ifdef out some only-for-debug variables

parent 07158a65
...@@ -55,14 +55,21 @@ private: ...@@ -55,14 +55,21 @@ private:
bool out_success; bool out_success;
RewriterVar* out_rtn; RewriterVar* out_rtn;
ReturnConvention out_return_convention; ReturnConvention out_return_convention;
#ifndef NDEBUG
bool return_convention_checked; bool return_convention_checked;
#endif
public: public:
_ReturnConventionBase() _ReturnConventionBase()
: out_success(false), : out_success(false),
out_rtn(NULL), out_rtn(NULL),
out_return_convention(ReturnConvention::UNSPECIFIED), out_return_convention(ReturnConvention::UNSPECIFIED)
return_convention_checked(false) {} #ifndef NDEBUG
,
return_convention_checked(false)
#endif
{
}
#ifndef NDEBUG #ifndef NDEBUG
~_ReturnConventionBase() { ~_ReturnConventionBase() {
...@@ -112,13 +119,17 @@ public: ...@@ -112,13 +119,17 @@ public:
out_success = false; out_success = false;
out_rtn = NULL; out_rtn = NULL;
out_return_convention = ReturnConvention::UNSPECIFIED; out_return_convention = ReturnConvention::UNSPECIFIED;
#ifndef NDEBUG
return_convention_checked = false; return_convention_checked = false;
#endif
} }
RewriterVar* getReturn(ReturnConvention required_convention) { RewriterVar* getReturn(ReturnConvention required_convention) {
assert(isSuccessful()); assert(isSuccessful());
assert(this->out_return_convention == required_convention); assert(this->out_return_convention == required_convention);
#ifndef NDEBUG
return_convention_checked = true; return_convention_checked = true;
#endif
return this->out_rtn; return this->out_rtn;
} }
...@@ -126,12 +137,16 @@ public: ...@@ -126,12 +137,16 @@ public:
assert(isSuccessful()); assert(isSuccessful());
ASSERT(this->out_return_convention == required_convention, "user asked for convention %d but got %d", ASSERT(this->out_return_convention == required_convention, "user asked for convention %d but got %d",
required_convention, this->out_return_convention); required_convention, this->out_return_convention);
#ifndef NDEBUG
return_convention_checked = true; return_convention_checked = true;
#endif
} }
std::pair<RewriterVar*, ReturnConvention> getReturn() { std::pair<RewriterVar*, ReturnConvention> getReturn() {
assert(isSuccessful()); assert(isSuccessful());
#ifndef NDEBUG
return_convention_checked = true; return_convention_checked = true;
#endif
return std::make_pair(this->out_rtn, this->out_return_convention); return std::make_pair(this->out_rtn, this->out_return_convention);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment