LLVM: lib/ExecutionEngine/JITLink/COFFDirectiveParser.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

14

15using namespace llvm;

17

18#define DEBUG_TYPE "jitlink"

19

20#define OPTTABLE_STR_TABLE_CODE

21#include "COFFOptions.inc"

22#undef OPTTABLE_STR_TABLE_CODE

23

24#define OPTTABLE_PREFIXES_TABLE_CODE

25#include "COFFOptions.inc"

26#undef OPTTABLE_PREFIXES_TABLE_CODE

27

28#define OPTTABLE_PREFIXES_UNION_CODE

29#include "COFFOptions.inc"

30#undef OPTTABLE_PREFIXES_UNION_CODE

31

32

35#define OPTION(...) \

36 LLVM_CONSTRUCT_OPT_INFO_WITH_ID_PREFIX(COFF_OPT_, __VA_ARGS__),

37#include "COFFOptions.inc"

38#undef OPTION

39};

40

42public:

45 OptionPrefixesUnion, true) {}

46};

47

49

55 bool HasNul = Tok.end() != Str.end() && Tok.data()[Tok.size()] == '\0';

56 Buffer.push_back(HasNul ? Tok.data() : saver.save(Tok).data());

57 }

58

59 unsigned missingIndex;

60 unsigned missingCount;

61

62 auto Result = optTable.ParseArgs(Buffer, missingIndex, missingCount);

63

64 if (missingCount)

66 Result.getArgString(missingIndex) +

67 " missing argument");

69 for (auto *arg : Result.filtered(COFF_OPT_UNKNOWN))

70 dbgs() << "Unknown coff option argument: " << arg->getAsString(Result)

71 << "\n";

72 });

73 return std::move(Result);

74}

static COFFOptTable optTable

Definition COFFDirectiveParser.cpp:48

static constexpr opt::OptTable::Info infoTable[]

Definition COFFDirectiveParser.cpp:34

COFFOptTable()

Definition COFFDirectiveParser.cpp:43

Tagged union holding either a T or a Error.

void push_back(const T &Elt)

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

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

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

Expected< opt::InputArgList > parse(StringRef Str)

Definition COFFDirectiveParser.cpp:50

LLVM_ABI void TokenizeWindowsCommandLineNoCopy(StringRef Source, StringSaver &Saver, SmallVectorImpl< StringRef > &NewArgv)

Tokenizes a Windows command line while attempting to avoid copies.

This is an optimization pass for GlobalISel generic memory operations.

LLVM_ABI raw_ostream & dbgs()

dbgs() - This returns a reference to a raw_ostream for debugging messages.

Error make_error(ArgTs &&... Args)

Make a Error instance representing failure using the given error info type.

Entry for a single option instance in the option data table.