TableGen - fix uninitialized variable warnings. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 10 Nov 2019 11:19:50 +0000 (11:19 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Sun, 10 Nov 2019 11:19:50 +0000 (11:19 +0000)
llvm/lib/TableGen/TGLexer.h
llvm/lib/TableGen/TGParser.h

index 3085ab2..266a9cd 100644 (file)
@@ -73,18 +73,18 @@ namespace tgtok {
 class TGLexer {
   SourceMgr &SrcMgr;
 
-  const char *CurPtr;
+  const char *CurPtr = nullptr;
   StringRef CurBuf;
 
   // Information about the current token.
-  const char *TokStart;
-  tgtok::TokKind CurCode;
+  const char *TokStart = nullptr;
+  tgtok::TokKind CurCode = tgtok::TokKind::Eof;
   std::string CurStrVal;  // This is valid for ID, STRVAL, VARNAME, CODEFRAGMENT
-  int64_t CurIntVal;      // This is valid for INTVAL.
+  int64_t CurIntVal = 0;  // This is valid for INTVAL.
 
   /// CurBuffer - This is the current buffer index we're lexing from as managed
   /// by the SourceMgr object.
-  unsigned CurBuffer;
+  unsigned CurBuffer = 0;
 
 public:
   typedef std::map<std::string, SMLoc> DependenciesMapTy;
index 8979900..840cd21 100644 (file)
@@ -70,7 +70,7 @@ namespace llvm {
 
   struct DefsetRecord {
     SMLoc Loc;
-    RecTy *EltTy;
+    RecTy *EltTy = nullptr;
     SmallVector<Init *, 16> Elements;
   };