Changeset View
Changeset View
Standalone View
Standalone View
llvm/lib/TableGen/TGParser.cpp
//===- TGParser.cpp - Parser for TableGen Files ---------------------------===// | //===- TGParser.cpp - Parser for TableGen Files ---------------------------===// | ||||
Lint: Lint: clang-format suggested style edits found: | |||||
// | // | ||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||||
// See https://llvm.org/LICENSE.txt for license information. | // See https://llvm.org/LICENSE.txt for license information. | ||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// | // | ||||
// Implement the Parser for TableGen. | // Implement the Parser for TableGen. | ||||
// | // | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
#include "TGParser.h" | #include "TGParser.h" | ||||
#include "llvm/ADT/None.h" | #include "llvm/ADT/None.h" | ||||
#include "llvm/ADT/STLExtras.h" | #include "llvm/ADT/STLExtras.h" | ||||
#include "llvm/ADT/SmallVector.h" | #include "llvm/ADT/SmallVector.h" | ||||
#include "llvm/ADT/StringExtras.h" | #include "llvm/ADT/StringExtras.h" | ||||
#include "llvm/ADT/Twine.h" | #include "llvm/ADT/Twine.h" | ||||
#include "llvm/Config/llvm-config.h" | #include "llvm/Config/llvm-config.h" | ||||
#include "llvm/Support/Casting.h" | #include "llvm/Support/Casting.h" | ||||
#include "llvm/Support/Compiler.h" | #include "llvm/Support/Compiler.h" | ||||
#include "llvm/Support/Error.h" | |||||
#include "llvm/Support/ErrorHandling.h" | #include "llvm/Support/ErrorHandling.h" | ||||
#include "llvm/Support/raw_ostream.h" | #include "llvm/Support/raw_ostream.h" | ||||
Lint: Pre-merge checks clang-format: please reformat the code -#include "llvm/Support/raw_ostream.h" Lint: Pre-merge checks: clang-format: please reformat the code
```
-#include "llvm/Support/raw_ostream.h"
``` | |||||
#include "llvm/Support/SourceMgr.h" | #include "llvm/Support/SourceMgr.h" | ||||
Lint: Pre-merge checks clang-format: please reformat the code +#include "llvm/Support/raw_ostream.h" Lint: Pre-merge checks: clang-format: please reformat the code
```
+#include "llvm/Support/raw_ostream.h"
``` | |||||
#include "llvm/TableGen/Parser.h" | |||||
#include <algorithm> | #include <algorithm> | ||||
#include <cassert> | #include <cassert> | ||||
#include <cstdint> | #include <cstdint> | ||||
using namespace llvm; | using namespace llvm; | ||||
//===----------------------------------------------------------------------===// | //===----------------------------------------------------------------------===// | ||||
// Support Code for the Semantic Actions. | // Support Code for the Semantic Actions. | ||||
▲ Show 20 Lines • Show All 3,381 Lines • ▼ Show 20 Lines | LLVM_DUMP_METHOD void MultiClass::dump() const { | ||||
errs() << "Record:\n"; | errs() << "Record:\n"; | ||||
Rec.dump(); | Rec.dump(); | ||||
errs() << "Defs:\n"; | errs() << "Defs:\n"; | ||||
for (const auto &E : Entries) | for (const auto &E : Entries) | ||||
E.dump(); | E.dump(); | ||||
} | } | ||||
#endif | #endif | ||||
Error llvm::TableGenParseString(StringRef String, RecordKeeper &Records) { | |||||
Lint: Pre-merge checks clang-tidy: warning: invalid case style for function 'TableGenParseString' [readability-identifier-naming] Lint: Pre-merge checks: clang-tidy: warning: invalid case style for function 'TableGenParseString' [readability… | |||||
SourceMgr SrcMgr; | |||||
SrcMgr.AddNewSourceBuffer(MemoryBuffer::getMemBufferCopy(String), | |||||
llvm::SMLoc()); | |||||
TGParser Parser(SrcMgr, None, Records); | |||||
if (Parser.ParseFile()) | |||||
return createStringError(inconvertibleErrorCode(), "parser failure"); | |||||
return Error::success(); | |||||
} |
clang-format suggested style edits found: