11
11
12
12
#include " llvm/ADT/ArrayRef.h"
13
13
#include " llvm/ADT/DenseMap.h"
14
- #include " llvm/ADT/iterator_range.h"
15
14
#include " llvm/ADT/SmallString.h"
16
15
#include " llvm/ADT/SmallVector.h"
17
16
#include " llvm/ADT/StringRef.h"
18
17
#include " llvm/ADT/Twine.h"
18
+ #include " llvm/ADT/iterator_range.h"
19
19
#include " llvm/Option/Arg.h"
20
20
#include " llvm/Option/OptSpecifier.h"
21
21
#include " llvm/Option/Option.h"
22
+ #include " llvm/Support/Compiler.h"
22
23
#include < algorithm>
23
24
#include < cstddef>
24
25
#include < initializer_list>
@@ -139,7 +140,7 @@ class ArgList {
139
140
140
141
// / Get the range of indexes in which options with the specified IDs might
141
142
// / reside, or (0, 0) if there are no such options.
142
- OptRange getRange (std::initializer_list<OptSpecifier> Ids) const ;
143
+ LLVM_ABI OptRange getRange (std::initializer_list<OptSpecifier> Ids) const ;
143
144
144
145
protected:
145
146
// Make the default special members protected so they won't be used to slice
@@ -178,7 +179,7 @@ class ArgList {
178
179
// / @{
179
180
180
181
// / append - Append \p A to the arg list.
181
- void append (Arg *A);
182
+ LLVM_ABI void append (Arg *A);
182
183
183
184
const arglist_type &getArgs () const { return Args; }
184
185
@@ -227,7 +228,7 @@ class ArgList {
227
228
// / @{
228
229
229
230
// / eraseArg - Remove any option matching \p Id.
230
- void eraseArg (OptSpecifier Id);
231
+ LLVM_ABI void eraseArg (OptSpecifier Id);
231
232
232
233
// / @}
233
234
// / @name Arg Access
@@ -284,11 +285,12 @@ class ArgList {
284
285
// / @{
285
286
286
287
// / getLastArgValue - Return the value of the last argument, or a default.
287
- StringRef getLastArgValue (OptSpecifier Id, StringRef Default = " " ) const ;
288
+ LLVM_ABI StringRef getLastArgValue (OptSpecifier Id,
289
+ StringRef Default = " " ) const ;
288
290
289
291
// / getAllArgValues - Get the values of all instances of the given argument
290
292
// / as strings.
291
- std::vector<std::string> getAllArgValues (OptSpecifier Id) const ;
293
+ LLVM_ABI std::vector<std::string> getAllArgValues (OptSpecifier Id) const ;
292
294
293
295
// / @}
294
296
// / @name Translation Utilities
@@ -298,20 +300,21 @@ class ArgList {
298
300
// / true if the option is present, false if the negation is present, and
299
301
// / \p Default if neither option is given. If both the option and its
300
302
// / negation are present, the last one wins.
301
- bool hasFlag (OptSpecifier Pos, OptSpecifier Neg, bool Default) const ;
302
- bool hasFlagNoClaim (OptSpecifier Pos, OptSpecifier Neg, bool Default) const ;
303
+ LLVM_ABI bool hasFlag (OptSpecifier Pos, OptSpecifier Neg, bool Default) const ;
304
+ LLVM_ABI bool hasFlagNoClaim (OptSpecifier Pos, OptSpecifier Neg,
305
+ bool Default) const ;
303
306
304
307
// / hasFlag - Given an option \p Pos, an alias \p PosAlias and its negative
305
308
// / form \p Neg, return true if the option or its alias is present, false if
306
309
// / the negation is present, and \p Default if none of the options are
307
310
// / given. If multiple options are present, the last one wins.
308
- bool hasFlag (OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg ,
309
- bool Default) const ;
311
+ LLVM_ABI bool hasFlag (OptSpecifier Pos, OptSpecifier PosAlias,
312
+ OptSpecifier Neg, bool Default) const ;
310
313
311
314
// / Given an option Pos and its negative form Neg, render the option if Pos is
312
315
// / present.
313
- void addOptInFlag (ArgStringList &Output, OptSpecifier Pos,
314
- OptSpecifier Neg) const ;
316
+ LLVM_ABI void addOptInFlag (ArgStringList &Output, OptSpecifier Pos,
317
+ OptSpecifier Neg) const ;
315
318
// / Render the option if Neg is present.
316
319
void addOptOutFlag (ArgStringList &Output, OptSpecifier Pos,
317
320
OptSpecifier Neg) const {
@@ -331,32 +334,35 @@ class ArgList {
331
334
332
335
// / AddAllArgsExcept - Render all arguments matching any of the given ids
333
336
// / and not matching any of the excluded ids.
334
- void AddAllArgsExcept (ArgStringList &Output, ArrayRef<OptSpecifier> Ids,
335
- ArrayRef<OptSpecifier> ExcludeIds) const ;
337
+ LLVM_ABI void AddAllArgsExcept (ArgStringList &Output,
338
+ ArrayRef<OptSpecifier> Ids,
339
+ ArrayRef<OptSpecifier> ExcludeIds) const ;
336
340
// / Render all arguments matching any of the given ids.
337
- void addAllArgs (ArgStringList &Output, ArrayRef<OptSpecifier> Ids) const ;
341
+ LLVM_ABI void addAllArgs (ArgStringList &Output,
342
+ ArrayRef<OptSpecifier> Ids) const ;
338
343
339
344
// / AddAllArgs - Render all arguments matching the given ids.
340
- void AddAllArgs (ArgStringList &Output, OptSpecifier Id0) const ;
345
+ LLVM_ABI void AddAllArgs (ArgStringList &Output, OptSpecifier Id0) const ;
341
346
342
347
// / AddAllArgValues - Render the argument values of all arguments
343
348
// / matching the given ids.
344
- void AddAllArgValues (ArgStringList &Output, OptSpecifier Id0,
345
- OptSpecifier Id1 = 0U , OptSpecifier Id2 = 0U ) const ;
349
+ LLVM_ABI void AddAllArgValues (ArgStringList &Output, OptSpecifier Id0,
350
+ OptSpecifier Id1 = 0U ,
351
+ OptSpecifier Id2 = 0U ) const ;
346
352
347
353
// / AddAllArgsTranslated - Render all the arguments matching the
348
354
// / given ids, but forced to separate args and using the provided
349
355
// / name instead of the first option value.
350
356
// /
351
357
// / \param Joined - If true, render the argument as joined with
352
358
// / the option specifier.
353
- void AddAllArgsTranslated (ArgStringList &Output, OptSpecifier Id0,
354
- const char *Translation,
355
- bool Joined = false ) const ;
359
+ LLVM_ABI void AddAllArgsTranslated (ArgStringList &Output, OptSpecifier Id0,
360
+ const char *Translation,
361
+ bool Joined = false ) const ;
356
362
357
363
// / ClaimAllArgs - Claim all arguments which match the given
358
364
// / option id.
359
- void ClaimAllArgs (OptSpecifier Id0) const ;
365
+ LLVM_ABI void ClaimAllArgs (OptSpecifier Id0) const ;
360
366
361
367
template <typename ... OptSpecifiers>
362
368
void claimAllArgs (OptSpecifiers... Ids) const {
@@ -366,7 +372,7 @@ class ArgList {
366
372
367
373
// / ClaimAllArgs - Claim all arguments.
368
374
// /
369
- void ClaimAllArgs () const ;
375
+ LLVM_ABI void ClaimAllArgs () const ;
370
376
// / @}
371
377
// / @name Arg Synthesis
372
378
// / @{
@@ -381,16 +387,16 @@ class ArgList {
381
387
382
388
// / Create an arg string for (\p LHS + \p RHS), reusing the
383
389
// / string at \p Index if possible.
384
- const char *GetOrMakeJoinedArgString (unsigned Index, StringRef LHS,
385
- StringRef RHS) const ;
390
+ LLVM_ABI const char *GetOrMakeJoinedArgString (unsigned Index, StringRef LHS,
391
+ StringRef RHS) const ;
386
392
387
- void print (raw_ostream &O) const ;
388
- void dump () const ;
393
+ LLVM_ABI void print (raw_ostream &O) const ;
394
+ LLVM_ABI void dump () const ;
389
395
390
396
// / @}
391
397
};
392
398
393
- class InputArgList final : public ArgList {
399
+ class LLVM_ABI InputArgList final : public ArgList {
394
400
private:
395
401
// / List of argument strings used by the contained Args.
396
402
// /
@@ -463,7 +469,7 @@ class InputArgList final : public ArgList {
463
469
464
470
// / DerivedArgList - An ordered collection of driver arguments,
465
471
// / whose storage may be in another argument list.
466
- class DerivedArgList final : public ArgList {
472
+ class LLVM_ABI DerivedArgList final : public ArgList {
467
473
const InputArgList &BaseArgs;
468
474
469
475
// / The list of arguments we synthesized.
0 commit comments