StaException -> Exception
This commit is contained in:
parent
88c9cd3c39
commit
9cacb0cfd9
|
|
@ -16,7 +16,7 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
%include "StaException.i"
|
||||
%include "Exception.i"
|
||||
%include "StaTcl.i"
|
||||
%include "Verilog.i"
|
||||
%include "NetworkEdit.i"
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@
|
|||
|
||||
This file summarizes STA API changes for each release.
|
||||
|
||||
Release 2.0.18 2020/02/15
|
||||
-------------------------
|
||||
|
||||
The following iterator functions are deprecated:
|
||||
|
||||
TimingArcSet::timingArcIterator()
|
||||
|
|
@ -38,6 +41,7 @@ use the following:
|
|||
TimingArc *arc = arc_iter.next();
|
||||
}
|
||||
|
||||
StaException renamed to Exception
|
||||
|
||||
Release 2.0.17 2019/11/11
|
||||
-------------------------
|
||||
|
|
|
|||
|
|
@ -148,7 +148,7 @@ setNameCmp(NetSet *set1,
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
const char *
|
||||
EmptyExpceptionPt::what() const throw()
|
||||
EmptyExpceptionPt::what() const noexcept
|
||||
{
|
||||
return "empty exception from/through/to.";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -656,10 +656,10 @@ private:
|
|||
};
|
||||
|
||||
// Exception thrown by check.
|
||||
class EmptyExpceptionPt : public StaException
|
||||
class EmptyExpceptionPt : public Exception
|
||||
{
|
||||
public:
|
||||
virtual const char *what() const throw();
|
||||
virtual const char *what() const noexcept;
|
||||
};
|
||||
|
||||
// Throws EmptyExpceptionPt it finds an empty exception point.
|
||||
|
|
|
|||
|
|
@ -68,13 +68,13 @@ delayPropertyValue(Delay delay,
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
class PropertyUnknown : public StaException
|
||||
class PropertyUnknown : public Exception
|
||||
{
|
||||
public:
|
||||
PropertyUnknown(const char *type,
|
||||
const char *property);
|
||||
virtual ~PropertyUnknown() THROW_DCL {}
|
||||
virtual const char *what() const throw();
|
||||
virtual ~PropertyUnknown() {}
|
||||
virtual const char *what() const noexcept;
|
||||
|
||||
private:
|
||||
const char *type_;
|
||||
|
|
@ -83,13 +83,14 @@ private:
|
|||
|
||||
PropertyUnknown::PropertyUnknown(const char *type,
|
||||
const char *property) :
|
||||
Exception(),
|
||||
type_(type),
|
||||
property_(property)
|
||||
{
|
||||
}
|
||||
|
||||
const char *
|
||||
PropertyUnknown::what() const throw()
|
||||
PropertyUnknown::what() const noexcept
|
||||
{
|
||||
return stringPrint("Error: %s objects do not have a %s property.",
|
||||
type_, property_);
|
||||
|
|
|
|||
|
|
@ -224,19 +224,20 @@ private:
|
|||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
class SubcktEndsMissing : public StaException
|
||||
class SubcktEndsMissing : public Exception
|
||||
{
|
||||
public:
|
||||
SubcktEndsMissing(const char *cell_name,
|
||||
const char *subckt_filename);
|
||||
const char *what() const throw();
|
||||
const char *what() const noexcept;
|
||||
|
||||
protected:
|
||||
string what_;
|
||||
};
|
||||
|
||||
SubcktEndsMissing::SubcktEndsMissing(const char *cell_name,
|
||||
const char *subckt_filename)
|
||||
const char *subckt_filename) :
|
||||
Exception()
|
||||
{
|
||||
what_ = "Error: spice subckt for cell ";
|
||||
what_ += cell_name;
|
||||
|
|
@ -245,7 +246,7 @@ SubcktEndsMissing::SubcktEndsMissing(const char *cell_name,
|
|||
}
|
||||
|
||||
const char *
|
||||
SubcktEndsMissing::what() const throw()
|
||||
SubcktEndsMissing::what() const noexcept
|
||||
{
|
||||
return what_.c_str();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,21 +16,16 @@
|
|||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
#include "Machine.hh"
|
||||
#include "Error.hh"
|
||||
|
||||
using sta::StaException;
|
||||
|
||||
%}
|
||||
|
||||
%exception {
|
||||
try { $function }
|
||||
catch (StaException &excp) {
|
||||
Tcl_SetResult(interp, const_cast<char*>(excp.what()), TCL_VOLATILE);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
catch (std::bad_alloc &) {
|
||||
fprintf(stderr, "Error: out of memory.\n");
|
||||
exit(0);
|
||||
}
|
||||
catch (std::exception &excp) {
|
||||
Tcl_SetResult(interp, const_cast<char*>(excp.what()), TCL_VOLATILE);
|
||||
return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
|
|
@ -108,17 +108,17 @@ typedef MinMaxAll MinMaxAllNull;
|
|||
typedef ClockSet TmpClockSet;
|
||||
typedef StringSeq TmpStringSeq;
|
||||
|
||||
class CmdErrorNetworkNotLinked : public StaException
|
||||
class CmdErrorNetworkNotLinked : public Exception
|
||||
{
|
||||
public:
|
||||
virtual const char *what() const throw()
|
||||
virtual const char *what() const noexcept
|
||||
{ return "Error: no network has been linked."; }
|
||||
};
|
||||
|
||||
class CmdErrorNetworkNotEditable : public StaException
|
||||
class CmdErrorNetworkNotEditable : public Exception
|
||||
{
|
||||
public:
|
||||
virtual const char *what() const throw()
|
||||
virtual const char *what() const noexcept
|
||||
{ return "Error: network does not support edits."; }
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -22,14 +22,14 @@
|
|||
|
||||
namespace sta {
|
||||
|
||||
StaException::StaException() :
|
||||
Exception::Exception() :
|
||||
std::exception()
|
||||
{
|
||||
}
|
||||
|
||||
StaExceptionLine::StaExceptionLine(const char *filename,
|
||||
int line) :
|
||||
StaException(),
|
||||
ExceptionLine::ExceptionLine(const char *filename,
|
||||
int line) :
|
||||
Exception(),
|
||||
filename_(filename),
|
||||
line_(line)
|
||||
{
|
||||
|
|
@ -38,13 +38,13 @@ StaExceptionLine::StaExceptionLine(const char *filename,
|
|||
InternalError::InternalError(const char *filename,
|
||||
int line,
|
||||
const char *msg) :
|
||||
StaExceptionLine(filename, line),
|
||||
ExceptionLine(filename, line),
|
||||
msg_(msg)
|
||||
{
|
||||
}
|
||||
|
||||
const char *
|
||||
InternalError::what() const throw()
|
||||
InternalError::what() const noexcept
|
||||
{
|
||||
return stringPrintTmp("Internal error in %s:%d %s.",
|
||||
filename_, line_, msg_);
|
||||
|
|
@ -56,7 +56,7 @@ FileNotReadable::FileNotReadable(const char *filename) :
|
|||
}
|
||||
|
||||
const char *
|
||||
FileNotReadable::what() const throw()
|
||||
FileNotReadable::what() const noexcept
|
||||
{
|
||||
return stringPrintTmp("Error: cannot read file %s.", filename_);
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ FileNotWritable::FileNotWritable(const char *filename) :
|
|||
}
|
||||
|
||||
const char *
|
||||
FileNotWritable::what() const throw()
|
||||
FileNotWritable::what() const noexcept
|
||||
{
|
||||
return stringPrintTmp("Error: cannot write file %s.", filename_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,32 +22,32 @@
|
|||
namespace sta {
|
||||
|
||||
// Abstract base class for sta exceptions.
|
||||
class StaException : public std::exception
|
||||
class Exception : public std::exception
|
||||
{
|
||||
public:
|
||||
StaException();
|
||||
virtual ~StaException() THROW_DCL {}
|
||||
virtual const char *what() const throw() = 0;
|
||||
Exception();
|
||||
virtual ~Exception() {}
|
||||
virtual const char *what() const noexcept = 0;
|
||||
};
|
||||
|
||||
class StaExceptionLine : public StaException
|
||||
class ExceptionLine : public Exception
|
||||
{
|
||||
public:
|
||||
StaExceptionLine(const char *filename,
|
||||
int line);
|
||||
ExceptionLine(const char *filename,
|
||||
int line);
|
||||
|
||||
protected:
|
||||
const char *filename_;
|
||||
int line_;
|
||||
};
|
||||
|
||||
class InternalError : public StaExceptionLine
|
||||
class InternalError : public ExceptionLine
|
||||
{
|
||||
public:
|
||||
InternalError(const char *filename,
|
||||
int line,
|
||||
const char *msg);
|
||||
virtual const char *what() const throw();
|
||||
virtual const char *what() const noexcept;
|
||||
|
||||
protected:
|
||||
const char *msg_;
|
||||
|
|
@ -64,22 +64,22 @@ protected:
|
|||
printf("Internal Error: %s:%d %s\n", __FILE__, __LINE__, msg)
|
||||
|
||||
// Failure opening filename for reading.
|
||||
class FileNotReadable : public StaException
|
||||
class FileNotReadable : public Exception
|
||||
{
|
||||
public:
|
||||
explicit FileNotReadable(const char *filename);
|
||||
virtual const char *what() const throw();
|
||||
virtual const char *what() const noexcept;
|
||||
|
||||
protected:
|
||||
const char *filename_;
|
||||
};
|
||||
|
||||
// Failure opening filename for writing.
|
||||
class FileNotWritable : public StaException
|
||||
class FileNotWritable : public Exception
|
||||
{
|
||||
public:
|
||||
explicit FileNotWritable(const char *filename);
|
||||
virtual const char *what() const throw();
|
||||
virtual const char *what() const noexcept;
|
||||
|
||||
protected:
|
||||
const char *filename_;
|
||||
|
|
|
|||
|
|
@ -62,9 +62,6 @@
|
|||
#define strtoull _strtoui64
|
||||
// Flex doesn't check for unistd.h.
|
||||
#define YY_NO_UNISTD_H
|
||||
// Visual c++ version of std::exception destructor missing throw()
|
||||
// declaration.
|
||||
#define THROW_DCL
|
||||
namespace sta {
|
||||
int vsnprint(char *str, size_t size, const char *fmt, va_list args);
|
||||
}
|
||||
|
|
@ -72,7 +69,6 @@
|
|||
#define DllExport
|
||||
#include <stdint.h> // intptr_t
|
||||
#define vsnprint vsnprintf
|
||||
#define THROW_DCL throw()
|
||||
#endif // _WINDOWS
|
||||
|
||||
#include <stddef.h>
|
||||
|
|
|
|||
|
|
@ -114,14 +114,14 @@ PatternMatch::matchNoCase(const char *str) const
|
|||
////////////////////////////////////////////////////////////////
|
||||
|
||||
RegexpCompileError::RegexpCompileError(const char *pattern) :
|
||||
StaException()
|
||||
Exception()
|
||||
{
|
||||
const char *msg = "Error: TCL failed to compile regular expression '%s'.";
|
||||
error_ = stringPrintTmp(msg, pattern);
|
||||
}
|
||||
|
||||
const char *
|
||||
RegexpCompileError::what() const throw()
|
||||
RegexpCompileError::what() const noexcept
|
||||
{
|
||||
return error_;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,11 +64,11 @@ private:
|
|||
};
|
||||
|
||||
// Error thrown by Pattern constructor.
|
||||
class RegexpCompileError : public StaException
|
||||
class RegexpCompileError : public Exception
|
||||
{
|
||||
public:
|
||||
explicit RegexpCompileError(const char *error);
|
||||
virtual ~RegexpCompileError() throw() {}
|
||||
virtual ~RegexpCompileError() noexcept {}
|
||||
virtual const char *what() const throw();
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Reference in New Issue