mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-01 00:33:09 +00:00
Trailing whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127447 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5d4314ef72
commit
510207cb1e
@ -199,7 +199,7 @@ const CodeGenRegister *CodeGenTarget::getRegisterByName(StringRef Name) const {
|
|||||||
if (Reg.TheDef->getValueAsString("AsmName") == Name)
|
if (Reg.TheDef->getValueAsString("AsmName") == Name)
|
||||||
return &Reg;
|
return &Reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +216,7 @@ getRegisterVTs(Record *R) const {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove duplicates.
|
// Remove duplicates.
|
||||||
array_pod_sort(Result.begin(), Result.end());
|
array_pod_sort(Result.begin(), Result.end());
|
||||||
Result.erase(std::unique(Result.begin(), Result.end()), Result.end());
|
Result.erase(std::unique(Result.begin(), Result.end()), Result.end());
|
||||||
@ -229,8 +229,8 @@ CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
|
|||||||
if (R->getName().size() > 9 && R->getName()[9] == '.') {
|
if (R->getName().size() > 9 && R->getName()[9] == '.') {
|
||||||
static unsigned AnonCounter = 0;
|
static unsigned AnonCounter = 0;
|
||||||
R->setName("AnonRegClass_"+utostr(AnonCounter++));
|
R->setName("AnonRegClass_"+utostr(AnonCounter++));
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<Record*> TypeList = R->getValueAsListOfDefs("RegTypes");
|
std::vector<Record*> TypeList = R->getValueAsListOfDefs("RegTypes");
|
||||||
for (unsigned i = 0, e = TypeList.size(); i != e; ++i) {
|
for (unsigned i = 0, e = TypeList.size(); i != e; ++i) {
|
||||||
Record *Type = TypeList[i];
|
Record *Type = TypeList[i];
|
||||||
@ -240,7 +240,7 @@ CodeGenRegisterClass::CodeGenRegisterClass(Record *R) : TheDef(R) {
|
|||||||
VTs.push_back(getValueType(Type));
|
VTs.push_back(getValueType(Type));
|
||||||
}
|
}
|
||||||
assert(!VTs.empty() && "RegisterClass must contain at least one ValueType!");
|
assert(!VTs.empty() && "RegisterClass must contain at least one ValueType!");
|
||||||
|
|
||||||
std::vector<Record*> RegList = R->getValueAsListOfDefs("MemberList");
|
std::vector<Record*> RegList = R->getValueAsListOfDefs("MemberList");
|
||||||
for (unsigned i = 0, e = RegList.size(); i != e; ++i) {
|
for (unsigned i = 0, e = RegList.size(); i != e; ++i) {
|
||||||
Record *Reg = RegList[i];
|
Record *Reg = RegList[i];
|
||||||
@ -293,7 +293,7 @@ void CodeGenTarget::ReadLegalValueTypes() const {
|
|||||||
for (unsigned i = 0, e = RCs.size(); i != e; ++i)
|
for (unsigned i = 0, e = RCs.size(); i != e; ++i)
|
||||||
for (unsigned ri = 0, re = RCs[i].VTs.size(); ri != re; ++ri)
|
for (unsigned ri = 0, re = RCs[i].VTs.size(); ri != re; ++ri)
|
||||||
LegalValueTypes.push_back(RCs[i].VTs[ri]);
|
LegalValueTypes.push_back(RCs[i].VTs[ri]);
|
||||||
|
|
||||||
// Remove duplicates.
|
// Remove duplicates.
|
||||||
std::sort(LegalValueTypes.begin(), LegalValueTypes.end());
|
std::sort(LegalValueTypes.begin(), LegalValueTypes.end());
|
||||||
LegalValueTypes.erase(std::unique(LegalValueTypes.begin(),
|
LegalValueTypes.erase(std::unique(LegalValueTypes.begin(),
|
||||||
@ -314,10 +314,10 @@ void CodeGenTarget::ReadInstructions() const {
|
|||||||
|
|
||||||
static const CodeGenInstruction *
|
static const CodeGenInstruction *
|
||||||
GetInstByName(const char *Name,
|
GetInstByName(const char *Name,
|
||||||
const DenseMap<const Record*, CodeGenInstruction*> &Insts,
|
const DenseMap<const Record*, CodeGenInstruction*> &Insts,
|
||||||
RecordKeeper &Records) {
|
RecordKeeper &Records) {
|
||||||
const Record *Rec = Records.getDef(Name);
|
const Record *Rec = Records.getDef(Name);
|
||||||
|
|
||||||
DenseMap<const Record*, CodeGenInstruction*>::const_iterator
|
DenseMap<const Record*, CodeGenInstruction*>::const_iterator
|
||||||
I = Insts.find(Rec);
|
I = Insts.find(Rec);
|
||||||
if (Rec == 0 || I == Insts.end())
|
if (Rec == 0 || I == Insts.end())
|
||||||
@ -434,7 +434,7 @@ ComplexPattern::ComplexPattern(Record *R) {
|
|||||||
std::vector<CodeGenIntrinsic> llvm::LoadIntrinsics(const RecordKeeper &RC,
|
std::vector<CodeGenIntrinsic> llvm::LoadIntrinsics(const RecordKeeper &RC,
|
||||||
bool TargetOnly) {
|
bool TargetOnly) {
|
||||||
std::vector<Record*> I = RC.getAllDerivedDefinitions("Intrinsic");
|
std::vector<Record*> I = RC.getAllDerivedDefinitions("Intrinsic");
|
||||||
|
|
||||||
std::vector<CodeGenIntrinsic> Result;
|
std::vector<CodeGenIntrinsic> Result;
|
||||||
|
|
||||||
for (unsigned i = 0, e = I.size(); i != e; ++i) {
|
for (unsigned i = 0, e = I.size(); i != e; ++i) {
|
||||||
@ -451,8 +451,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
ModRef = ReadWriteMem;
|
ModRef = ReadWriteMem;
|
||||||
isOverloaded = false;
|
isOverloaded = false;
|
||||||
isCommutative = false;
|
isCommutative = false;
|
||||||
|
|
||||||
if (DefName.size() <= 4 ||
|
if (DefName.size() <= 4 ||
|
||||||
std::string(DefName.begin(), DefName.begin() + 4) != "int_")
|
std::string(DefName.begin(), DefName.begin() + 4) != "int_")
|
||||||
throw "Intrinsic '" + DefName + "' does not start with 'int_'!";
|
throw "Intrinsic '" + DefName + "' does not start with 'int_'!";
|
||||||
|
|
||||||
@ -472,11 +472,11 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
Name += (EnumName[i] == '_') ? '.' : EnumName[i];
|
Name += (EnumName[i] == '_') ? '.' : EnumName[i];
|
||||||
} else {
|
} else {
|
||||||
// Verify it starts with "llvm.".
|
// Verify it starts with "llvm.".
|
||||||
if (Name.size() <= 5 ||
|
if (Name.size() <= 5 ||
|
||||||
std::string(Name.begin(), Name.begin() + 5) != "llvm.")
|
std::string(Name.begin(), Name.begin() + 5) != "llvm.")
|
||||||
throw "Intrinsic '" + DefName + "'s name does not start with 'llvm.'!";
|
throw "Intrinsic '" + DefName + "'s name does not start with 'llvm.'!";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If TargetPrefix is specified, make sure that Name starts with
|
// If TargetPrefix is specified, make sure that Name starts with
|
||||||
// "llvm.<targetprefix>.".
|
// "llvm.<targetprefix>.".
|
||||||
if (!TargetPrefix.empty()) {
|
if (!TargetPrefix.empty()) {
|
||||||
@ -486,7 +486,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
throw "Intrinsic '" + DefName + "' does not start with 'llvm." +
|
throw "Intrinsic '" + DefName + "' does not start with 'llvm." +
|
||||||
TargetPrefix + ".'!";
|
TargetPrefix + ".'!";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the list of return types.
|
// Parse the list of return types.
|
||||||
std::vector<MVT::SimpleValueType> OverloadedVTs;
|
std::vector<MVT::SimpleValueType> OverloadedVTs;
|
||||||
ListInit *TypeList = R->getValueAsListInit("RetTypes");
|
ListInit *TypeList = R->getValueAsListInit("RetTypes");
|
||||||
@ -517,11 +517,11 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
// Reject invalid types.
|
// Reject invalid types.
|
||||||
if (VT == MVT::isVoid)
|
if (VT == MVT::isVoid)
|
||||||
throw "Intrinsic '" + DefName + " has void in result type list!";
|
throw "Intrinsic '" + DefName + " has void in result type list!";
|
||||||
|
|
||||||
IS.RetVTs.push_back(VT);
|
IS.RetVTs.push_back(VT);
|
||||||
IS.RetTypeDefs.push_back(TyEl);
|
IS.RetTypeDefs.push_back(TyEl);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse the list of parameter types.
|
// Parse the list of parameter types.
|
||||||
TypeList = R->getValueAsListInit("ParamTypes");
|
TypeList = R->getValueAsListInit("ParamTypes");
|
||||||
for (unsigned i = 0, e = TypeList->getSize(); i != e; ++i) {
|
for (unsigned i = 0, e = TypeList->getSize(); i != e; ++i) {
|
||||||
@ -542,16 +542,16 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
"Expected iAny or vAny type");
|
"Expected iAny or vAny type");
|
||||||
} else
|
} else
|
||||||
VT = getValueType(TyEl->getValueAsDef("VT"));
|
VT = getValueType(TyEl->getValueAsDef("VT"));
|
||||||
|
|
||||||
if (EVT(VT).isOverloaded()) {
|
if (EVT(VT).isOverloaded()) {
|
||||||
OverloadedVTs.push_back(VT);
|
OverloadedVTs.push_back(VT);
|
||||||
isOverloaded = true;
|
isOverloaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reject invalid types.
|
// Reject invalid types.
|
||||||
if (VT == MVT::isVoid && i != e-1 /*void at end means varargs*/)
|
if (VT == MVT::isVoid && i != e-1 /*void at end means varargs*/)
|
||||||
throw "Intrinsic '" + DefName + " has void in result type list!";
|
throw "Intrinsic '" + DefName + " has void in result type list!";
|
||||||
|
|
||||||
IS.ParamVTs.push_back(VT);
|
IS.ParamVTs.push_back(VT);
|
||||||
IS.ParamTypeDefs.push_back(TyEl);
|
IS.ParamTypeDefs.push_back(TyEl);
|
||||||
}
|
}
|
||||||
@ -562,7 +562,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
|
|||||||
Record *Property = PropList->getElementAsRecord(i);
|
Record *Property = PropList->getElementAsRecord(i);
|
||||||
assert(Property->isSubClassOf("IntrinsicProperty") &&
|
assert(Property->isSubClassOf("IntrinsicProperty") &&
|
||||||
"Expected a property!");
|
"Expected a property!");
|
||||||
|
|
||||||
if (Property->getName() == "IntrNoMem")
|
if (Property->getName() == "IntrNoMem")
|
||||||
ModRef = NoMem;
|
ModRef = NoMem;
|
||||||
else if (Property->getName() == "IntrReadArgMem")
|
else if (Property->getName() == "IntrReadArgMem")
|
||||||
|
@ -32,8 +32,8 @@ class CodeGenTarget;
|
|||||||
// SDNPMemOperand: indicates that a node touches memory and therefore must
|
// SDNPMemOperand: indicates that a node touches memory and therefore must
|
||||||
// have an associated memory operand that describes the access.
|
// have an associated memory operand that describes the access.
|
||||||
enum SDNP {
|
enum SDNP {
|
||||||
SDNPCommutative,
|
SDNPCommutative,
|
||||||
SDNPAssociative,
|
SDNPAssociative,
|
||||||
SDNPHasChain,
|
SDNPHasChain,
|
||||||
SDNPOutGlue,
|
SDNPOutGlue,
|
||||||
SDNPInGlue,
|
SDNPInGlue,
|
||||||
@ -57,7 +57,7 @@ std::string getEnumName(MVT::SimpleValueType T);
|
|||||||
/// getQualifiedName - Return the name of the specified record, with a
|
/// getQualifiedName - Return the name of the specified record, with a
|
||||||
/// namespace qualifier if the record contains one.
|
/// namespace qualifier if the record contains one.
|
||||||
std::string getQualifiedName(const Record *R);
|
std::string getQualifiedName(const Record *R);
|
||||||
|
|
||||||
/// CodeGenTarget - This class corresponds to the Target class in the .td files.
|
/// CodeGenTarget - This class corresponds to the Target class in the .td files.
|
||||||
///
|
///
|
||||||
class CodeGenTarget {
|
class CodeGenTarget {
|
||||||
@ -74,7 +74,7 @@ class CodeGenTarget {
|
|||||||
void ReadRegisterClasses() const;
|
void ReadRegisterClasses() const;
|
||||||
void ReadInstructions() const;
|
void ReadInstructions() const;
|
||||||
void ReadLegalValueTypes() const;
|
void ReadLegalValueTypes() const;
|
||||||
|
|
||||||
mutable std::vector<const CodeGenInstruction*> InstrsByEnum;
|
mutable std::vector<const CodeGenInstruction*> InstrsByEnum;
|
||||||
public:
|
public:
|
||||||
CodeGenTarget(RecordKeeper &Records);
|
CodeGenTarget(RecordKeeper &Records);
|
||||||
@ -102,7 +102,7 @@ public:
|
|||||||
if (Registers.empty()) ReadRegisters();
|
if (Registers.empty()) ReadRegisters();
|
||||||
return Registers;
|
return Registers;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getRegisterByName - If there is a register with the specific AsmName,
|
/// getRegisterByName - If there is a register with the specific AsmName,
|
||||||
/// return it.
|
/// return it.
|
||||||
const CodeGenRegister *getRegisterByName(StringRef Name) const;
|
const CodeGenRegister *getRegisterByName(StringRef Name) const;
|
||||||
@ -134,7 +134,7 @@ public:
|
|||||||
assert(0 && "Didn't find the register class");
|
assert(0 && "Didn't find the register class");
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// getRegisterClassForRegister - Find the register class that contains the
|
/// getRegisterClassForRegister - Find the register class that contains the
|
||||||
/// specified physical register. If the register is not in a register
|
/// specified physical register. If the register is not in a register
|
||||||
/// class, return null. If the register is in multiple classes, and the
|
/// class, return null. If the register is in multiple classes, and the
|
||||||
@ -192,19 +192,19 @@ public:
|
|||||||
/// getRegisterVTs - Find the union of all possible SimpleValueTypes for the
|
/// getRegisterVTs - Find the union of all possible SimpleValueTypes for the
|
||||||
/// specified physical register.
|
/// specified physical register.
|
||||||
std::vector<MVT::SimpleValueType> getRegisterVTs(Record *R) const;
|
std::vector<MVT::SimpleValueType> getRegisterVTs(Record *R) const;
|
||||||
|
|
||||||
const std::vector<MVT::SimpleValueType> &getLegalValueTypes() const {
|
const std::vector<MVT::SimpleValueType> &getLegalValueTypes() const {
|
||||||
if (LegalValueTypes.empty()) ReadLegalValueTypes();
|
if (LegalValueTypes.empty()) ReadLegalValueTypes();
|
||||||
return LegalValueTypes;
|
return LegalValueTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// isLegalValueType - Return true if the specified value type is natively
|
/// isLegalValueType - Return true if the specified value type is natively
|
||||||
/// supported by the target (i.e. there are registers that directly hold it).
|
/// supported by the target (i.e. there are registers that directly hold it).
|
||||||
bool isLegalValueType(MVT::SimpleValueType VT) const {
|
bool isLegalValueType(MVT::SimpleValueType VT) const {
|
||||||
const std::vector<MVT::SimpleValueType> &LegalVTs = getLegalValueTypes();
|
const std::vector<MVT::SimpleValueType> &LegalVTs = getLegalValueTypes();
|
||||||
for (unsigned i = 0, e = LegalVTs.size(); i != e; ++i)
|
for (unsigned i = 0, e = LegalVTs.size(); i != e; ++i)
|
||||||
if (LegalVTs[i] == VT) return true;
|
if (LegalVTs[i] == VT) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -213,7 +213,7 @@ private:
|
|||||||
return Instructions;
|
return Instructions;
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
|
|
||||||
CodeGenInstruction &getInstruction(const Record *InstRec) const {
|
CodeGenInstruction &getInstruction(const Record *InstRec) const {
|
||||||
if (Instructions.empty()) ReadInstructions();
|
if (Instructions.empty()) ReadInstructions();
|
||||||
DenseMap<const Record*, CodeGenInstruction*>::iterator I =
|
DenseMap<const Record*, CodeGenInstruction*>::iterator I =
|
||||||
@ -233,12 +233,12 @@ public:
|
|||||||
typedef std::vector<const CodeGenInstruction*>::const_iterator inst_iterator;
|
typedef std::vector<const CodeGenInstruction*>::const_iterator inst_iterator;
|
||||||
inst_iterator inst_begin() const{return getInstructionsByEnumValue().begin();}
|
inst_iterator inst_begin() const{return getInstructionsByEnumValue().begin();}
|
||||||
inst_iterator inst_end() const { return getInstructionsByEnumValue().end(); }
|
inst_iterator inst_end() const { return getInstructionsByEnumValue().end(); }
|
||||||
|
|
||||||
|
|
||||||
/// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
|
/// isLittleEndianEncoding - are instruction bit patterns defined as [0..n]?
|
||||||
///
|
///
|
||||||
bool isLittleEndianEncoding() const;
|
bool isLittleEndianEncoding() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void ComputeInstrsByEnum() const;
|
void ComputeInstrsByEnum() const;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user