[llvm] r237775 - [TableGen] Make some variable names consistent with their type names and just generally consistent across all of the overloads.
Craig Topper
craig.topper at gmail.com
Tue May 19 22:40:13 PDT 2015
Author: ctopper
Date: Wed May 20 00:40:13 2015
New Revision: 237775
URL: http://llvm.org/viewvc/llvm-project?rev=237775&view=rev
Log:
[TableGen] Make some variable names consistent with their type names and just generally consistent across all of the overloads.
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=237775&r1=237774&r2=237775&view=diff
==============================================================================
--- llvm/trunk/include/llvm/TableGen/Record.h (original)
+++ llvm/trunk/include/llvm/TableGen/Record.h Wed May 20 00:40:13 2015
@@ -107,14 +107,14 @@ public: // These methods should only b
virtual Init *convertValue( IntInit *II) { return nullptr; }
virtual Init *convertValue(StringInit *SI) { return nullptr; }
virtual Init *convertValue( ListInit *LI) { return nullptr; }
- virtual Init *convertValue( UnOpInit *UI) {
- return convertValue((TypedInit*)UI);
+ virtual Init *convertValue( UnOpInit *UO) {
+ return convertValue((TypedInit*)UO);
}
- virtual Init *convertValue( BinOpInit *UI) {
- return convertValue((TypedInit*)UI);
+ virtual Init *convertValue( BinOpInit *BO) {
+ return convertValue((TypedInit*)BO);
}
- virtual Init *convertValue( TernOpInit *UI) {
- return convertValue((TypedInit*)UI);
+ virtual Init *convertValue( TernOpInit *TO) {
+ return convertValue((TypedInit*)TO);
}
virtual Init *convertValue(VarBitInit *VB) { return nullptr; }
virtual Init *convertValue( DefInit *DI) { return nullptr; }
@@ -240,7 +240,7 @@ public:
using RecTy::convertValue;
Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
Init *convertValue(StringInit *SI) override { return (Init*)SI; }
- Init *convertValue( UnOpInit *BO) override;
+ Init *convertValue( UnOpInit *UO) override;
Init *convertValue( BinOpInit *BO) override;
Init *convertValue( TypedInit *TI) override;
@@ -296,9 +296,9 @@ public:
using RecTy::convertValue;
Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
- Init *convertValue( UnOpInit *BO) override;
+ Init *convertValue( UnOpInit *UO) override;
Init *convertValue( BinOpInit *BO) override;
- Init *convertValue( DagInit *CI) override { return (Init*)CI; }
+ Init *convertValue( DagInit *DI) override { return (Init*)DI; }
Init *convertValue( TypedInit *TI) override;
std::string getAsString() const override { return "dag"; }
@@ -328,7 +328,7 @@ public:
using RecTy::convertValue;
Init *convertValue( UnsetInit *UI) override { return (Init*)UI; }
Init *convertValue( DefInit *DI) override;
- Init *convertValue( TypedInit *VI) override;
+ Init *convertValue( TypedInit *TI) override;
std::string getAsString() const override;
Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=237775&r1=237774&r2=237775&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Wed May 20 00:40:13 2015
@@ -112,16 +112,16 @@ Init *BitRecTy::convertValue(IntInit *II
return BitInit::get(Val != 0);
}
-Init *BitRecTy::convertValue(TypedInit *VI) {
- RecTy *Ty = VI->getType();
+Init *BitRecTy::convertValue(TypedInit *TI) {
+ RecTy *Ty = TI->getType();
if (isa<BitRecTy>(Ty))
- return VI; // Accept variable if it is already of bit type!
+ return TI; // Accept variable if it is already of bit type!
if (auto *BitsTy = dyn_cast<BitsRecTy>(Ty))
// Accept only bits<1> expression.
- return BitsTy->getNumBits() == 1 ? VI : nullptr;
+ return BitsTy->getNumBits() == 1 ? TI : nullptr;
// Ternary !if can be converted to bit, but only if both sides are
// convertible to a bit.
- if (TernOpInit *TOI = dyn_cast<TernOpInit>(VI)) {
+ if (TernOpInit *TOI = dyn_cast<TernOpInit>(TI)) {
if (TOI->getOpcode() != TernOpInit::TernaryOp::IF)
return nullptr;
if (!TOI->getMHS()->convertInitializerTo(BitRecTy::get()) ||
@@ -163,9 +163,9 @@ Init *BitsRecTy::convertValue(UnsetInit
return BitsInit::get(NewBits);
}
-Init *BitsRecTy::convertValue(BitInit *UI) {
+Init *BitsRecTy::convertValue(BitInit *BI) {
if (Size != 1) return nullptr; // Can only convert single bit.
- return BitsInit::get(UI);
+ return BitsInit::get(BI);
}
/// canFitInBitfield - Return true if the number of bits is large enough to hold
@@ -200,15 +200,15 @@ Init *BitsRecTy::convertValue(BitsInit *
return nullptr;
}
-Init *BitsRecTy::convertValue(TypedInit *VI) {
- if (Size == 1 && isa<BitRecTy>(VI->getType()))
- return BitsInit::get(VI);
+Init *BitsRecTy::convertValue(TypedInit *TI) {
+ if (Size == 1 && isa<BitRecTy>(TI->getType()))
+ return BitsInit::get(TI);
- if (VI->getType()->typeIsConvertibleTo(this)) {
+ if (TI->getType()->typeIsConvertibleTo(this)) {
SmallVector<Init *, 16> NewBits(Size);
for (unsigned i = 0; i != Size; ++i)
- NewBits[i] = VarBitInit::get(VI, i);
+ NewBits[i] = VarBitInit::get(TI, i);
return BitsInit::get(NewBits);
}
@@ -247,16 +247,16 @@ bool IntRecTy::baseClassOf(const RecTy *
return kind==BitRecTyKind || kind==BitsRecTyKind || kind==IntRecTyKind;
}
-Init *StringRecTy::convertValue(UnOpInit *BO) {
- if (BO->getOpcode() == UnOpInit::CAST) {
- Init *L = BO->getOperand()->convertInitializerTo(this);
+Init *StringRecTy::convertValue(UnOpInit *UO) {
+ if (UO->getOpcode() == UnOpInit::CAST) {
+ Init *L = UO->getOperand()->convertInitializerTo(this);
if (!L) return nullptr;
- if (L != BO->getOperand())
+ if (L != UO->getOperand())
return UnOpInit::get(UnOpInit::CAST, L, StringRecTy::get());
- return BO;
+ return UO;
}
- return convertValue((TypedInit*)BO);
+ return convertValue((TypedInit*)UO);
}
Init *StringRecTy::convertValue(BinOpInit *BO) {
@@ -320,13 +320,13 @@ Init *DagRecTy::convertValue(TypedInit *
return nullptr;
}
-Init *DagRecTy::convertValue(UnOpInit *BO) {
- if (BO->getOpcode() == UnOpInit::CAST) {
- Init *L = BO->getOperand()->convertInitializerTo(this);
+Init *DagRecTy::convertValue(UnOpInit *UO) {
+ if (UO->getOpcode() == UnOpInit::CAST) {
+ Init *L = UO->getOperand()->convertInitializerTo(this);
if (!L) return nullptr;
- if (L != BO->getOperand())
+ if (L != UO->getOperand())
return UnOpInit::get(UnOpInit::CAST, L, DagRecTy::get());
- return BO;
+ return UO;
}
return nullptr;
}
More information about the llvm-commits
mailing list