remove a bunch of unneeded stuff, or self evident comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23519 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-09-29 06:16:11 +00:00
parent 475cfe42c0
commit e9b6242780

View File

@ -383,7 +383,6 @@ struct ExitInMainOptimization : public LibCallOptimization
{ {
ExitInMainOptimization() : LibCallOptimization("exit", ExitInMainOptimization() : LibCallOptimization("exit",
"Number of 'exit' calls simplified") {} "Number of 'exit' calls simplified") {}
virtual ~ExitInMainOptimization() {}
// Make sure the called function looks like exit (int argument, int return // Make sure the called function looks like exit (int argument, int return
// type, external linkage, not varargs). // type, external linkage, not varargs).
@ -451,8 +450,6 @@ public:
"Number of 'strcat' calls simplified") {} "Number of 'strcat' calls simplified") {}
public: public:
/// @breif Destructor
virtual ~StrCatOptimization() {}
/// @brief Make sure that the "strcat" function has the right prototype /// @brief Make sure that the "strcat" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
@ -540,7 +537,6 @@ struct StrChrOptimization : public LibCallOptimization
public: public:
StrChrOptimization() : LibCallOptimization("strchr", StrChrOptimization() : LibCallOptimization("strchr",
"Number of 'strchr' calls simplified") {} "Number of 'strchr' calls simplified") {}
virtual ~StrChrOptimization() {}
/// @brief Make sure that the "strchr" function has the right prototype /// @brief Make sure that the "strchr" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
@ -632,7 +628,6 @@ struct StrCmpOptimization : public LibCallOptimization
public: public:
StrCmpOptimization() : LibCallOptimization("strcmp", StrCmpOptimization() : LibCallOptimization("strcmp",
"Number of 'strcmp' calls simplified") {} "Number of 'strcmp' calls simplified") {}
virtual ~StrCmpOptimization() {}
/// @brief Make sure that the "strcmp" function has the right prototype /// @brief Make sure that the "strcmp" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
@ -719,7 +714,6 @@ struct StrNCmpOptimization : public LibCallOptimization
public: public:
StrNCmpOptimization() : LibCallOptimization("strncmp", StrNCmpOptimization() : LibCallOptimization("strncmp",
"Number of 'strncmp' calls simplified") {} "Number of 'strncmp' calls simplified") {}
virtual ~StrNCmpOptimization() {}
/// @brief Make sure that the "strncmp" function has the right prototype /// @brief Make sure that the "strncmp" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
@ -822,7 +816,6 @@ struct StrCpyOptimization : public LibCallOptimization
public: public:
StrCpyOptimization() : LibCallOptimization("strcpy", StrCpyOptimization() : LibCallOptimization("strcpy",
"Number of 'strcpy' calls simplified") {} "Number of 'strcpy' calls simplified") {}
virtual ~StrCpyOptimization() {}
/// @brief Make sure that the "strcpy" function has the right prototype /// @brief Make sure that the "strcpy" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
@ -910,7 +903,6 @@ struct StrLenOptimization : public LibCallOptimization
{ {
StrLenOptimization() : LibCallOptimization("strlen", StrLenOptimization() : LibCallOptimization("strlen",
"Number of 'strlen' calls simplified") {} "Number of 'strlen' calls simplified") {}
virtual ~StrLenOptimization() {}
/// @brief Make sure that the "strlen" function has the right prototype /// @brief Make sure that the "strlen" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
@ -1113,8 +1105,6 @@ protected:
LLVMMemCpyOptimization(const char* fname, const char* desc) LLVMMemCpyOptimization(const char* fname, const char* desc)
: LibCallOptimization(fname, desc) {} : LibCallOptimization(fname, desc) {}
public: public:
/// @brief Destructor
virtual ~LLVMMemCpyOptimization() {}
/// @brief Make sure that the "memcpy" function has the right prototype /// @brief Make sure that the "memcpy" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& TD) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& TD)
@ -1199,8 +1189,6 @@ struct LLVMMemSetOptimization : public LibCallOptimization
"Number of 'llvm.memset' calls simplified") {} "Number of 'llvm.memset' calls simplified") {}
public: public:
/// @brief Destructor
virtual ~LLVMMemSetOptimization() {}
/// @brief Make sure that the "memset" function has the right prototype /// @brief Make sure that the "memset" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& TD) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& TD)
@ -1307,9 +1295,6 @@ public:
PowOptimization() : LibCallOptimization("pow", PowOptimization() : LibCallOptimization("pow",
"Number of 'pow' calls simplified") {} "Number of 'pow' calls simplified") {}
/// @brief Destructor
virtual ~PowOptimization() {}
/// @brief Make sure that the "pow" function has the right prototype /// @brief Make sure that the "pow" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
@ -1384,9 +1369,6 @@ public:
FPrintFOptimization() : LibCallOptimization("fprintf", FPrintFOptimization() : LibCallOptimization("fprintf",
"Number of 'fprintf' calls simplified") {} "Number of 'fprintf' calls simplified") {}
/// @brief Destructor
virtual ~FPrintFOptimization() {}
/// @brief Make sure that the "fprintf" function has the right prototype /// @brief Make sure that the "fprintf" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
@ -1520,9 +1502,6 @@ public:
SPrintFOptimization() : LibCallOptimization("sprintf", SPrintFOptimization() : LibCallOptimization("sprintf",
"Number of 'sprintf' calls simplified") {} "Number of 'sprintf' calls simplified") {}
/// @brief Destructor
virtual ~SPrintFOptimization() {}
/// @brief Make sure that the "fprintf" function has the right prototype /// @brief Make sure that the "fprintf" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
@ -1657,9 +1636,6 @@ public:
PutsOptimization() : LibCallOptimization("fputs", PutsOptimization() : LibCallOptimization("fputs",
"Number of 'fputs' calls simplified") {} "Number of 'fputs' calls simplified") {}
/// @brief Destructor
virtual ~PutsOptimization() {}
/// @brief Make sure that the "fputs" function has the right prototype /// @brief Make sure that the "fputs" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
@ -1723,17 +1699,12 @@ public:
/// This LibCallOptimization will simplify calls to the "isdigit" library /// This LibCallOptimization will simplify calls to the "isdigit" library
/// function. It simply does range checks the parameter explicitly. /// function. It simply does range checks the parameter explicitly.
/// @brief Simplify the isdigit library function. /// @brief Simplify the isdigit library function.
struct IsDigitOptimization : public LibCallOptimization struct isdigitOptimization : public LibCallOptimization {
{
public: public:
/// @brief Default Constructor isdigitOptimization() : LibCallOptimization("isdigit",
IsDigitOptimization() : LibCallOptimization("isdigit",
"Number of 'isdigit' calls simplified") {} "Number of 'isdigit' calls simplified") {}
/// @brief Destructor /// @brief Make sure that the "isdigit" function has the right prototype
virtual ~IsDigitOptimization() {}
/// @brief Make sure that the "fputs" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
// Just make sure this has 1 argument // Just make sure this has 1 argument
@ -1772,7 +1743,9 @@ public:
ci->eraseFromParent(); ci->eraseFromParent();
return true; return true;
} }
} IsDigitOptimizer; } isdigitOptimizer;
/// This LibCallOptimization will simplify calls to the "toascii" library /// This LibCallOptimization will simplify calls to the "toascii" library
/// function. It simply does the corresponding and operation to restrict the /// function. It simply does the corresponding and operation to restrict the
@ -1785,9 +1758,6 @@ public:
ToAsciiOptimization() : LibCallOptimization("toascii", ToAsciiOptimization() : LibCallOptimization("toascii",
"Number of 'toascii' calls simplified") {} "Number of 'toascii' calls simplified") {}
/// @brief Destructor
virtual ~ToAsciiOptimization() {}
/// @brief Make sure that the "fputs" function has the right prototype /// @brief Make sure that the "fputs" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
@ -1826,9 +1796,6 @@ public:
FFSOptimization() : LibCallOptimization("ffs", FFSOptimization() : LibCallOptimization("ffs",
"Number of 'ffs' calls simplified") {} "Number of 'ffs' calls simplified") {}
/// @brief Destructor
virtual ~FFSOptimization() {}
/// @brief Make sure that the "fputs" function has the right prototype /// @brief Make sure that the "fputs" function has the right prototype
virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC) virtual bool ValidateCalledFunction(const Function* f, SimplifyLibCalls& SLC)
{ {
@ -2070,12 +2037,6 @@ Value *CastToCStr(Value *V, Instruction &IP) {
// exp, expf, expl: // exp, expf, expl:
// * exp(log(x)) -> x // * exp(log(x)) -> x
// //
// isascii:
// * isascii(c) -> ((c & ~0x7f) == 0)
//
// isdigit:
// * isdigit(c) -> (unsigned)(c) - '0' <= 9
//
// log, logf, logl: // log, logf, logl:
// * log(exp(x)) -> x // * log(exp(x)) -> x
// * log(x**y) -> y*log(x) // * log(x**y) -> y*log(x)