[llvm] c45e90c - llvm-tblgen: Anonymize some functions.
NAKAMURA Takumi via llvm-commits
llvm-commits at lists.llvm.org
Sat Feb 18 21:45:52 PST 2023
Author: NAKAMURA Takumi
Date: 2023-02-19T14:44:56+09:00
New Revision: c45e90cf152decb1a3dcd208273ca025e14f1b4f
URL: https://github.com/llvm/llvm-project/commit/c45e90cf152decb1a3dcd208273ca025e14f1b4f
DIFF: https://github.com/llvm/llvm-project/commit/c45e90cf152decb1a3dcd208273ca025e14f1b4f.diff
LOG: llvm-tblgen: Anonymize some functions.
Added:
Modified:
llvm/utils/TableGen/DirectiveEmitter.cpp
llvm/utils/TableGen/InstrDocsEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/utils/TableGen/DirectiveEmitter.cpp b/llvm/utils/TableGen/DirectiveEmitter.cpp
index f18b9ee7d390f..d4ef9f577b2c2 100644
--- a/llvm/utils/TableGen/DirectiveEmitter.cpp
+++ b/llvm/utils/TableGen/DirectiveEmitter.cpp
@@ -37,9 +37,6 @@ class IfDefScope {
StringRef Name;
raw_ostream &OS;
};
-} // end anonymous namespace
-
-namespace llvm {
// Generate enum class
void GenerateEnumClass(const std::vector<Record *> &Records, raw_ostream &OS,
@@ -163,6 +160,8 @@ bool HasDuplicateClausesInDirectives(const std::vector<Record *> &Directives) {
return HasDuplicate;
}
+} // namespace
+
// Check consitency of records. Return true if an error has been detected.
// Return false if the records are valid.
bool DirectiveLanguage::HasValidityErrors() const {
@@ -174,6 +173,8 @@ bool DirectiveLanguage::HasValidityErrors() const {
return HasDuplicateClausesInDirectives(getDirectives());
}
+namespace llvm {
+
// Generate the declaration section for the enumeration in the directive
// language
void EmitDirectivesDecl(RecordKeeper &Records, raw_ostream &OS) {
@@ -245,6 +246,10 @@ void EmitDirectivesDecl(RecordKeeper &Records, raw_ostream &OS) {
OS << "#endif // LLVM_" << DirLang.getName() << "_INC\n";
}
+} // namespace llvm
+
+namespace {
+
// Generate function implementation for get<Enum>Name(StringRef Str)
void GenerateGetName(const std::vector<Record *> &Records, raw_ostream &OS,
StringRef Enum, const DirectiveLanguage &DirLang,
@@ -869,6 +874,10 @@ void EmitDirectivesBasicImpl(const DirectiveLanguage &DirLang,
GenerateIsAllowedClause(DirLang, OS);
}
+} // namespace
+
+namespace llvm {
+
// Generate the implemenation section for the enumeration in the directive
// language.
void EmitDirectivesImpl(RecordKeeper &Records, raw_ostream &OS) {
diff --git a/llvm/utils/TableGen/InstrDocsEmitter.cpp b/llvm/utils/TableGen/InstrDocsEmitter.cpp
index bc391227edd16..ca39927664de1 100644
--- a/llvm/utils/TableGen/InstrDocsEmitter.cpp
+++ b/llvm/utils/TableGen/InstrDocsEmitter.cpp
@@ -28,7 +28,7 @@
using namespace llvm;
-namespace llvm {
+namespace {
void writeTitle(StringRef Str, raw_ostream &OS, char Kind = '-') {
OS << std::string(Str.size(), Kind) << "\n" << Str << "\n"
@@ -55,6 +55,10 @@ std::string escapeForRST(StringRef Str) {
return Result;
}
+} // namespace
+
+namespace llvm {
+
void EmitInstrDocs(RecordKeeper &RK, raw_ostream &OS) {
CodeGenDAGPatterns CDP(RK);
CodeGenTarget &Target = CDP.getTargetInfo();
More information about the llvm-commits
mailing list