diff options
Diffstat (limited to 'llvm')
-rw-r--r-- | llvm/include/llvm/Option/Arg.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/include/llvm/Option/Arg.h b/llvm/include/llvm/Option/Arg.h index d3623a0c1e4..8c4787051cf 100644 --- a/llvm/include/llvm/Option/Arg.h +++ b/llvm/include/llvm/Option/Arg.h @@ -70,7 +70,15 @@ public: ~Arg(); const Option &getOption() const { return Opt; } + + /// Returns the used prefix and name of the option: + /// For `--foo=bar`, returns `--foo=`. + /// This is often the wrong function to call: + /// * Use `getValue()` to get `bar`. + /// * Use `getAsString()` to get a string suitable for printing an Arg in + /// a diagnostic. StringRef getSpelling() const { return Spelling; } + unsigned getIndex() const { return Index; } /// Return the base argument which generated this arg. |