diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Driver/ArgList.h | 10 | ||||
-rw-r--r-- | include/clang/Frontend/CompilerInvocation.h | 11 |
2 files changed, 20 insertions, 1 deletions
diff --git a/include/clang/Driver/ArgList.h b/include/clang/Driver/ArgList.h index f9698048b2..3affb009fc 100644 --- a/include/clang/Driver/ArgList.h +++ b/include/clang/Driver/ArgList.h @@ -205,9 +205,17 @@ namespace driver { StringRef Default = "") const; /// getLastArgValue - Return the value of the last argument as an integer, + /// or a default. If Diags is non-null, emits an error if the argument + /// is given, but non-integral. + int getLastArgIntValue(OptSpecifier Id, int Default, + DiagnosticsEngine *Diags = 0) const; + + /// getLastArgValue - Return the value of the last argument as an integer, /// or a default. Emits an error if the argument is given, but non-integral. int getLastArgIntValue(OptSpecifier Id, int Default, - DiagnosticsEngine &Diags) const; + DiagnosticsEngine &Diags) const { + return getLastArgIntValue(Id, Default, &Diags); + } /// getAllArgValues - Get the values of all instances of the given argument /// as strings. diff --git a/include/clang/Frontend/CompilerInvocation.h b/include/clang/Frontend/CompilerInvocation.h index 0099aae8dc..0d2260acbc 100644 --- a/include/clang/Frontend/CompilerInvocation.h +++ b/include/clang/Frontend/CompilerInvocation.h @@ -33,6 +33,17 @@ namespace clang { class CompilerInvocation; class DiagnosticsEngine; + +namespace driver { +class ArgList; +} + +/// CompilerInvocation - Fill out Opts based on the options given in Args. +/// Args must have been created from the OptTable returned by +/// createCC1OptTable(). When errors are encountered, return false and, +/// if Diags is non-null, report the error(s). +bool ParseDiagnosticArgs(DiagnosticOptions &Opts, driver::ArgList &Args, + DiagnosticsEngine *Diags = 0); class CompilerInvocationBase : public RefCountedBase<CompilerInvocation> { protected: |