summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MIRParser
diff options
context:
space:
mode:
authorEugene Zelenko <eugene.zelenko@gmail.com>2017-09-27 23:26:01 +0000
committerEugene Zelenko <eugene.zelenko@gmail.com>2017-09-27 23:26:01 +0000
commitfa57bd0ced39eddf1eb31283b7ad9e67e166b1cf (patch)
tree9559688ea1b772a5cd4c0bc3d1f9eff8d84ae93f /llvm/lib/CodeGen/MIRParser
parent8ea84426c9ecd55a77337f6d416bdaad192984d6 (diff)
downloadbcm5719-llvm-fa57bd0ced39eddf1eb31283b7ad9e67e166b1cf.tar.gz
bcm5719-llvm-fa57bd0ced39eddf1eb31283b7ad9e67e166b1cf.zip
[CodeGen] Fix some Clang-tidy modernize-use-default-member-init and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 314363
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.cpp18
-rw-r--r--llvm/lib/CodeGen/MIRParser/MILexer.h10
2 files changed, 17 insertions, 11 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.cpp b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
index 25f48368af5..0ba346c510f 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.cpp
@@ -1,4 +1,4 @@
-//===- MILexer.cpp - Machine instructions lexer implementation ----------===//
+//===- MILexer.cpp - Machine instructions lexer implementation ------------===//
//
// The LLVM Compiler Infrastructure
//
@@ -12,27 +12,33 @@
//===----------------------------------------------------------------------===//
#include "MILexer.h"
+#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/None.h"
+#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
+#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/Twine.h"
+#include <algorithm>
+#include <cassert>
#include <cctype>
+#include <string>
using namespace llvm;
namespace {
-typedef function_ref<void(StringRef::iterator Loc, const Twine &)>
- ErrorCallbackType;
+using ErrorCallbackType =
+ function_ref<void(StringRef::iterator Loc, const Twine &)>;
/// This class provides a way to iterate and get characters from the source
/// string.
class Cursor {
- const char *Ptr;
- const char *End;
+ const char *Ptr = nullptr;
+ const char *End = nullptr;
public:
- Cursor(NoneType) : Ptr(nullptr), End(nullptr) {}
+ Cursor(NoneType) {}
explicit Cursor(StringRef Str) {
Ptr = Str.data();
diff --git a/llvm/lib/CodeGen/MIRParser/MILexer.h b/llvm/lib/CodeGen/MIRParser/MILexer.h
index c203d2c4817..886916b470f 100644
--- a/llvm/lib/CodeGen/MIRParser/MILexer.h
+++ b/llvm/lib/CodeGen/MIRParser/MILexer.h
@@ -1,4 +1,4 @@
-//===- MILexer.h - Lexer for machine instructions -------------------------===//
+//===- MILexer.h - Lexer for machine instructions ---------------*- C++ -*-===//
//
// The LLVM Compiler Infrastructure
//
@@ -18,7 +18,7 @@
#include "llvm/ADT/APSInt.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
-#include <functional>
+#include <string>
namespace llvm {
@@ -133,14 +133,14 @@ struct MIToken {
};
private:
- TokenKind Kind;
+ TokenKind Kind = Error;
StringRef Range;
StringRef StringValue;
std::string StringValueStorage;
APSInt IntVal;
public:
- MIToken() : Kind(Error) {}
+ MIToken() = default;
MIToken &reset(TokenKind Kind, StringRef Range);
@@ -204,4 +204,4 @@ StringRef lexMIToken(
} // end namespace llvm
-#endif
+#endif // LLVM_LIB_CODEGEN_MIRPARSER_MILEXER_H
OpenPOWER on IntegriCloud