diff options
author | Craig Topper <craig.topper@gmail.com> | 2015-04-22 02:09:45 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2015-04-22 02:09:45 +0000 |
commit | 1bf3d1f5dd59ce2e6a1a49ede359620003eabbb9 (patch) | |
tree | a115b1cb077c8a9bf327011f3a6585ff0e6d7bce /llvm/lib/TableGen/Record.cpp | |
parent | 5dbef929323a180a8e56c34c473238835c500c79 (diff) | |
download | bcm5719-llvm-1bf3d1f5dd59ce2e6a1a49ede359620003eabbb9.tar.gz bcm5719-llvm-1bf3d1f5dd59ce2e6a1a49ede359620003eabbb9.zip |
[TableGen] Use 'isa' to identify UnsetInits rather than comparing with the singleton object created by UnsetInit::get(). Makes it more consistent with the other types.
llvm-svn: 235465
Diffstat (limited to 'llvm/lib/TableGen/Record.cpp')
-rw-r--r-- | llvm/lib/TableGen/Record.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/TableGen/Record.cpp b/llvm/lib/TableGen/Record.cpp index 3374432daa6..29217d74c96 100644 --- a/llvm/lib/TableGen/Record.cpp +++ b/llvm/lib/TableGen/Record.cpp @@ -517,7 +517,7 @@ std::string BitsInit::getAsString() const { // bits initializer will resolve into VarBitInit to keep the field name and bit // number used in targets with fixed insn length. static Init *fixBitInit(const RecordVal *RV, Init *Before, Init *After) { - if (RV || After != UnsetInit::get()) + if (RV || !isa<UnsetInit>(After)) return After; return Before; } @@ -1961,7 +1961,7 @@ bool Record::getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const { PrintFatalError(getLoc(), "Record `" + getName() + "' does not have a field named `" + FieldName.str() + "'!\n"); - if (R->getValue() == UnsetInit::get()) { + if (isa<UnsetInit>(R->getValue())) { Unset = true; return false; } |