1111
1212#include " llvm/ADT/ArrayRef.h"
1313#include " llvm/ADT/DenseMap.h"
14- #include " llvm/ADT/iterator_range.h"
1514#include " llvm/ADT/SmallString.h"
1615#include " llvm/ADT/SmallVector.h"
1716#include " llvm/ADT/StringRef.h"
1817#include " llvm/ADT/Twine.h"
18+ #include " llvm/ADT/iterator_range.h"
1919#include " llvm/Option/Arg.h"
2020#include " llvm/Option/OptSpecifier.h"
2121#include " llvm/Option/Option.h"
22+ #include " llvm/Support/Compiler.h"
2223#include < algorithm>
2324#include < cstddef>
2425#include < initializer_list>
@@ -139,7 +140,7 @@ class ArgList {
139140
140141 // / Get the range of indexes in which options with the specified IDs might
141142 // / 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 ;
143144
144145protected:
145146 // Make the default special members protected so they won't be used to slice
@@ -178,7 +179,7 @@ class ArgList {
178179 // / @{
179180
180181 // / append - Append \p A to the arg list.
181- void append (Arg *A);
182+ LLVM_ABI void append (Arg *A);
182183
183184 const arglist_type &getArgs () const { return Args; }
184185
@@ -227,7 +228,7 @@ class ArgList {
227228 // / @{
228229
229230 // / eraseArg - Remove any option matching \p Id.
230- void eraseArg (OptSpecifier Id);
231+ LLVM_ABI void eraseArg (OptSpecifier Id);
231232
232233 // / @}
233234 // / @name Arg Access
@@ -284,11 +285,12 @@ class ArgList {
284285 // / @{
285286
286287 // / 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 ;
288290
289291 // / getAllArgValues - Get the values of all instances of the given argument
290292 // / as strings.
291- std::vector<std::string> getAllArgValues (OptSpecifier Id) const ;
293+ LLVM_ABI std::vector<std::string> getAllArgValues (OptSpecifier Id) const ;
292294
293295 // / @}
294296 // / @name Translation Utilities
@@ -298,20 +300,21 @@ class ArgList {
298300 // / true if the option is present, false if the negation is present, and
299301 // / \p Default if neither option is given. If both the option and its
300302 // / 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 ;
303306
304307 // / hasFlag - Given an option \p Pos, an alias \p PosAlias and its negative
305308 // / form \p Neg, return true if the option or its alias is present, false if
306309 // / the negation is present, and \p Default if none of the options are
307310 // / 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 ;
310313
311314 // / Given an option Pos and its negative form Neg, render the option if Pos is
312315 // / 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 ;
315318 // / Render the option if Neg is present.
316319 void addOptOutFlag (ArgStringList &Output, OptSpecifier Pos,
317320 OptSpecifier Neg) const {
@@ -331,32 +334,35 @@ class ArgList {
331334
332335 // / AddAllArgsExcept - Render all arguments matching any of the given ids
333336 // / 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 ;
336340 // / 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 ;
338343
339344 // / 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 ;
341346
342347 // / AddAllArgValues - Render the argument values of all arguments
343348 // / 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 ;
346352
347353 // / AddAllArgsTranslated - Render all the arguments matching the
348354 // / given ids, but forced to separate args and using the provided
349355 // / name instead of the first option value.
350356 // /
351357 // / \param Joined - If true, render the argument as joined with
352358 // / 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 ;
356362
357363 // / ClaimAllArgs - Claim all arguments which match the given
358364 // / option id.
359- void ClaimAllArgs (OptSpecifier Id0) const ;
365+ LLVM_ABI void ClaimAllArgs (OptSpecifier Id0) const ;
360366
361367 template <typename ... OptSpecifiers>
362368 void claimAllArgs (OptSpecifiers... Ids) const {
@@ -366,7 +372,7 @@ class ArgList {
366372
367373 // / ClaimAllArgs - Claim all arguments.
368374 // /
369- void ClaimAllArgs () const ;
375+ LLVM_ABI void ClaimAllArgs () const ;
370376 // / @}
371377 // / @name Arg Synthesis
372378 // / @{
@@ -381,16 +387,16 @@ class ArgList {
381387
382388 // / Create an arg string for (\p LHS + \p RHS), reusing the
383389 // / 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 ;
386392
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 ;
389395
390396 // / @}
391397};
392398
393- class InputArgList final : public ArgList {
399+ class LLVM_ABI InputArgList final : public ArgList {
394400private:
395401 // / List of argument strings used by the contained Args.
396402 // /
@@ -463,7 +469,7 @@ class InputArgList final : public ArgList {
463469
464470// / DerivedArgList - An ordered collection of driver arguments,
465471// / whose storage may be in another argument list.
466- class DerivedArgList final : public ArgList {
472+ class LLVM_ABI DerivedArgList final : public ArgList {
467473 const InputArgList &BaseArgs;
468474
469475 // / The list of arguments we synthesized.
0 commit comments