Lines 260-265
class Option {
Link Here
|
260 |
unsigned Position = 0; // Position of last occurrence of the option |
260 |
unsigned Position = 0; // Position of last occurrence of the option |
261 |
unsigned AdditionalVals = 0; // Greater than 0 for multi-valued option. |
261 |
unsigned AdditionalVals = 0; // Greater than 0 for multi-valued option. |
262 |
|
262 |
|
|
|
263 |
protected: |
264 |
// This is a hack to emit a symbol with STB_GNU_UNIQUE binding |
265 |
// which prevents the library from being unloaded via dlclose(). |
266 |
// This is necessary because the option is registered with the option |
267 |
// parser, and if the library is unloaded the parser is left with |
268 |
// dangling reference. Since we can't reliably remove the options |
269 |
// when unloading the library, let's at least to prevent the latter. |
270 |
static inline char preventUnload() { |
271 |
static unsigned char v; |
272 |
return ++v; |
273 |
} |
274 |
|
263 |
public: |
275 |
public: |
264 |
StringRef ArgStr; // The argument string itself (ex: "help", "o") |
276 |
StringRef ArgStr; // The argument string itself (ex: "help", "o") |
265 |
StringRef HelpStr; // The descriptive text message for -help |
277 |
StringRef HelpStr; // The descriptive text message for -help |
Lines 1337-1342
class opt : public Option,
Link Here
|
1337 |
void done() { |
1349 |
void done() { |
1338 |
addArgument(); |
1350 |
addArgument(); |
1339 |
Parser.initialize(); |
1351 |
Parser.initialize(); |
|
|
1352 |
preventUnload(); |
1340 |
} |
1353 |
} |
1341 |
|
1354 |
|
1342 |
public: |
1355 |
public: |
Lines 1514-1519
class list : public Option, public list_storage<DataType, StorageClass> {
Link Here
|
1514 |
void done() { |
1527 |
void done() { |
1515 |
addArgument(); |
1528 |
addArgument(); |
1516 |
Parser.initialize(); |
1529 |
Parser.initialize(); |
|
|
1530 |
preventUnload(); |
1517 |
} |
1531 |
} |
1518 |
|
1532 |
|
1519 |
public: |
1533 |
public: |
Lines 1657-1662
class bits : public Option, public bits_storage<DataType, Storage> {
Link Here
|
1657 |
void done() { |
1671 |
void done() { |
1658 |
addArgument(); |
1672 |
addArgument(); |
1659 |
Parser.initialize(); |
1673 |
Parser.initialize(); |
|
|
1674 |
preventUnload(); |
1660 |
} |
1675 |
} |
1661 |
|
1676 |
|
1662 |
public: |
1677 |
public: |
Lines 1717-1722
class alias : public Option {
Link Here
|
1717 |
error("cl::alias must have an cl::aliasopt(option) specified!"); |
1732 |
error("cl::alias must have an cl::aliasopt(option) specified!"); |
1718 |
Subs = AliasFor->Subs; |
1733 |
Subs = AliasFor->Subs; |
1719 |
addArgument(); |
1734 |
addArgument(); |
|
|
1735 |
preventUnload(); |
1720 |
} |
1736 |
} |
1721 |
|
1737 |
|
1722 |
public: |
1738 |
public: |
1723 |
- |
|
|