LLVM  14.0.0git
ArgList.h
Go to the documentation of this file.
1 //===- ArgList.h - Argument List Management ---------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_OPTION_ARGLIST_H
10 #define LLVM_OPTION_ARGLIST_H
11 
12 #include "llvm/ADT/ArrayRef.h"
13 #include "llvm/ADT/DenseMap.h"
15 #include "llvm/ADT/SmallString.h"
16 #include "llvm/ADT/SmallVector.h"
17 #include "llvm/ADT/StringRef.h"
18 #include "llvm/ADT/Twine.h"
19 #include "llvm/Option/Arg.h"
21 #include "llvm/Option/Option.h"
22 #include <algorithm>
23 #include <cstddef>
24 #include <initializer_list>
25 #include <iterator>
26 #include <list>
27 #include <memory>
28 #include <string>
29 #include <utility>
30 #include <vector>
31 
32 namespace llvm {
33 
34 class raw_ostream;
35 
36 namespace opt {
37 
38 /// arg_iterator - Iterates through arguments stored inside an ArgList.
39 template<typename BaseIter, unsigned NumOptSpecifiers = 0>
40 class arg_iterator {
41  /// The current argument and the end of the sequence we're iterating.
42  BaseIter Current, End;
43 
44  /// Optional filters on the arguments which will be match. To avoid a
45  /// zero-sized array, we store one specifier even if we're asked for none.
46  OptSpecifier Ids[NumOptSpecifiers ? NumOptSpecifiers : 1];
47 
48  void SkipToNextArg() {
49  for (; Current != End; ++Current) {
50  // Skip erased elements.
51  if (!*Current)
52  continue;
53 
54  // Done if there are no filters.
55  if (!NumOptSpecifiers)
56  return;
57 
58  // Otherwise require a match.
59  const Option &O = (*Current)->getOption();
60  for (auto Id : Ids) {
61  if (!Id.isValid())
62  break;
63  if (O.matches(Id))
64  return;
65  }
66  }
67  }
68 
69  using Traits = std::iterator_traits<BaseIter>;
70 
71 public:
72  using value_type = typename Traits::value_type;
73  using reference = typename Traits::reference;
74  using pointer = typename Traits::pointer;
75  using iterator_category = std::forward_iterator_tag;
76  using difference_type = std::ptrdiff_t;
77 
79  BaseIter Current, BaseIter End,
80  const OptSpecifier (&Ids)[NumOptSpecifiers ? NumOptSpecifiers : 1] = {})
81  : Current(Current), End(End) {
82  for (unsigned I = 0; I != NumOptSpecifiers; ++I)
83  this->Ids[I] = Ids[I];
84  SkipToNextArg();
85  }
86 
87  reference operator*() const { return *Current; }
88  pointer operator->() const { return Current; }
89 
91  ++Current;
92  SkipToNextArg();
93  return *this;
94  }
95 
97  arg_iterator tmp(*this);
98  ++(*this);
99  return tmp;
100  }
101 
103  return LHS.Current == RHS.Current;
104  }
106  return !(LHS == RHS);
107  }
108 };
109 
110 /// ArgList - Ordered collection of driver arguments.
111 ///
112 /// The ArgList class manages a list of Arg instances as well as
113 /// auxiliary data and convenience methods to allow Tools to quickly
114 /// check for the presence of Arg instances for a particular Option
115 /// and to iterate over groups of arguments.
116 class ArgList {
117 public:
122  using const_reverse_iterator =
124 
125  template<unsigned N> using filtered_iterator =
127  template<unsigned N> using filtered_reverse_iterator =
129 
130 private:
131  /// The internal list of arguments.
132  arglist_type Args;
133 
134  using OptRange = std::pair<unsigned, unsigned>;
135  static OptRange emptyRange() { return {-1u, 0u}; }
136 
137  /// The first and last index of each different OptSpecifier ID.
139 
140  /// Get the range of indexes in which options with the specified IDs might
141  /// reside, or (0, 0) if there are no such options.
142  OptRange getRange(std::initializer_list<OptSpecifier> Ids) const;
143 
144 protected:
145  // Make the default special members protected so they won't be used to slice
146  // derived objects, but can still be used by derived objects to implement
147  // their own special members.
148  ArgList() = default;
149 
150  // Explicit move operations to ensure the container is cleared post-move
151  // otherwise it could lead to a double-delete in the case of moving of an
152  // InputArgList which deletes the contents of the container. If we could fix
153  // up the ownership here (delegate storage/ownership to the derived class so
154  // it can be a container of unique_ptr) this would be simpler.
156  : Args(std::move(RHS.Args)), OptRanges(std::move(RHS.OptRanges)) {
157  RHS.Args.clear();
158  RHS.OptRanges.clear();
159  }
160 
162  Args = std::move(RHS.Args);
163  RHS.Args.clear();
164  OptRanges = std::move(RHS.OptRanges);
165  RHS.OptRanges.clear();
166  return *this;
167  }
168 
169  // Protect the dtor to ensure this type is never destroyed polymorphically.
170  ~ArgList() = default;
171 
172  // Implicitly convert a value to an OptSpecifier. Used to work around a bug
173  // in MSVC's implementation of narrowing conversion checking.
175 
176 public:
177  /// @name Arg Access
178  /// @{
179 
180  /// append - Append \p A to the arg list.
181  void append(Arg *A);
182 
183  const arglist_type &getArgs() const { return Args; }
184 
185  unsigned size() const { return Args.size(); }
186 
187  /// @}
188  /// @name Arg Iteration
189  /// @{
190 
191  iterator begin() { return {Args.begin(), Args.end()}; }
192  iterator end() { return {Args.end(), Args.end()}; }
193 
194  reverse_iterator rbegin() { return {Args.rbegin(), Args.rend()}; }
195  reverse_iterator rend() { return {Args.rend(), Args.rend()}; }
196 
197  const_iterator begin() const { return {Args.begin(), Args.end()}; }
198  const_iterator end() const { return {Args.end(), Args.end()}; }
199 
200  const_reverse_iterator rbegin() const { return {Args.rbegin(), Args.rend()}; }
201  const_reverse_iterator rend() const { return {Args.rend(), Args.rend()}; }
202 
203  template<typename ...OptSpecifiers>
204  iterator_range<filtered_iterator<sizeof...(OptSpecifiers)>>
205  filtered(OptSpecifiers ...Ids) const {
206  OptRange Range = getRange({toOptSpecifier(Ids)...});
207  auto B = Args.begin() + Range.first;
208  auto E = Args.begin() + Range.second;
209  using Iterator = filtered_iterator<sizeof...(OptSpecifiers)>;
210  return make_range(Iterator(B, E, {toOptSpecifier(Ids)...}),
211  Iterator(E, E, {toOptSpecifier(Ids)...}));
212  }
213 
214  template<typename ...OptSpecifiers>
215  iterator_range<filtered_reverse_iterator<sizeof...(OptSpecifiers)>>
216  filtered_reverse(OptSpecifiers ...Ids) const {
217  OptRange Range = getRange({toOptSpecifier(Ids)...});
218  auto B = Args.rend() - Range.second;
219  auto E = Args.rend() - Range.first;
220  using Iterator = filtered_reverse_iterator<sizeof...(OptSpecifiers)>;
221  return make_range(Iterator(B, E, {toOptSpecifier(Ids)...}),
222  Iterator(E, E, {toOptSpecifier(Ids)...}));
223  }
224 
225  /// @}
226  /// @name Arg Removal
227  /// @{
228 
229  /// eraseArg - Remove any option matching \p Id.
230  void eraseArg(OptSpecifier Id);
231 
232  /// @}
233  /// @name Arg Access
234  /// @{
235 
236  /// hasArg - Does the arg list contain any option matching \p Id.
237  ///
238  /// \p Claim Whether the argument should be claimed, if it exists.
239  template<typename ...OptSpecifiers>
240  bool hasArgNoClaim(OptSpecifiers ...Ids) const {
241  return getLastArgNoClaim(Ids...) != nullptr;
242  }
243  template<typename ...OptSpecifiers>
244  bool hasArg(OptSpecifiers ...Ids) const {
245  return getLastArg(Ids...) != nullptr;
246  }
247 
248  /// Return true if the arg list contains multiple arguments matching \p Id.
250  auto Args = filtered(Id);
251  return (Args.begin() != Args.end()) && (++Args.begin()) != Args.end();
252  }
253 
254  /// Return the last argument matching \p Id, or null.
255  template<typename ...OptSpecifiers>
256  Arg *getLastArg(OptSpecifiers ...Ids) const {
257  Arg *Res = nullptr;
258  for (Arg *A : filtered(Ids...)) {
259  Res = A;
260  Res->claim();
261  }
262  return Res;
263  }
264 
265  /// Return the last argument matching \p Id, or null. Do not "claim" the
266  /// option (don't mark it as having been used).
267  template<typename ...OptSpecifiers>
268  Arg *getLastArgNoClaim(OptSpecifiers ...Ids) const {
269  for (Arg *A : filtered_reverse(Ids...))
270  return A;
271  return nullptr;
272  }
273 
274  /// getArgString - Return the input argument string at \p Index.
275  virtual const char *getArgString(unsigned Index) const = 0;
276 
277  /// getNumInputArgStrings - Return the number of original argument strings,
278  /// which are guaranteed to be the first strings in the argument string
279  /// list.
280  virtual unsigned getNumInputArgStrings() const = 0;
281 
282  /// @}
283  /// @name Argument Lookup Utilities
284  /// @{
285 
286  /// getLastArgValue - Return the value of the last argument, or a default.
287  StringRef getLastArgValue(OptSpecifier Id, StringRef Default = "") const;
288 
289  /// getAllArgValues - Get the values of all instances of the given argument
290  /// as strings.
291  std::vector<std::string> getAllArgValues(OptSpecifier Id) const;
292 
293  /// @}
294  /// @name Translation Utilities
295  /// @{
296 
297  /// hasFlag - Given an option \p Pos and its negative form \p Neg, return
298  /// true if the option is present, false if the negation is present, and
299  /// \p Default if neither option is given. If both the option and its
300  /// negation are present, the last one wins.
301  bool hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default=true) const;
302 
303  /// hasFlag - Given an option \p Pos, an alias \p PosAlias and its negative
304  /// form \p Neg, return true if the option or its alias is present, false if
305  /// the negation is present, and \p Default if none of the options are
306  /// given. If multiple options are present, the last one wins.
307  bool hasFlag(OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg,
308  bool Default = true) const;
309 
310  /// Render only the last argument match \p Id0, if present.
311  template<typename ...OptSpecifiers>
312  void AddLastArg(ArgStringList &Output, OptSpecifiers ...Ids) const {
313  if (Arg *A = getLastArg(Ids...)) // Calls claim() on all Ids's Args.
314  A->render(*this, Output);
315  }
316 
317  /// AddAllArgsExcept - Render all arguments matching any of the given ids
318  /// and not matching any of the excluded ids.
320  ArrayRef<OptSpecifier> ExcludeIds) const;
321  /// AddAllArgs - Render all arguments matching any of the given ids.
322  void AddAllArgs(ArgStringList &Output, ArrayRef<OptSpecifier> Ids) const;
323 
324  /// AddAllArgs - Render all arguments matching the given ids.
325  void AddAllArgs(ArgStringList &Output, OptSpecifier Id0,
326  OptSpecifier Id1 = 0U, OptSpecifier Id2 = 0U) const;
327 
328  /// AddAllArgValues - Render the argument values of all arguments
329  /// matching the given ids.
330  void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
331  OptSpecifier Id1 = 0U, OptSpecifier Id2 = 0U) const;
332 
333  /// AddAllArgsTranslated - Render all the arguments matching the
334  /// given ids, but forced to separate args and using the provided
335  /// name instead of the first option value.
336  ///
337  /// \param Joined - If true, render the argument as joined with
338  /// the option specifier.
340  const char *Translation,
341  bool Joined = false) const;
342 
343  /// ClaimAllArgs - Claim all arguments which match the given
344  /// option id.
345  void ClaimAllArgs(OptSpecifier Id0) const;
346 
347  /// ClaimAllArgs - Claim all arguments.
348  ///
349  void ClaimAllArgs() const;
350  /// @}
351  /// @name Arg Synthesis
352  /// @{
353 
354  /// Construct a constant string pointer whose
355  /// lifetime will match that of the ArgList.
356  virtual const char *MakeArgStringRef(StringRef Str) const = 0;
357  const char *MakeArgString(const Twine &Str) const {
358  SmallString<256> Buf;
359  return MakeArgStringRef(Str.toStringRef(Buf));
360  }
361 
362  /// Create an arg string for (\p LHS + \p RHS), reusing the
363  /// string at \p Index if possible.
364  const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
365  StringRef RHS) const;
366 
367  void print(raw_ostream &O) const;
368  void dump() const;
369 
370  /// @}
371 };
372 
373 class InputArgList final : public ArgList {
374 private:
375  /// List of argument strings used by the contained Args.
376  ///
377  /// This is mutable since we treat the ArgList as being the list
378  /// of Args, and allow routines to add new strings (to have a
379  /// convenient place to store the memory) via MakeIndex.
380  mutable ArgStringList ArgStrings;
381 
382  /// Strings for synthesized arguments.
383  ///
384  /// This is mutable since we treat the ArgList as being the list
385  /// of Args, and allow routines to add new strings (to have a
386  /// convenient place to store the memory) via MakeIndex.
387  mutable std::list<std::string> SynthesizedStrings;
388 
389  /// The number of original input argument strings.
390  unsigned NumInputArgStrings;
391 
392  /// Release allocated arguments.
393  void releaseMemory();
394 
395 public:
396  InputArgList() : NumInputArgStrings(0) {}
397 
398  InputArgList(const char* const *ArgBegin, const char* const *ArgEnd);
399 
401  : ArgList(std::move(RHS)), ArgStrings(std::move(RHS.ArgStrings)),
402  SynthesizedStrings(std::move(RHS.SynthesizedStrings)),
403  NumInputArgStrings(RHS.NumInputArgStrings) {}
404 
406  releaseMemory();
408  ArgStrings = std::move(RHS.ArgStrings);
409  SynthesizedStrings = std::move(RHS.SynthesizedStrings);
410  NumInputArgStrings = RHS.NumInputArgStrings;
411  return *this;
412  }
413 
414  ~InputArgList() { releaseMemory(); }
415 
416  const char *getArgString(unsigned Index) const override {
417  return ArgStrings[Index];
418  }
419 
420  void replaceArgString(unsigned Index, const Twine &S) {
421  ArgStrings[Index] = MakeArgString(S);
422  }
423 
424  unsigned getNumInputArgStrings() const override {
425  return NumInputArgStrings;
426  }
427 
428  /// @name Arg Synthesis
429  /// @{
430 
431 public:
432  /// MakeIndex - Get an index for the given string(s).
433  unsigned MakeIndex(StringRef String0) const;
434  unsigned MakeIndex(StringRef String0, StringRef String1) const;
435 
437  const char *MakeArgStringRef(StringRef Str) const override;
438 
439  /// @}
440 };
441 
442 /// DerivedArgList - An ordered collection of driver arguments,
443 /// whose storage may be in another argument list.
444 class DerivedArgList final : public ArgList {
445  const InputArgList &BaseArgs;
446 
447  /// The list of arguments we synthesized.
448  mutable SmallVector<std::unique_ptr<Arg>, 16> SynthesizedArgs;
449 
450 public:
451  /// Construct a new derived arg list from \p BaseArgs.
452  DerivedArgList(const InputArgList &BaseArgs);
453 
454  const char *getArgString(unsigned Index) const override {
455  return BaseArgs.getArgString(Index);
456  }
457 
458  unsigned getNumInputArgStrings() const override {
459  return BaseArgs.getNumInputArgStrings();
460  }
461 
462  const InputArgList &getBaseArgs() const {
463  return BaseArgs;
464  }
465 
466  /// @name Arg Synthesis
467  /// @{
468 
469  /// AddSynthesizedArg - Add a argument to the list of synthesized arguments
470  /// (to be freed).
471  void AddSynthesizedArg(Arg *A);
472 
474  const char *MakeArgStringRef(StringRef Str) const override;
475 
476  /// AddFlagArg - Construct a new FlagArg for the given option \p Id and
477  /// append it to the argument list.
478  void AddFlagArg(const Arg *BaseArg, const Option Opt) {
479  append(MakeFlagArg(BaseArg, Opt));
480  }
481 
482  /// AddPositionalArg - Construct a new Positional arg for the given option
483  /// \p Id, with the provided \p Value and append it to the argument
484  /// list.
485  void AddPositionalArg(const Arg *BaseArg, const Option Opt,
486  StringRef Value) {
487  append(MakePositionalArg(BaseArg, Opt, Value));
488  }
489 
490  /// AddSeparateArg - Construct a new Positional arg for the given option
491  /// \p Id, with the provided \p Value and append it to the argument
492  /// list.
493  void AddSeparateArg(const Arg *BaseArg, const Option Opt,
494  StringRef Value) {
495  append(MakeSeparateArg(BaseArg, Opt, Value));
496  }
497 
498  /// AddJoinedArg - Construct a new Positional arg for the given option
499  /// \p Id, with the provided \p Value and append it to the argument list.
500  void AddJoinedArg(const Arg *BaseArg, const Option Opt,
501  StringRef Value) {
502  append(MakeJoinedArg(BaseArg, Opt, Value));
503  }
504 
505  /// MakeFlagArg - Construct a new FlagArg for the given option \p Id.
506  Arg *MakeFlagArg(const Arg *BaseArg, const Option Opt) const;
507 
508  /// MakePositionalArg - Construct a new Positional arg for the
509  /// given option \p Id, with the provided \p Value.
510  Arg *MakePositionalArg(const Arg *BaseArg, const Option Opt,
511  StringRef Value) const;
512 
513  /// MakeSeparateArg - Construct a new Positional arg for the
514  /// given option \p Id, with the provided \p Value.
515  Arg *MakeSeparateArg(const Arg *BaseArg, const Option Opt,
516  StringRef Value) const;
517 
518  /// MakeJoinedArg - Construct a new Positional arg for the
519  /// given option \p Id, with the provided \p Value.
520  Arg *MakeJoinedArg(const Arg *BaseArg, const Option Opt,
521  StringRef Value) const;
522 
523  /// @}
524 };
525 
526 } // end namespace opt
527 
528 } // end namespace llvm
529 
530 #endif // LLVM_OPTION_ARGLIST_H
Option.h
llvm::opt::ArgList::AddLastArg
void AddLastArg(ArgStringList &Output, OptSpecifiers ...Ids) const
Render only the last argument match Id0, if present.
Definition: ArgList.h:312
llvm::opt::arg_iterator::arg_iterator
arg_iterator(BaseIter Current, BaseIter End, const OptSpecifier(&Ids)[NumOptSpecifiers ? NumOptSpecifiers :1]={})
Definition: ArgList.h:78
llvm::opt::ArgList::hasFlag
bool hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default=true) const
hasFlag - Given an option Pos and its negative form Neg, return true if the option is present,...
Definition: ArgList.cpp:73
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AllocatorList.h:22
llvm::make_range
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Definition: iterator_range.h:53
llvm::opt::DerivedArgList::MakePositionalArg
Arg * MakePositionalArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
MakePositionalArg - Construct a new Positional arg for the given option Id, with the provided Value.
Definition: ArgList.cpp:249
llvm::opt::InputArgList
Definition: ArgList.h:373
llvm::opt::Arg
A concrete instance of a particular driver option.
Definition: Arg.h:34
llvm::opt::DerivedArgList::getNumInputArgStrings
unsigned getNumInputArgStrings() const override
getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be th...
Definition: ArgList.h:458
StringRef.h
pointer
Replace within non kernel function use of LDS with pointer
Definition: AMDGPUReplaceLDSUseWithPointer.cpp:631
llvm::opt::ArgList::getNumInputArgStrings
virtual unsigned getNumInputArgStrings() const =0
getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be th...
llvm::opt::ArgList
ArgList - Ordered collection of driver arguments.
Definition: ArgList.h:116
llvm::SmallVector< Arg *, 16 >
llvm::opt::ArgList::rbegin
const_reverse_iterator rbegin() const
Definition: ArgList.h:200
llvm::opt::ArgList::dump
void dump() const
Definition: ArgList.cpp:193
llvm::opt::DerivedArgList::MakeFlagArg
Arg * MakeFlagArg(const Arg *BaseArg, const Option Opt) const
MakeFlagArg - Construct a new FlagArg for the given option Id.
Definition: ArgList.cpp:242
llvm::opt::Arg::claim
void claim() const
Set the Arg claimed bit.
Definition: Arg.h:109
llvm::opt::ArgList::GetOrMakeJoinedArgString
const char * GetOrMakeJoinedArgString(unsigned Index, StringRef LHS, StringRef RHS) const
Create an arg string for (LHS + RHS), reusing the string at Index if possible.
Definition: ArgList.cpp:174
llvm::opt::ArgList::hasArgNoClaim
bool hasArgNoClaim(OptSpecifiers ...Ids) const
hasArg - Does the arg list contain any option matching Id.
Definition: ArgList.h:240
llvm::opt::ArgList::getLastArgNoClaim
Arg * getLastArgNoClaim(OptSpecifiers ...Ids) const
Return the last argument matching Id, or null.
Definition: ArgList.h:268
DenseMap.h
llvm::opt::InputArgList::~InputArgList
~InputArgList()
Definition: ArgList.h:414
llvm::opt::ArgList::end
iterator end()
Definition: ArgList.h:192
llvm::opt::ArgList::AddAllArgsExcept
void AddAllArgsExcept(ArgStringList &Output, ArrayRef< OptSpecifier > Ids, ArrayRef< OptSpecifier > ExcludeIds) const
AddAllArgsExcept - Render all arguments matching any of the given ids and not matching any of the exc...
Definition: ArgList.cpp:98
llvm::opt::ArgList::getArgs
const arglist_type & getArgs() const
Definition: ArgList.h:183
llvm::opt::ArgList::filtered_iterator
arg_iterator< arglist_type::const_iterator, N > filtered_iterator
Definition: ArgList.h:126
RHS
Value * RHS
Definition: X86PartialReduction.cpp:74
tmp
alloca< 16 x float >, align 16 %tmp2=alloca< 16 x float >, align 16 store< 16 x float > %A,< 16 x float > *%tmp %s=bitcast< 16 x float > *%tmp to i8 *%s2=bitcast< 16 x float > *%tmp2 to i8 *call void @llvm.memcpy.i64(i8 *%s, i8 *%s2, i64 64, i32 16) %R=load< 16 x float > *%tmp2 ret< 16 x float > %R } declare void @llvm.memcpy.i64(i8 *nocapture, i8 *nocapture, i64, i32) nounwind which compiles to:_foo:subl $140, %esp movaps %xmm3, 112(%esp) movaps %xmm2, 96(%esp) movaps %xmm1, 80(%esp) movaps %xmm0, 64(%esp) movl 60(%esp), %eax movl %eax, 124(%esp) movl 56(%esp), %eax movl %eax, 120(%esp) movl 52(%esp), %eax< many many more 32-bit copies > movaps(%esp), %xmm0 movaps 16(%esp), %xmm1 movaps 32(%esp), %xmm2 movaps 48(%esp), %xmm3 addl $140, %esp ret On Nehalem, it may even be cheaper to just use movups when unaligned than to fall back to lower-granularity chunks. Implement processor-specific optimizations for parity with GCC on these processors. GCC does two optimizations:1. ix86_pad_returns inserts a noop before ret instructions if immediately preceded by a conditional branch or is the target of a jump. 2. ix86_avoid_jump_misspredicts inserts noops in cases where a 16-byte block of code contains more than 3 branches. The first one is done for all AMDs, Core2, and "Generic" The second one is done for:Atom, Pentium Pro, all AMDs, Pentium 4, Nocona, Core 2, and "Generic" Testcase:int x(int a) { return(a &0xf0)> >4 tmp
Definition: README.txt:1347
llvm::opt::ArgList::rend
const_reverse_iterator rend() const
Definition: ArgList.h:201
llvm::opt::ArgList::begin
iterator begin()
Definition: ArgList.h:191
llvm::opt::InputArgList::getArgString
const char * getArgString(unsigned Index) const override
getArgString - Return the input argument string at Index.
Definition: ArgList.h:416
llvm::opt::arg_iterator::value_type
typename Traits::value_type value_type
Definition: ArgList.h:72
LHS
Value * LHS
Definition: X86PartialReduction.cpp:73
llvm::opt::ArgList::end
const_iterator end() const
Definition: ArgList.h:198
llvm::opt::DerivedArgList::AddSeparateArg
void AddSeparateArg(const Arg *BaseArg, const Option Opt, StringRef Value)
AddSeparateArg - Construct a new Positional arg for the given option Id, with the provided Value and ...
Definition: ArgList.h:493
llvm::opt::ArgList::~ArgList
~ArgList()=default
llvm::opt::arg_iterator::operator++
arg_iterator operator++(int)
Definition: ArgList.h:96
SmallString.h
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
Twine.h
llvm::opt::DerivedArgList::MakeSeparateArg
Arg * MakeSeparateArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
MakeSeparateArg - Construct a new Positional arg for the given option Id, with the provided Value.
Definition: ArgList.cpp:258
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
opt
arm prera ldst opt
Definition: ARMLoadStoreOptimizer.cpp:2189
llvm::opt::ArgList::operator=
ArgList & operator=(ArgList &&RHS)
Definition: ArgList.h:161
llvm::raw_ostream
This class implements an extremely fast bulk output stream that can only output to a stream.
Definition: raw_ostream.h:54
llvm::opt::ArgList::getLastArgValue
StringRef getLastArgValue(OptSpecifier Id, StringRef Default="") const
getLastArgValue - Return the value of the last argument, or a default.
Definition: ArgList.cpp:86
llvm::opt::arg_iterator::iterator_category
std::forward_iterator_tag iterator_category
Definition: ArgList.h:75
llvm::opt::ArgList::eraseArg
void eraseArg(OptSpecifier Id)
eraseArg - Remove any option matching Id.
Definition: ArgList.cpp:46
llvm::opt::DerivedArgList::getArgString
const char * getArgString(unsigned Index) const override
getArgString - Return the input argument string at Index.
Definition: ArgList.h:454
llvm::opt::ArgList::ArgList
ArgList()=default
llvm::opt::OptSpecifier
OptSpecifier - Wrapper class for abstracting references to option IDs.
Definition: OptSpecifier.h:18
llvm::opt::ArgList::append
void append(Arg *A)
append - Append A to the arg list.
Definition: ArgList.cpp:33
llvm::opt::arg_iterator::operator==
friend bool operator==(arg_iterator LHS, arg_iterator RHS)
Definition: ArgList.h:102
llvm::SmallString< 256 >
llvm::opt::ArgList::size
unsigned size() const
Definition: ArgList.h:185
llvm::opt::ArgList::filtered_reverse
iterator_range< filtered_reverse_iterator< sizeof...(OptSpecifiers)> > filtered_reverse(OptSpecifiers ...Ids) const
Definition: ArgList.h:216
llvm::opt::ArgList::getAllArgValues
std::vector< std::string > getAllArgValues(OptSpecifier Id) const
getAllArgValues - Get the values of all instances of the given argument as strings.
Definition: ArgList.cpp:92
llvm::RISCVFenceField::O
@ O
Definition: RISCVBaseInfo.h:207
Index
uint32_t Index
Definition: ELFObjHandler.cpp:83
llvm::opt::ArgList::filtered_reverse_iterator
arg_iterator< arglist_type::const_reverse_iterator, N > filtered_reverse_iterator
Definition: ArgList.h:128
move
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
Definition: README.txt:546
llvm::DenseMap< unsigned, OptRange >
llvm::opt::ArgList::ClaimAllArgs
void ClaimAllArgs() const
ClaimAllArgs - Claim all arguments.
Definition: ArgList.cpp:168
I
#define I(x, y, z)
Definition: MD5.cpp:58
llvm::opt::ArgList::AddAllArgValues
void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0, OptSpecifier Id1=0U, OptSpecifier Id2=0U) const
AddAllArgValues - Render the argument values of all arguments matching the given ids.
Definition: ArgList.cpp:138
llvm::opt::DerivedArgList::AddPositionalArg
void AddPositionalArg(const Arg *BaseArg, const Option Opt, StringRef Value)
AddPositionalArg - Construct a new Positional arg for the given option Id, with the provided Value an...
Definition: ArgList.h:485
llvm::opt::ArgList::rbegin
reverse_iterator rbegin()
Definition: ArgList.h:194
llvm::opt::InputArgList::InputArgList
InputArgList()
Definition: ArgList.h:396
llvm::opt::ArgList::toOptSpecifier
static OptSpecifier toOptSpecifier(OptSpecifier S)
Definition: ArgList.h:174
ArrayRef.h
llvm::opt::DerivedArgList::DerivedArgList
DerivedArgList(const InputArgList &BaseArgs)
Construct a new derived arg list from BaseArgs.
Definition: ArgList.cpp:231
llvm::opt::InputArgList::replaceArgString
void replaceArgString(unsigned Index, const Twine &S)
Definition: ArgList.h:420
llvm::move
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
Definition: STLExtras.h:1650
llvm::opt::InputArgList::InputArgList
InputArgList(InputArgList &&RHS)
Definition: ArgList.h:400
iterator_range.h
llvm::opt::ArgList::hasMultipleArgs
bool hasMultipleArgs(OptSpecifier Id) const
Return true if the arg list contains multiple arguments matching Id.
Definition: ArgList.h:249
OptSpecifier.h
Arg.h
llvm::ArrayRef
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Definition: APInt.h:32
llvm::opt::arg_iterator::operator++
arg_iterator & operator++()
Definition: ArgList.h:90
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:58
llvm::opt::arg_iterator::pointer
typename Traits::pointer pointer
Definition: ArgList.h:74
llvm::opt::DerivedArgList::AddJoinedArg
void AddJoinedArg(const Arg *BaseArg, const Option Opt, StringRef Value)
AddJoinedArg - Construct a new Positional arg for the given option Id, with the provided Value and ap...
Definition: ArgList.h:500
llvm::opt::ArgList::MakeArgStringRef
virtual const char * MakeArgStringRef(StringRef Str) const =0
Construct a constant string pointer whose lifetime will match that of the ArgList.
S
add sub stmia L5 ldr r0 bl L_printf $stub Instead of a and a wouldn t it be better to do three moves *Return an aggregate type is even return S
Definition: README.txt:210
llvm::opt::ArgList::print
void print(raw_ostream &O) const
Definition: ArgList.cpp:185
llvm::opt::ArgList::AddAllArgsTranslated
void AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0, const char *Translation, bool Joined=false) const
AddAllArgsTranslated - Render all the arguments matching the given ids, but forced to separate args a...
Definition: ArgList.cpp:147
llvm::opt::InputArgList::getNumInputArgStrings
unsigned getNumInputArgStrings() const override
getNumInputArgStrings - Return the number of original argument strings, which are guaranteed to be th...
Definition: ArgList.h:424
llvm::opt::InputArgList::operator=
InputArgList & operator=(InputArgList &&RHS)
Definition: ArgList.h:405
llvm::opt::arg_iterator::difference_type
std::ptrdiff_t difference_type
Definition: ArgList.h:76
llvm::Twine
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
Definition: Twine.h:83
std
Definition: BitVector.h:850
llvm::opt::arg_iterator::operator!=
friend bool operator!=(arg_iterator LHS, arg_iterator RHS)
Definition: ArgList.h:105
llvm::opt::Option
Option - Abstract representation for a single form of driver argument.
Definition: Option.h:51
llvm::opt::DerivedArgList::getBaseArgs
const InputArgList & getBaseArgs() const
Definition: ArgList.h:462
llvm::opt::DerivedArgList::AddSynthesizedArg
void AddSynthesizedArg(Arg *A)
AddSynthesizedArg - Add a argument to the list of synthesized arguments (to be freed).
Definition: ArgList.cpp:238
llvm::opt::ArgList::AddAllArgs
void AddAllArgs(ArgStringList &Output, ArrayRef< OptSpecifier > Ids) const
AddAllArgs - Render all arguments matching any of the given ids.
Definition: ArgList.cpp:122
llvm::opt::ArgList::filtered
iterator_range< filtered_iterator< sizeof...(OptSpecifiers)> > filtered(OptSpecifiers ...Ids) const
Definition: ArgList.h:205
llvm::opt::arg_iterator::operator->
pointer operator->() const
Definition: ArgList.h:88
llvm::opt::arg_iterator::reference
typename Traits::reference reference
Definition: ArgList.h:73
llvm::opt::arg_iterator
arg_iterator - Iterates through arguments stored inside an ArgList.
Definition: ArgList.h:40
llvm::opt::InputArgList::MakeArgStringRef
const char * MakeArgStringRef(StringRef Str) const override
Construct a constant string pointer whose lifetime will match that of the ArgList.
Definition: ArgList.cpp:227
llvm::opt::ArgList::ArgList
ArgList(ArgList &&RHS)
Definition: ArgList.h:155
SmallVector.h
llvm::opt::ArgList::MakeArgString
const char * MakeArgString(const Twine &Str) const
Definition: ArgList.h:357
llvm::opt::InputArgList::MakeIndex
unsigned MakeIndex(StringRef String0) const
MakeIndex - Get an index for the given string(s).
Definition: ArgList.cpp:208
llvm::opt::ArgList::begin
const_iterator begin() const
Definition: ArgList.h:197
llvm::opt::DerivedArgList
DerivedArgList - An ordered collection of driver arguments, whose storage may be in another argument ...
Definition: ArgList.h:444
llvm::iterator_range
A range adaptor for a pair of iterators.
Definition: iterator_range.h:30
llvm::opt::ArgList::hasArg
bool hasArg(OptSpecifiers ...Ids) const
Definition: ArgList.h:244
llvm::opt::ArgList::rend
reverse_iterator rend()
Definition: ArgList.h:195
llvm::AMDGPU::VGPRIndexMode::Id
Id
Definition: SIDefines.h:232
llvm::opt::arg_iterator::operator*
reference operator*() const
Definition: ArgList.h:87
llvm::opt::DerivedArgList::MakeJoinedArg
Arg * MakeJoinedArg(const Arg *BaseArg, const Option Opt, StringRef Value) const
MakeJoinedArg - Construct a new Positional arg for the given option Id, with the provided Value.
Definition: ArgList.cpp:267
llvm::Value
LLVM Value Representation.
Definition: Value.h:74
llvm::opt::ArgList::getArgString
virtual const char * getArgString(unsigned Index) const =0
getArgString - Return the input argument string at Index.
llvm::opt::DerivedArgList::AddFlagArg
void AddFlagArg(const Arg *BaseArg, const Option Opt)
AddFlagArg - Construct a new FlagArg for the given option Id and append it to the argument list.
Definition: ArgList.h:478
llvm::opt::DerivedArgList::MakeArgStringRef
const char * MakeArgStringRef(StringRef Str) const override
Construct a constant string pointer whose lifetime will match that of the ArgList.
Definition: ArgList.cpp:234
llvm::opt::ArgList::getLastArg
Arg * getLastArg(OptSpecifiers ...Ids) const
Return the last argument matching Id, or null.
Definition: ArgList.h:256