You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm
bindings
cmake
docs
examples
include
lib
Analysis
AsmParser
BinaryFormat
Bitcode
CodeGen
DebugInfo
Demangle
ExecutionEngine
FuzzMutate
Fuzzer
IR
IRReader
LTO
LineEditor
Linker
MC
Object
ObjectYAML
Option
Passes
ProfileData
Support
TableGen
CMakeLists.txt
Error.cpp
LLVMBuild.txt
Main.cpp
Record.cpp
SetTheory.cpp
StringMatcher.cpp
TGLexer.cpp
TGLexer.h
TGParser.cpp
TGParser.h
TableGenBackend.cpp
Target
Testing
ToolDrivers
Transforms
WindowsManifest
XRay
CMakeLists.txt
LLVMBuild.txt
projects
resources
runtimes
scripts
test
tools
unittests
utils
.arcconfig
.clang-format
.clang-tidy
.gitattributes
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
LLVMBuild.txt
README.txt
RELEASE_TESTERS.TXT
configure
llvm.spec.in
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
libgc
llvm
m4
man
mcs
mk
mono
msvc
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
54 lines
1.8 KiB
C++
54 lines
1.8 KiB
C++
![]() |
//===- TableGenBackend.cpp - Utilities for TableGen Backends ----*- C++ -*-===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
//
|
||
|
// This file provides useful services for TableGen backends...
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#include "llvm/TableGen/TableGenBackend.h"
|
||
|
#include "llvm/ADT/Twine.h"
|
||
|
#include "llvm/Support/raw_ostream.h"
|
||
|
|
||
|
using namespace llvm;
|
||
|
|
||
|
const size_t MAX_LINE_LEN = 80U;
|
||
|
|
||
|
static void printLine(raw_ostream &OS, const Twine &Prefix, char Fill,
|
||
|
StringRef Suffix) {
|
||
|
size_t Pos = (size_t)OS.tell();
|
||
|
assert((Prefix.str().size() + Suffix.size() <= MAX_LINE_LEN) &&
|
||
|
"header line exceeds max limit");
|
||
|
OS << Prefix;
|
||
|
for (size_t i = (size_t)OS.tell() - Pos, e = MAX_LINE_LEN - Suffix.size();
|
||
|
i < e; ++i)
|
||
|
OS << Fill;
|
||
|
OS << Suffix << '\n';
|
||
|
}
|
||
|
|
||
|
void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) {
|
||
|
printLine(OS, "/*===- TableGen'erated file ", '-', "*- C++ -*-===*\\");
|
||
|
StringRef Prefix("|* ");
|
||
|
StringRef Suffix(" *|");
|
||
|
printLine(OS, Prefix, ' ', Suffix);
|
||
|
size_t PSLen = Prefix.size() + Suffix.size();
|
||
|
assert(PSLen < MAX_LINE_LEN);
|
||
|
size_t Pos = 0U;
|
||
|
do {
|
||
|
size_t Length = std::min(Desc.size() - Pos, MAX_LINE_LEN - PSLen);
|
||
|
printLine(OS, Prefix + Desc.substr(Pos, Length), ' ', Suffix);
|
||
|
Pos += Length;
|
||
|
} while (Pos < Desc.size());
|
||
|
printLine(OS, Prefix, ' ', Suffix);
|
||
|
printLine(OS, Prefix + "Automatically generated file, do not edit!", ' ',
|
||
|
Suffix);
|
||
|
printLine(OS, Prefix, ' ', Suffix);
|
||
|
printLine(OS, "\\*===", '-', "===*/");
|
||
|
OS << '\n';
|
||
|
}
|