mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-16 12:24:03 +00:00
Remove dead code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -64,8 +64,7 @@ static inline void ThrowException(const std::string &message,
|
|||||||
//
|
//
|
||||||
struct ValID {
|
struct ValID {
|
||||||
enum {
|
enum {
|
||||||
NumberVal, NameVal, ConstSIntVal, ConstUIntVal, ConstStringVal,
|
NumberVal, NameVal, ConstSIntVal, ConstUIntVal, ConstFPVal, ConstNullVal
|
||||||
ConstFPVal, ConstNullVal
|
|
||||||
} Type;
|
} Type;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
@ -92,10 +91,6 @@ struct ValID {
|
|||||||
ValID D; D.Type = ConstUIntVal; D.UConstPool64 = Val; return D;
|
ValID D; D.Type = ConstUIntVal; D.UConstPool64 = Val; return D;
|
||||||
}
|
}
|
||||||
|
|
||||||
static ValID create_conststr(char *Name) {
|
|
||||||
ValID D; D.Type = ConstStringVal; D.Name = Name; return D;
|
|
||||||
}
|
|
||||||
|
|
||||||
static ValID create(double Val) {
|
static ValID create(double Val) {
|
||||||
ValID D; D.Type = ConstFPVal; D.ConstPoolFP = Val; return D;
|
ValID D; D.Type = ConstFPVal; D.ConstPoolFP = Val; return D;
|
||||||
}
|
}
|
||||||
@ -105,12 +100,12 @@ struct ValID {
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline void destroy() const {
|
inline void destroy() const {
|
||||||
if (Type == NameVal || Type == ConstStringVal)
|
if (Type == NameVal)
|
||||||
free(Name); // Free this strdup'd memory...
|
free(Name); // Free this strdup'd memory...
|
||||||
}
|
}
|
||||||
|
|
||||||
inline ValID copy() const {
|
inline ValID copy() const {
|
||||||
if (Type != NameVal && Type != ConstStringVal) return *this;
|
if (Type != NameVal) return *this;
|
||||||
ValID Result = *this;
|
ValID Result = *this;
|
||||||
Result.Name = strdup(Name);
|
Result.Name = strdup(Name);
|
||||||
return Result;
|
return Result;
|
||||||
@ -120,7 +115,6 @@ struct ValID {
|
|||||||
switch (Type) {
|
switch (Type) {
|
||||||
case NumberVal : return std::string("#") + itostr(Num);
|
case NumberVal : return std::string("#") + itostr(Num);
|
||||||
case NameVal : return Name;
|
case NameVal : return Name;
|
||||||
case ConstStringVal: return std::string("\"") + Name + std::string("\"");
|
|
||||||
case ConstFPVal : return ftostr(ConstPoolFP);
|
case ConstFPVal : return ftostr(ConstPoolFP);
|
||||||
case ConstNullVal : return "null";
|
case ConstNullVal : return "null";
|
||||||
case ConstUIntVal :
|
case ConstUIntVal :
|
||||||
@ -136,7 +130,6 @@ struct ValID {
|
|||||||
if (Type != V.Type) return Type < V.Type;
|
if (Type != V.Type) return Type < V.Type;
|
||||||
switch (Type) {
|
switch (Type) {
|
||||||
case NumberVal: return Num < V.Num;
|
case NumberVal: return Num < V.Num;
|
||||||
case ConstStringVal:
|
|
||||||
case NameVal: return strcmp(Name, V.Name) < 0;
|
case NameVal: return strcmp(Name, V.Name) < 0;
|
||||||
case ConstSIntVal: return ConstPool64 < V.ConstPool64;
|
case ConstSIntVal: return ConstPool64 < V.ConstPool64;
|
||||||
case ConstUIntVal: return UConstPool64 < V.UConstPool64;
|
case ConstUIntVal: return UConstPool64 < V.UConstPool64;
|
||||||
|
@ -330,11 +330,6 @@ static Value *getValNonImprovising(const Type *Ty, const ValID &D) {
|
|||||||
return ConstantUInt::get(Ty, D.UConstPool64);
|
return ConstantUInt::get(Ty, D.UConstPool64);
|
||||||
}
|
}
|
||||||
|
|
||||||
case ValID::ConstStringVal: // Is it a string const pool reference?
|
|
||||||
cerr << "FIXME: TODO: String constants [sbyte] not implemented yet!\n";
|
|
||||||
abort();
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
case ValID::ConstFPVal: // Is it a floating point const pool reference?
|
case ValID::ConstFPVal: // Is it a floating point const pool reference?
|
||||||
if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP))
|
if (!ConstantFP::isValueValidForType(Ty, D.ConstPoolFP))
|
||||||
ThrowException("FP constant invalid for type!!");
|
ThrowException("FP constant invalid for type!!");
|
||||||
|
Reference in New Issue
Block a user