LLVM: include/llvm/Option/Option.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_OPTION_OPTION_H

10#define LLVM_OPTION_OPTION_H

11

18#include

19

20namespace llvm {

21

23

24namespace opt {

25

28

29

31

32

39

43

44

45

46

47

48

49

50

51

52

53

54

56public:

72

79

80protected:

83

84public:

86

88 return Info != nullptr;

89 }

90

92 assert(Info && "Must have a valid info!");

93 return Info->ID;

94 }

95

97 assert(Info && "Must have a valid info!");

99 }

100

101

107

113

119

120

121

123 assert(Info && "Must have a valid info!");

124 assert((Info->AliasArgs || Info->AliasArgs[0] != 0) &&

125 "AliasArgs should be either 0 or non-empty.");

126

127 return Info->AliasArgs;

128 }

129

130

136

137

139 assert(Info && "Must have a valid info!");

140 assert(Owner && "Must have a valid owner!");

141 return Owner->getOptionPrefixedName(Info->ID);

142 }

143

144

146 assert(Info && "Must have a valid info!");

147 return Info->HelpText;

148 }

149

150

152 assert(Info && "Must have a valid info!");

153 return Info->MetaVar;

154 }

155

157

159

186

187

189 return Info->Flags & Val;

190 }

191

192

194 return Info->Visibility & Val;

195 }

196

197

198

204

205

206

210

211

212

213

214

215

216

218

220 assert(Info && "Must have a valid info!");

221 assert(Owner && "Must have a valid owner!");

222 return Owner->isValidForSubCommand(Info, SubCommand);

223 }

224

225

226

227

228

229

230

231

232

233

234

235

236

238 bool GroupedShortOption,

239 unsigned &Index) const;

240

241private:

242 std::unique_ptr acceptInternal(const ArgList &Args, StringRef CurArg,

243 unsigned &Index) const;

244

245public:

248};

249

250}

251

252}

253

254#endif

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

This file defines the SmallVector class.

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.

ArgList - Ordered collection of driver arguments.

A concrete instance of a particular driver option.

OptSpecifier - Wrapper class for abstracting references to option IDs.

Provide access to the Option info table.

const Option getAlias() const

Definition Option.h:114

LLVM_ABI void dump() const

unsigned getNumArgs() const

Definition Option.h:156

const char * getAliasArgs() const

Get the alias arguments as a \0 separated list.

Definition Option.h:122

RenderStyleKind getRenderStyle() const

Definition Option.h:160

const Option getGroup() const

Definition Option.h:108

const OptTable * Owner

Definition Option.h:82

const Option getUnaliasedOption() const

getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias)...

Definition Option.h:199

LLVM_ABI bool matches(OptSpecifier ID) const

matches - Predicate for whether this option is part of the given option (which may be a group).

LLVM_ABI Option(const OptTable::Info *Info, const OptTable *Owner)

StringRef getRenderName() const

getRenderName - Return the name to use when rendering this option.

Definition Option.h:207

bool hasFlag(unsigned Val) const

Test if this option has the flag Val.

Definition Option.h:188

bool hasNoOptAsInput() const

Definition Option.h:158

OptionClass

Definition Option.h:57

@ JoinedClass

Definition Option.h:62

@ GroupClass

Definition Option.h:58

@ CommaJoinedClass

Definition Option.h:67

@ FlagClass

Definition Option.h:61

@ JoinedOrSeparateClass

Definition Option.h:69

@ RemainingArgsClass

Definition Option.h:65

@ MultiArgClass

Definition Option.h:68

@ InputClass

Definition Option.h:59

@ UnknownClass

Definition Option.h:60

@ SeparateClass

Definition Option.h:64

@ JoinedAndSeparateClass

Definition Option.h:70

@ RemainingArgsJoinedClass

Definition Option.h:66

@ ValuesClass

Definition Option.h:63

StringRef getPrefix() const

Get the default prefix for this option.

Definition Option.h:131

RenderStyleKind

Definition Option.h:73

@ RenderSeparateStyle

Definition Option.h:76

@ RenderCommaJoinedStyle

Definition Option.h:74

@ RenderValuesStyle

Definition Option.h:77

@ RenderJoinedStyle

Definition Option.h:75

bool hasVisibilityFlag(unsigned Val) const

Test if this option has the visibility flag Val.

Definition Option.h:193

const OptTable::Info * Info

Definition Option.h:81

LLVM_ABI bool isRegisteredSC(StringRef SubCommand) const

Definition Option.h:219

StringRef getPrefixedName() const

Get the name of this option with the default prefix.

Definition Option.h:138

StringRef getMetaVar() const

Get the meta-variable list for this option.

Definition Option.h:151

bool isValid() const

Definition Option.h:87

unsigned getID() const

Definition Option.h:91

StringRef getHelpText() const

Get the help text for this option.

Definition Option.h:145

StringRef getName() const

Get the name of this option without any prefix.

Definition Option.h:102

LLVM_ABI std::unique_ptr< Arg > accept(const ArgList &Args, StringRef CurArg, bool GroupedShortOption, unsigned &Index) const

Potentially accept the current argument, returning a new Arg instance, or 0 if the option does not ac...

OptionClass getKind() const

Definition Option.h:96

LLVM_ABI void print(raw_ostream &O, bool AddNewLine=true) const

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

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

unsigned ID

LLVM IR allows to use arbitrary numbers as calling convention identifiers.

SmallVector< const char *, 16 > ArgStringList

ArgStringList - Type used for constructing argv lists for subprocesses.

Definition Option.h:30

DriverVisibility

Definition Option.h:40

@ DefaultVis

Definition Option.h:41

DriverFlag

Base flags for all options. Custom flags may be added after.

Definition Option.h:33

@ RenderSeparate

Definition Option.h:37

@ HelpHidden

Definition Option.h:34

@ RenderJoined

Definition Option.h:36

@ RenderAsInput

Definition Option.h:35

This is an optimization pass for GlobalISel generic memory operations.

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