[llvm] r275424 - [TableGen] Cleanup Record comments. NFC.

Ahmed Bougacha via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 14 07:53:11 PDT 2016


Author: ab
Date: Thu Jul 14 09:53:11 2016
New Revision: 275424

URL: http://llvm.org/viewvc/llvm-project?rev=275424&view=rev
Log:
[TableGen] Cleanup Record comments. NFC.

LLVM doesn't use exceptions anymore.
Also remove the implementation comments. Some of them diverged.

Modified:
    llvm/trunk/include/llvm/TableGen/Record.h
    llvm/trunk/lib/TableGen/Record.cpp

Modified: llvm/trunk/include/llvm/TableGen/Record.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/TableGen/Record.h?rev=275424&r1=275423&r2=275424&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Thu Jul 14 09:53:11 2016
@@ -1543,9 +1543,9 @@ public:
   // High-level helper methods, useful for tablegen backends...
 
   /// 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 exception is thrown.
-  std::vector<Record*>
+  /// that derive from the specified class name.  A class with the specified
+  /// name must exist.
+  std::vector<Record *>
   getAllDerivedDefinitions(const std::string &ClassName) const;
 
   void dump() const;

Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=275424&r1=275423&r2=275424&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Thu Jul 14 09:53:11 2016
@@ -175,9 +175,6 @@ bool RecordRecTy::typeIsConvertibleTo(co
   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 @@ std::string IntInit::getAsString() const
   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 @@ Init *VarInit::getFieldInit(Record &R, c
   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 @@ void Record::setName(const std::string &
   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 @@ raw_ostream &llvm::operator<<(raw_ostrea
   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 @@ Init *Record::getValueInit(StringRef Fie
 }
 
 
-/// 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 @@ std::string Record::getValueAsString(Str
     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 @@ BitsInit *Record::getValueAsBitsInit(Str
     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 @@ ListInit *Record::getValueAsListInit(Str
     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 @@ Record::getValueAsListOfDefs(StringRef F
   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 @@ int64_t Record::getValueAsInt(StringRef
     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 @@ Record::getValueAsListOfInts(StringRef F
   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 @@ Record::getValueAsListOfStrings(StringRe
   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 @@ Record *Record::getValueAsDef(StringRef
     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 @@ bool Record::getValueAsBitOrUnset(String
     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 @@ raw_ostream &llvm::operator<<(raw_ostrea
   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 @@ RecordKeeper::getAllDerivedDefinitions(c
   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 @@ Init *llvm::QualifyName(Record &CurRec,
   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) {




More information about the llvm-commits mailing list