mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-12 13:30:51 +00:00
Emit TableGen's header comment with C-style comments, so it can be used from C89 code.
Should silence warnings when compiling the X86 disassembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158723 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c9a4e269d0
commit
90540ad799
@ -11,13 +11,27 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "llvm/TableGen/TableGenBackend.h"
|
||||
using namespace llvm;
|
||||
|
||||
void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) {
|
||||
OS << "//===- TableGen'erated file -------------------------------------*-"
|
||||
" C++ -*-===//\n//\n// " << Desc << "\n//\n// Automatically generate"
|
||||
"d file, do not edit!\n//\n//===------------------------------------"
|
||||
"----------------------------------===//\n\n";
|
||||
static void printLine(raw_ostream &OS, const Twine &Prefix, char Fill,
|
||||
StringRef Suffix) {
|
||||
uint64_t Pos = OS.tell();
|
||||
OS << Prefix;
|
||||
for (unsigned i = OS.tell() - Pos, e = 80 - Suffix.size(); i != e; ++i)
|
||||
OS << Fill;
|
||||
OS << Suffix << '\n';
|
||||
}
|
||||
|
||||
void llvm::emitSourceFileHeader(StringRef Desc, raw_ostream &OS) {
|
||||
printLine(OS, "/*===- TableGen'erated file ", '-', "*- C++ -*-===*\\");
|
||||
printLine(OS, "|*", ' ', "*|");
|
||||
printLine(OS, "|* " + Desc, ' ', "*|");
|
||||
printLine(OS, "|*", ' ', "*|");
|
||||
printLine(OS, "|* Automatically generated file, do not edit!", ' ', "*|");
|
||||
printLine(OS, "|*", ' ', "*|");
|
||||
printLine(OS, "\\*===", '-', "===*/");
|
||||
OS << '\n';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user