diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-29 17:17:15 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2014-03-29 17:17:15 +0000 |
commit | abe43b546b084ff1071ea77e1736010427678ea5 (patch) | |
tree | 9d9ab7eb9ec02f4a2e118bc2977a1a8446bb3e34 /lib/TableGen | |
parent | 690843563938117ff464252fff068c96df2635d9 (diff) | |
download | llvm-abe43b546b084ff1071ea77e1736010427678ea5.tar.gz llvm-abe43b546b084ff1071ea77e1736010427678ea5.tar.bz2 llvm-abe43b546b084ff1071ea77e1736010427678ea5.tar.xz |
tblgen: Twinify PrintFatalError.
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205110 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/TableGen')
-rw-r--r-- | lib/TableGen/Error.cpp | 6 | ||||
-rw-r--r-- | lib/TableGen/Record.cpp | 38 |
2 files changed, 22 insertions, 22 deletions
diff --git a/lib/TableGen/Error.cpp b/lib/TableGen/Error.cpp index 928b1203cd..8d9ae20dd5 100644 --- a/lib/TableGen/Error.cpp +++ b/lib/TableGen/Error.cpp @@ -62,12 +62,12 @@ void PrintError(const Twine &Msg) { errs() << "error:" << Msg << "\n"; } -void PrintFatalError(const std::string &Msg) { - PrintError(Twine(Msg)); +void PrintFatalError(const Twine &Msg) { + PrintError(Msg); std::exit(1); } -void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const std::string &Msg) { +void PrintFatalError(ArrayRef<SMLoc> ErrorLoc, const Twine &Msg) { PrintError(ErrorLoc, Msg); std::exit(1); } diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 53e6c51bf5..a43665bcd8 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -1786,7 +1786,7 @@ Init *Record::getValueInit(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); return R->getValue(); } @@ -1799,12 +1799,12 @@ std::string Record::getValueAsString(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (StringInit *SI = dyn_cast<StringInit>(R->getValue())) return SI->getValue(); PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a string initializer!"); + FieldName + "' does not have a string initializer!"); } /// getValueAsBitsInit - This method looks up the specified field and returns @@ -1815,12 +1815,12 @@ BitsInit *Record::getValueAsBitsInit(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (BitsInit *BI = dyn_cast<BitsInit>(R->getValue())) return BI; PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a BitsInit initializer!"); + FieldName + "' does not have a BitsInit initializer!"); } /// getValueAsListInit - This method looks up the specified field and returns @@ -1831,12 +1831,12 @@ ListInit *Record::getValueAsListInit(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (ListInit *LI = dyn_cast<ListInit>(R->getValue())) return LI; PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a list initializer!"); + FieldName + "' does not have a list initializer!"); } /// getValueAsListOfDefs - This method looks up the specified field and returns @@ -1852,7 +1852,7 @@ Record::getValueAsListOfDefs(StringRef FieldName) const { Defs.push_back(DI->getDef()); } else { PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' list is not entirely DefInit!"); + FieldName + "' list is not entirely DefInit!"); } } return Defs; @@ -1866,12 +1866,12 @@ int64_t Record::getValueAsInt(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (IntInit *II = dyn_cast<IntInit>(R->getValue())) return II->getValue(); PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have an int initializer!"); + FieldName + "' does not have an int initializer!"); } /// getValueAsListOfInts - This method looks up the specified field and returns @@ -1887,7 +1887,7 @@ Record::getValueAsListOfInts(StringRef FieldName) const { Ints.push_back(II->getValue()); } else { PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a list of ints initializer!"); + FieldName + "' does not have a list of ints initializer!"); } } return Ints; @@ -1906,7 +1906,7 @@ Record::getValueAsListOfStrings(StringRef FieldName) const { Strings.push_back(II->getValue()); } else { PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a list of strings initializer!"); + FieldName + "' does not have a list of strings initializer!"); } } return Strings; @@ -1920,12 +1920,12 @@ Record *Record::getValueAsDef(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (DefInit *DI = dyn_cast<DefInit>(R->getValue())) return DI->getDef(); PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a def initializer!"); + FieldName + "' does not have a def initializer!"); } /// getValueAsBit - This method looks up the specified field and returns its @@ -1936,12 +1936,12 @@ bool Record::getValueAsBit(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (BitInit *BI = dyn_cast<BitInit>(R->getValue())) return BI->getValue(); PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a bit initializer!"); + FieldName + "' does not have a bit initializer!"); } bool Record::getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const { @@ -1958,7 +1958,7 @@ bool Record::getValueAsBitOrUnset(StringRef FieldName, bool &Unset) const { if (BitInit *BI = dyn_cast<BitInit>(R->getValue())) return BI->getValue(); PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a bit initializer!"); + FieldName + "' does not have a bit initializer!"); } /// getValueAsDag - This method looks up the specified field and returns its @@ -1969,12 +1969,12 @@ DagInit *Record::getValueAsDag(StringRef FieldName) const { const RecordVal *R = getValue(FieldName); if (R == 0 || R->getValue() == 0) PrintFatalError(getLoc(), "Record `" + getName() + - "' does not have a field named `" + FieldName.str() + "'!\n"); + "' does not have a field named `" + FieldName + "'!\n"); if (DagInit *DI = dyn_cast<DagInit>(R->getValue())) return DI; PrintFatalError(getLoc(), "Record `" + getName() + "', field `" + - FieldName.str() + "' does not have a dag initializer!"); + FieldName + "' does not have a dag initializer!"); } |