[TableGen] Cleanup Record comments. NFC.
LLVM doesn't use exceptions anymore.
Also remove the implementation comments. Some of them diverged.
llvm-svn: 275424
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp
index 9ee7781..61a1668 100644
--- a/llvm/lib/TableGen/Record.cpp
+++ b/llvm/lib/TableGen/Record.cpp
@@ -175,9 +175,6 @@
return false;
}
-/// resolveTypes - Find a common type that T1 and T2 convert to.
-/// Return null if no such type exists.
-///
RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) {
if (T1->typeIsConvertibleTo(T2))
return T2;
@@ -407,8 +404,6 @@
return itostr(Value);
}
-/// canFitInBitfield - Return true if the number of bits is large enough to hold
-/// the integer value.
static bool canFitInBitfield(int64_t Value, unsigned NumBits) {
// For example, with NumBits == 4, we permit Values from [-7 .. 15].
return (NumBits >= sizeof(Value) * 8) ||
@@ -1348,11 +1343,6 @@
return nullptr;
}
-/// resolveReferences - This method is used by classes that refer to other
-/// variables which may not be defined at the time the expression is formed.
-/// If a value is set for the variable later, this method will be called on
-/// users of the value to allow the value to propagate out.
-///
Init *VarInit::resolveReferences(Record &R, const RecordVal *RV) const {
if (RecordVal *Val = R.getValue(VarName))
if (RV == Val || (!RV && !isa<UnsetInit>(Val->getValue())))
@@ -1679,9 +1669,6 @@
setName(StringInit::get(Name));
}
-/// resolveReferencesTo - If anything in this record refers to RV, replace the
-/// reference to RV with the RHS of RV. If RV is null, we resolve all possible
-/// references.
void Record::resolveReferencesTo(const RecordVal *RV) {
for (unsigned i = 0, e = Values.size(); i != e; ++i) {
if (RV == &Values[i]) // Skip resolve the same field as the given one
@@ -1742,9 +1729,6 @@
return OS << "}\n";
}
-/// getValueInit - Return the initializer for a value with the specified name,
-/// or abort if the field does not exist.
-///
Init *Record::getValueInit(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1754,10 +1738,6 @@
}
-/// getValueAsString - This method looks up the specified field and returns its
-/// value as a string, aborts if the field does not exist or if
-/// the value is not a string.
-///
std::string Record::getValueAsString(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1773,10 +1753,6 @@
FieldName + "' does not have a string initializer!");
}
-/// getValueAsBitsInit - This method looks up the specified field and returns
-/// its value as a BitsInit, aborts if the field does not exist or if
-/// the value is not the right type.
-///
BitsInit *Record::getValueAsBitsInit(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1789,10 +1765,6 @@
FieldName + "' does not have a BitsInit initializer!");
}
-/// getValueAsListInit - This method looks up the specified field and returns
-/// its value as a ListInit, aborting if the field does not exist or if
-/// the value is not the right type.
-///
ListInit *Record::getValueAsListInit(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1805,10 +1777,6 @@
FieldName + "' does not have a list initializer!");
}
-/// getValueAsListOfDefs - This method looks up the specified field and returns
-/// its value as a vector of records, aborting if the field does not exist
-/// or if the value is not the right type.
-///
std::vector<Record*>
Record::getValueAsListOfDefs(StringRef FieldName) const {
ListInit *List = getValueAsListInit(FieldName);
@@ -1823,10 +1791,6 @@
return Defs;
}
-/// getValueAsInt - This method looks up the specified field and returns its
-/// value as an int64_t, aborting if the field does not exist or if the value
-/// is not the right type.
-///
int64_t Record::getValueAsInt(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1839,10 +1803,6 @@
FieldName + "' does not have an int initializer!");
}
-/// getValueAsListOfInts - This method looks up the specified field and returns
-/// its value as a vector of integers, aborting if the field does not exist or
-/// if the value is not the right type.
-///
std::vector<int64_t>
Record::getValueAsListOfInts(StringRef FieldName) const {
ListInit *List = getValueAsListInit(FieldName);
@@ -1857,10 +1817,6 @@
return Ints;
}
-/// getValueAsListOfStrings - This method looks up the specified field and
-/// returns its value as a vector of strings, aborting if the field does not
-/// exist or if the value is not the right type.
-///
std::vector<std::string>
Record::getValueAsListOfStrings(StringRef FieldName) const {
ListInit *List = getValueAsListInit(FieldName);
@@ -1875,10 +1831,6 @@
return Strings;
}
-/// getValueAsDef - This method looks up the specified field and returns its
-/// value as a Record, aborting if the field does not exist or if the value
-/// is not the right type.
-///
Record *Record::getValueAsDef(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1891,10 +1843,6 @@
FieldName + "' does not have a def initializer!");
}
-/// getValueAsBit - This method looks up the specified field and returns its
-/// value as a bit, aborting if the field does not exist or if the value is
-/// not the right type.
-///
bool Record::getValueAsBit(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1924,10 +1872,6 @@
FieldName + "' does not have a bit initializer!");
}
-/// getValueAsDag - This method looks up the specified field and returns its
-/// value as an Dag, aborting if the field does not exist or if the value is
-/// not the right type.
-///
DagInit *Record::getValueAsDag(StringRef FieldName) const {
const RecordVal *R = getValue(FieldName);
if (!R || !R->getValue())
@@ -1964,11 +1908,7 @@
return OS;
}
-
-/// getAllDerivedDefinitions - This method returns all concrete definitions
-/// that derive from the specified class name. If a class with the specified
-/// name does not exist, an error is printed and true is returned.
-std::vector<Record*>
+std::vector<Record *>
RecordKeeper::getAllDerivedDefinitions(const std::string &ClassName) const {
Record *Class = getClass(ClassName);
if (!Class)
@@ -1982,8 +1922,6 @@
return Defs;
}
-/// QualifyName - Return an Init with a qualifier prefix referring
-/// to CurRec's name.
Init *llvm::QualifyName(Record &CurRec, MultiClass *CurMultiClass,
Init *Name, const std::string &Scoper) {
RecTy *Type = cast<TypedInit>(Name)->getType();
@@ -2011,8 +1949,6 @@
return NewName->Fold(&CurRec, CurMultiClass);
}
-/// QualifyName - Return an Init with a qualifier prefix referring
-/// to CurRec's name.
Init *llvm::QualifyName(Record &CurRec, MultiClass *CurMultiClass,
const std::string &Name,
const std::string &Scoper) {