LLVM: lib/TableGen/TableGenBackend.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

19#include

20#include

21#include

22

23using namespace llvm;

25

27

28

29

30

31

32

33

44

45namespace {

46struct OptCreatorT {

47 static void *call() {

49 }

50};

51}

52

54

60

61

62

68 std::string S;

71 OutFiles = {S, {}};

72 return false;

73 }

76 return false;

77 }

78 return true;

79}

80

83 size_t Pos = (size_t)OS.tell();

85 "header line exceeds max limit");

86 OS << Prefix;

88 i < e; ++i)

89 OS << Fill;

90 OS << Suffix << '\n';

91}

92

95 printLine(OS, "/*===- TableGen'erated file ", '-', "*- C++ -*-===*\\");

98 printLine(OS, Prefix, ' ', Suffix);

99 size_t PSLen = Prefix.size() + Suffix.size();

101 size_t Pos = 0U;

102 do {

106 } while (Pos < Desc.size());

107 printLine(OS, Prefix, ' ', Suffix);

108 printLine(OS, Prefix + "Automatically generated file, do not edit!", ' ',

109 Suffix);

110

111

112 if (Record.getInputFilename().empty())

115 ' ', Suffix);

116 printLine(OS, Prefix, ' ', Suffix);

117 printLine(OS, "\\*===", '-', "===*/");

118 OS << '\n';

119}

assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")

const size_t MAX_LINE_LEN

Definition TableGenBackend.cpp:26

static ManagedStatic< cl::opt< FnT >, OptCreatorT > CallbackFunction

Definition TableGenBackend.cpp:53

static void printLine(raw_ostream &OS, const Twine &Prefix, char Fill, StringRef Suffix)

Definition TableGenBackend.cpp:81

ManagedStatic - This transparently changes the behavior of global statics to be lazily constructed on...

StringRef - Represent a constant reference to a string, i.e.

constexpr size_t size() const

size - Get the string size.

Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...

This class implements an extremely fast bulk output stream that can only output to a stream.

uint64_t tell() const

tell - Return the current offset with the file.

A raw_ostream that writes to an std::string.

bool ApplyCallback(const RecordKeeper &Records, TableGenOutputFiles &OutFiles, StringRef FilenamePrefix)

Apply callback for any command line option registered above.

Definition TableGenBackend.cpp:63

LLVM_ABI StringRef filename(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)

Get filename.

This is an optimization pass for GlobalISel generic memory operations.

void emitSourceFileHeader(StringRef Desc, raw_ostream &OS, const RecordKeeper &Record=RecordKeeper())

emitSourceFileHeader - Output an LLVM style file header to the specified raw_ostream.

Definition TableGenBackend.cpp:93

OptionValue< FnT > & operator=(const FnT &V)

Definition TableGenBackend.cpp:39

OptionValue(const FnT &V)

Definition TableGenBackend.cpp:37

Represents the emitting function.

MultiFileGeneratorType * MultiFileGenerator

SingleFileGeneratorType * SingleFileGenerator

Opt(StringRef Name, FnT CB, StringRef Desc, bool ByDefault=false)

Definition TableGenBackend.cpp:55

void setValue(const DT &)