Skip to content

Commit 58ae649

Browse files
committed
Revert "[llvm] annotate interfaces in llvm/Option and llvm/Remarks for DLL export (llvm#142856)"
This reverts commit 1c8206b.
1 parent f83d09a commit 58ae649

File tree

12 files changed

+85
-103
lines changed

12 files changed

+85
-103
lines changed

llvm/include/llvm/Option/Arg.h

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "llvm/ADT/SmallVector.h"
1818
#include "llvm/ADT/StringRef.h"
1919
#include "llvm/Option/Option.h"
20-
#include "llvm/Support/Compiler.h"
2120
#include <string>
2221

2322
namespace llvm {
@@ -71,16 +70,15 @@ class Arg {
7170
std::unique_ptr<Arg> Alias;
7271

7372
public:
74-
LLVM_ABI Arg(const Option Opt, StringRef Spelling, unsigned Index,
75-
const Arg *BaseArg = nullptr);
76-
LLVM_ABI Arg(const Option Opt, StringRef Spelling, unsigned Index,
77-
const char *Value0, const Arg *BaseArg = nullptr);
78-
LLVM_ABI Arg(const Option Opt, StringRef Spelling, unsigned Index,
79-
const char *Value0, const char *Value1,
80-
const Arg *BaseArg = nullptr);
73+
Arg(const Option Opt, StringRef Spelling, unsigned Index,
74+
const Arg *BaseArg = nullptr);
75+
Arg(const Option Opt, StringRef Spelling, unsigned Index,
76+
const char *Value0, const Arg *BaseArg = nullptr);
77+
Arg(const Option Opt, StringRef Spelling, unsigned Index,
78+
const char *Value0, const char *Value1, const Arg *BaseArg = nullptr);
8179
Arg(const Arg &) = delete;
8280
Arg &operator=(const Arg &) = delete;
83-
LLVM_ABI ~Arg();
81+
~Arg();
8482

8583
const Option &getOption() const { return Opt; }
8684

@@ -136,23 +134,23 @@ class Arg {
136134
}
137135

138136
/// Append the argument onto the given array as strings.
139-
LLVM_ABI void render(const ArgList &Args, ArgStringList &Output) const;
137+
void render(const ArgList &Args, ArgStringList &Output) const;
140138

141139
/// Append the argument, render as an input, onto the given
142140
/// array as strings.
143141
///
144142
/// The distinction is that some options only render their values
145143
/// when rendered as a input (e.g., Xlinker).
146-
LLVM_ABI void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
144+
void renderAsInput(const ArgList &Args, ArgStringList &Output) const;
147145

148-
LLVM_ABI void print(raw_ostream &O) const;
149-
LLVM_ABI void dump() const;
146+
void print(raw_ostream &O) const;
147+
void dump() const;
150148

151149
/// Return a formatted version of the argument and its values, for
152150
/// diagnostics. Since this is for diagnostics, if this Arg was produced
153151
/// through an alias, this returns the string representation of the alias
154152
/// that the user wrote.
155-
LLVM_ABI std::string getAsString(const ArgList &Args) const;
153+
std::string getAsString(const ArgList &Args) const;
156154
};
157155

158156
} // end namespace opt

llvm/include/llvm/Option/ArgList.h

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@
1111

1212
#include "llvm/ADT/ArrayRef.h"
1313
#include "llvm/ADT/DenseMap.h"
14+
#include "llvm/ADT/iterator_range.h"
1415
#include "llvm/ADT/SmallString.h"
1516
#include "llvm/ADT/SmallVector.h"
1617
#include "llvm/ADT/StringRef.h"
1718
#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"
2322
#include <algorithm>
2423
#include <cstddef>
2524
#include <initializer_list>
@@ -140,7 +139,7 @@ class ArgList {
140139

141140
/// Get the range of indexes in which options with the specified IDs might
142141
/// reside, or (0, 0) if there are no such options.
143-
LLVM_ABI OptRange getRange(std::initializer_list<OptSpecifier> Ids) const;
142+
OptRange getRange(std::initializer_list<OptSpecifier> Ids) const;
144143

145144
protected:
146145
// Make the default special members protected so they won't be used to slice
@@ -179,7 +178,7 @@ class ArgList {
179178
/// @{
180179

181180
/// append - Append \p A to the arg list.
182-
LLVM_ABI void append(Arg *A);
181+
void append(Arg *A);
183182

184183
const arglist_type &getArgs() const { return Args; }
185184

@@ -228,7 +227,7 @@ class ArgList {
228227
/// @{
229228

230229
/// eraseArg - Remove any option matching \p Id.
231-
LLVM_ABI void eraseArg(OptSpecifier Id);
230+
void eraseArg(OptSpecifier Id);
232231

233232
/// @}
234233
/// @name Arg Access
@@ -285,12 +284,11 @@ class ArgList {
285284
/// @{
286285

287286
/// getLastArgValue - Return the value of the last argument, or a default.
288-
LLVM_ABI StringRef getLastArgValue(OptSpecifier Id,
289-
StringRef Default = "") const;
287+
StringRef getLastArgValue(OptSpecifier Id, StringRef Default = "") const;
290288

291289
/// getAllArgValues - Get the values of all instances of the given argument
292290
/// as strings.
293-
LLVM_ABI std::vector<std::string> getAllArgValues(OptSpecifier Id) const;
291+
std::vector<std::string> getAllArgValues(OptSpecifier Id) const;
294292

295293
/// @}
296294
/// @name Translation Utilities
@@ -300,21 +298,20 @@ class ArgList {
300298
/// true if the option is present, false if the negation is present, and
301299
/// \p Default if neither option is given. If both the option and its
302300
/// negation are present, the last one wins.
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;
301+
bool hasFlag(OptSpecifier Pos, OptSpecifier Neg, bool Default) const;
302+
bool hasFlagNoClaim(OptSpecifier Pos, OptSpecifier Neg, bool Default) const;
306303

307304
/// hasFlag - Given an option \p Pos, an alias \p PosAlias and its negative
308305
/// form \p Neg, return true if the option or its alias is present, false if
309306
/// the negation is present, and \p Default if none of the options are
310307
/// given. If multiple options are present, the last one wins.
311-
LLVM_ABI bool hasFlag(OptSpecifier Pos, OptSpecifier PosAlias,
312-
OptSpecifier Neg, bool Default) const;
308+
bool hasFlag(OptSpecifier Pos, OptSpecifier PosAlias, OptSpecifier Neg,
309+
bool Default) const;
313310

314311
/// Given an option Pos and its negative form Neg, render the option if Pos is
315312
/// present.
316-
LLVM_ABI void addOptInFlag(ArgStringList &Output, OptSpecifier Pos,
317-
OptSpecifier Neg) const;
313+
void addOptInFlag(ArgStringList &Output, OptSpecifier Pos,
314+
OptSpecifier Neg) const;
318315
/// Render the option if Neg is present.
319316
void addOptOutFlag(ArgStringList &Output, OptSpecifier Pos,
320317
OptSpecifier Neg) const {
@@ -334,35 +331,32 @@ class ArgList {
334331

335332
/// AddAllArgsExcept - Render all arguments matching any of the given ids
336333
/// and not matching any of the excluded ids.
337-
LLVM_ABI void AddAllArgsExcept(ArgStringList &Output,
338-
ArrayRef<OptSpecifier> Ids,
339-
ArrayRef<OptSpecifier> ExcludeIds) const;
334+
void AddAllArgsExcept(ArgStringList &Output, ArrayRef<OptSpecifier> Ids,
335+
ArrayRef<OptSpecifier> ExcludeIds) const;
340336
/// Render all arguments matching any of the given ids.
341-
LLVM_ABI void addAllArgs(ArgStringList &Output,
342-
ArrayRef<OptSpecifier> Ids) const;
337+
void addAllArgs(ArgStringList &Output, ArrayRef<OptSpecifier> Ids) const;
343338

344339
/// AddAllArgs - Render all arguments matching the given ids.
345-
LLVM_ABI void AddAllArgs(ArgStringList &Output, OptSpecifier Id0) const;
340+
void AddAllArgs(ArgStringList &Output, OptSpecifier Id0) const;
346341

347342
/// AddAllArgValues - Render the argument values of all arguments
348343
/// matching the given ids.
349-
LLVM_ABI void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
350-
OptSpecifier Id1 = 0U,
351-
OptSpecifier Id2 = 0U) const;
344+
void AddAllArgValues(ArgStringList &Output, OptSpecifier Id0,
345+
OptSpecifier Id1 = 0U, OptSpecifier Id2 = 0U) const;
352346

353347
/// AddAllArgsTranslated - Render all the arguments matching the
354348
/// given ids, but forced to separate args and using the provided
355349
/// name instead of the first option value.
356350
///
357351
/// \param Joined - If true, render the argument as joined with
358352
/// the option specifier.
359-
LLVM_ABI void AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0,
360-
const char *Translation,
361-
bool Joined = false) const;
353+
void AddAllArgsTranslated(ArgStringList &Output, OptSpecifier Id0,
354+
const char *Translation,
355+
bool Joined = false) const;
362356

363357
/// ClaimAllArgs - Claim all arguments which match the given
364358
/// option id.
365-
LLVM_ABI void ClaimAllArgs(OptSpecifier Id0) const;
359+
void ClaimAllArgs(OptSpecifier Id0) const;
366360

367361
template <typename... OptSpecifiers>
368362
void claimAllArgs(OptSpecifiers... Ids) const {
@@ -372,7 +366,7 @@ class ArgList {
372366

373367
/// ClaimAllArgs - Claim all arguments.
374368
///
375-
LLVM_ABI void ClaimAllArgs() const;
369+
void ClaimAllArgs() const;
376370
/// @}
377371
/// @name Arg Synthesis
378372
/// @{
@@ -387,16 +381,16 @@ class ArgList {
387381

388382
/// Create an arg string for (\p LHS + \p RHS), reusing the
389383
/// string at \p Index if possible.
390-
LLVM_ABI const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
391-
StringRef RHS) const;
384+
const char *GetOrMakeJoinedArgString(unsigned Index, StringRef LHS,
385+
StringRef RHS) const;
392386

393-
LLVM_ABI void print(raw_ostream &O) const;
394-
LLVM_ABI void dump() const;
387+
void print(raw_ostream &O) const;
388+
void dump() const;
395389

396390
/// @}
397391
};
398392

399-
class LLVM_ABI InputArgList final : public ArgList {
393+
class InputArgList final : public ArgList {
400394
private:
401395
/// List of argument strings used by the contained Args.
402396
///
@@ -469,7 +463,7 @@ class LLVM_ABI InputArgList final : public ArgList {
469463

470464
/// DerivedArgList - An ordered collection of driver arguments,
471465
/// whose storage may be in another argument list.
472-
class LLVM_ABI DerivedArgList final : public ArgList {
466+
class DerivedArgList final : public ArgList {
473467
const InputArgList &BaseArgs;
474468

475469
/// The list of arguments we synthesized.

llvm/include/llvm/Option/OptSpecifier.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class OptSpecifier {
2222
OptSpecifier() = default;
2323
explicit OptSpecifier(bool) = delete;
2424
/*implicit*/ OptSpecifier(unsigned ID) : ID(ID) {}
25-
/*implicit*/ LLVM_ABI OptSpecifier(const Option *Opt);
25+
/*implicit*/ OptSpecifier(const Option *Opt);
2626

2727
bool isValid() const { return ID != 0; }
2828

llvm/include/llvm/Option/OptTable.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include "llvm/ADT/StringRef.h"
1515
#include "llvm/ADT/StringTable.h"
1616
#include "llvm/Option/OptSpecifier.h"
17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/Support/StringSaver.h"
1918
#include <cassert>
2019
#include <string>
@@ -51,7 +50,7 @@ class Visibility {
5150
/// be needed at runtime; the OptTable class maintains enough information to
5251
/// parse command lines without instantiating Options, while letting other
5352
/// parts of the driver still use Option instances where convenient.
54-
class LLVM_ABI OptTable {
53+
class OptTable {
5554
public:
5655
/// Entry for a single option instance in the option data table.
5756
struct Info {
@@ -426,9 +425,9 @@ class LLVM_ABI OptTable {
426425
/// Specialization of OptTable
427426
class GenericOptTable : public OptTable {
428427
protected:
429-
LLVM_ABI GenericOptTable(const StringTable &StrTable,
430-
ArrayRef<StringTable::Offset> PrefixesTable,
431-
ArrayRef<Info> OptionInfos, bool IgnoreCase = false);
428+
GenericOptTable(const StringTable &StrTable,
429+
ArrayRef<StringTable::Offset> PrefixesTable,
430+
ArrayRef<Info> OptionInfos, bool IgnoreCase = false);
432431
};
433432

434433
class PrecomputedOptTable : public OptTable {

llvm/include/llvm/Option/Option.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include "llvm/ADT/StringRef.h"
1414
#include "llvm/Option/OptSpecifier.h"
1515
#include "llvm/Option/OptTable.h"
16-
#include "llvm/Support/Compiler.h"
1716
#include "llvm/Support/ErrorHandling.h"
1817
#include <cassert>
1918

@@ -82,7 +81,7 @@ class Option {
8281
const OptTable *Owner;
8382

8483
public:
85-
LLVM_ABI Option(const OptTable::Info *Info, const OptTable *Owner);
84+
Option(const OptTable::Info *Info, const OptTable *Owner);
8685

8786
bool isValid() const {
8887
return Info != nullptr;
@@ -214,7 +213,7 @@ class Option {
214213
/// Note that matches against options which are an alias should never be
215214
/// done -- aliases do not participate in matching and so such a query will
216215
/// always be false.
217-
LLVM_ABI bool matches(OptSpecifier ID) const;
216+
bool matches(OptSpecifier ID) const;
218217

219218
/// Potentially accept the current argument, returning a new Arg instance,
220219
/// or 0 if the option does not accept this argument (or the argument is
@@ -228,17 +227,16 @@ class Option {
228227
/// underlying storage to represent a Joined argument.
229228
/// \p GroupedShortOption If true, we are handling the fallback case of
230229
/// parsing a prefix of the current argument as a short option.
231-
LLVM_ABI std::unique_ptr<Arg> accept(const ArgList &Args, StringRef CurArg,
232-
bool GroupedShortOption,
233-
unsigned &Index) const;
230+
std::unique_ptr<Arg> accept(const ArgList &Args, StringRef CurArg,
231+
bool GroupedShortOption, unsigned &Index) const;
234232

235233
private:
236234
std::unique_ptr<Arg> acceptInternal(const ArgList &Args, StringRef CurArg,
237235
unsigned &Index) const;
238236

239237
public:
240-
LLVM_ABI void print(raw_ostream &O, bool AddNewLine = true) const;
241-
LLVM_ABI void dump() const;
238+
void print(raw_ostream &O, bool AddNewLine = true) const;
239+
void dump() const;
242240
};
243241

244242
} // end namespace opt

llvm/include/llvm/Remarks/Remark.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
#include "llvm/ADT/SmallVector.h"
1818
#include "llvm/ADT/StringRef.h"
1919
#include "llvm/Support/CBindingWrapping.h"
20-
#include "llvm/Support/Compiler.h"
2120
#include "llvm/Support/raw_ostream.h"
2221
#include <optional>
2322
#include <string>
@@ -36,7 +35,7 @@ struct RemarkLocation {
3635
unsigned SourceColumn = 0;
3736

3837
/// Implement operator<< on RemarkLocation.
39-
LLVM_ABI void print(raw_ostream &OS) const;
38+
void print(raw_ostream &OS) const;
4039
};
4140

4241
// Create wrappers for C Binding types (see CBindingWrapping.h).
@@ -52,11 +51,11 @@ struct Argument {
5251
std::optional<RemarkLocation> Loc;
5352

5453
/// Implement operator<< on Argument.
55-
LLVM_ABI void print(raw_ostream &OS) const;
54+
void print(raw_ostream &OS) const;
5655
/// Return the value of argument as int.
57-
LLVM_ABI std::optional<int> getValAsInt() const;
56+
std::optional<int> getValAsInt() const;
5857
/// Check if the argument value can be parsed as int.
59-
LLVM_ABI bool isValInt() const;
58+
bool isValInt() const;
6059
};
6160

6261
// Create wrappers for C Binding types (see CBindingWrapping.h).
@@ -125,13 +124,13 @@ struct Remark {
125124
Remark &operator=(Remark &&) = default;
126125

127126
/// Return a message composed from the arguments as a string.
128-
LLVM_ABI std::string getArgsAsMsg() const;
127+
std::string getArgsAsMsg() const;
129128

130129
/// Clone this remark to explicitly ask for a copy.
131130
Remark clone() const { return *this; }
132131

133132
/// Implement operator<< on Remark.
134-
LLVM_ABI void print(raw_ostream &OS) const;
133+
void print(raw_ostream &OS) const;
135134

136135
private:
137136
/// In order to avoid unwanted copies, "delete" the copy constructor.

llvm/include/llvm/Remarks/RemarkFormat.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#define LLVM_REMARKS_REMARKFORMAT_H
1515

1616
#include "llvm/ADT/StringRef.h"
17-
#include "llvm/Support/Compiler.h"
1817
#include "llvm/Support/Error.h"
1918

2019
namespace llvm {
@@ -26,10 +25,10 @@ constexpr StringLiteral Magic("REMARKS");
2625
enum class Format { Unknown, YAML, YAMLStrTab, Bitstream };
2726

2827
/// Parse and validate a string for the remark format.
29-
LLVM_ABI Expected<Format> parseFormat(StringRef FormatStr);
28+
Expected<Format> parseFormat(StringRef FormatStr);
3029

3130
/// Parse and validate a magic number to a remark format.
32-
LLVM_ABI Expected<Format> magicToFormat(StringRef Magic);
31+
Expected<Format> magicToFormat(StringRef Magic);
3332

3433
} // end namespace remarks
3534
} // end namespace llvm

0 commit comments

Comments
 (0)