Go to the documentation of this file.
11 #include "llvm/Config/llvm-config.h"
31 "Multi-level aliases are not supported.");
37 "Cannot provide alias args to a flag option.");
44 #define P(N) case N: O << #N; break
63 for (
const char *
const *Pre =
Info->
Prefixes; *Pre !=
nullptr; ++Pre) {
64 O <<
'"' << *Pre << (*(Pre + 1) ==
nullptr ?
"\"" :
"\", ");
89 #if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
109 std::unique_ptr<Arg> Option::acceptInternal(
const ArgList &
Args,
111 unsigned &
Index)
const {
112 size_t ArgSize = Spelling.
size();
115 if (ArgSize != strlen(
Args.getArgString(
Index)))
117 return std::make_unique<Arg>(*
this, Spelling,
Index++);
121 return std::make_unique<Arg>(*
this, Spelling,
Index++,
Value);
125 const char *Str =
Args.getArgString(
Index) + ArgSize;
126 auto A = std::make_unique<Arg>(*
this, Spelling,
Index++);
129 const char *Prev = Str;
133 if (!
c ||
c ==
',') {
135 char *
Value =
new char[Str - Prev + 1];
137 Value[Str - Prev] =
'\0';
138 A->getValues().push_back(
Value);
147 A->setOwnsValues(
true);
154 if (ArgSize != strlen(
Args.getArgString(
Index)))
158 if (
Index >
Args.getNumInputArgStrings() ||
162 return std::make_unique<Arg>(*
this, Spelling,
Index - 2,
167 if (ArgSize != strlen(
Args.getArgString(
Index)))
171 if (
Index >
Args.getNumInputArgStrings())
183 if (ArgSize != strlen(
Args.getArgString(
Index))) {
185 return std::make_unique<Arg>(*
this, Spelling,
Index++,
Value);
190 if (
Index >
Args.getNumInputArgStrings() ||
194 return std::make_unique<Arg>(*
this, Spelling,
Index - 2,
200 if (
Index >
Args.getNumInputArgStrings() ||
204 return std::make_unique<Arg>(*
this, Spelling,
Index - 2,
210 if (ArgSize != strlen(
Args.getArgString(
Index)))
212 auto A = std::make_unique<Arg>(*
this, Spelling,
Index++);
213 while (
Index <
Args.getNumInputArgStrings() &&
215 A->getValues().push_back(
Args.getArgString(
Index++));
219 auto A = std::make_unique<Arg>(*
this, Spelling,
Index);
220 if (ArgSize != strlen(
Args.getArgString(
Index))) {
222 A->getValues().push_back(
Args.getArgString(
Index) + ArgSize);
225 while (
Index <
Args.getNumInputArgStrings() &&
227 A->getValues().push_back(
Args.getArgString(
Index++));
237 bool GroupedShortOption,
238 unsigned &
Index)
const {
240 ? std::make_unique<Arg>(*
this, CurArg,
Index)
267 std::make_unique<Arg>(UnaliasedOption, UnaliasedSpelling, A->getIndex());
277 UnaliasedA->getValues() = RawA->
getValues();
285 while (*Val !=
'\0') {
286 UnaliasedA->getValues().push_back(Val);
289 Val += strlen(Val) + 1;
294 UnaliasedA->getValues().push_back(
"");
Provide access to the Option info table.
Option(const OptTable::Info *Info, const OptTable *Owner)
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
This is an optimization pass for GlobalISel generic memory operations.
A concrete instance of a particular driver option.
ArgList - Ordered collection of driver arguments.
const Option getUnaliasedOption() const
getUnaliasedOption - Return the final option this option aliases (itself, if the option has no alias)...
const OptTable::Info * Info
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...
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
const char * getAliasArgs() const
Get the alias arguments as a \0 separated list.
SmallVectorImpl< const char * > & getValues()
void setOwnsValues(bool Value) const
@ RemainingArgsJoinedClass
bool matches(OptSpecifier ID) const
matches - Predicate for whether this option is part of the given option (which may be a group).
bool getOwnsValues() const
This class implements an extremely fast bulk output stream that can only output to a stream.
Analysis containing CSE Info
the resulting code requires compare and branches when and if the revised code is with conditional branches instead of More there is a byte word extend before each where there should be only and the condition codes are not remembered when the same two values are compared twice More LSR enhancements i8 and i32 load store addressing modes are identical int int c
void print(raw_ostream &O) const
OptSpecifier - Wrapper class for abstracting references to option IDs.
OptionClass getKind() const
StringRef getName() const
Get the name of this option without any prefix.
compiles ldr LCPI1_0 ldr ldr mov lsr tst moveq r1 ldr LCPI1_1 and r0 bx lr It would be better to do something like to fold the shift into the conditional move
StringRef getPrefix() const
Get the default prefix for this option.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
<%struct.s * > cast struct s *S to sbyte *< sbyte * > sbyte uint cast struct s *agg result to sbyte *< sbyte * > sbyte uint cast struct s *memtmp to sbyte *< sbyte * > sbyte uint ret void llc ends up issuing two memcpy or custom lower memcpy(of small size) to be ldmia/stmia. I think option 2 is better but the current register allocator cannot allocate a chunk of registers at a time. A feasible temporary solution is to use specific physical registers at the lowering time for small(<
unsigned getNumArgs() const
StringRef - Represent a constant reference to a string, i.e.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
constexpr LLVM_NODISCARD size_t size() const
size - Get the string size.
const char *const * Prefixes
A null terminated array of prefix strings to apply to name while matching.
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Option - Abstract representation for a single form of driver argument.
const Option getGroup() const
Entry for a single option instance in the option data table.
constexpr char Args[]
Key for Kernel::Metadata::mArgs.
const Option getAlias() const
LLVM Value Representation.