If no one is using it, making it private is obvious goodness.  LGTM.

> On 2016-Jul-12, at 16:52, Vedant Kumar <v...@apple.com> wrote:
> 
> vsk created this revision.
> vsk added a reviewer: dexonsmith.
> vsk added a subscriber: cfe-commits.
> 
> The clang driver knows about two kinds of target triples: default and
> effective. Default triples are needed to get ToolChains. ToolChains can
> then be used to determine more specific effective triples.
> 
> Inconsistent use of two different kinds of target triples leads to
> inconsistent error reporting and wasted computation (n.b that effective
> triples are not cached).
> 
> Ideally, default triples would only be used as a means of getting
> effective triples. Make Driver::DefaultTargetTriple private in the hopes
> of discouraging further use of default triples.
> 
> http://reviews.llvm.org/D22289
> 
> Files:
>  include/clang/Driver/Driver.h
>  lib/Driver/Driver.cpp
> 
> Index: lib/Driver/Driver.cpp
> ===================================================================
> --- lib/Driver/Driver.cpp
> +++ lib/Driver/Driver.cpp
> @@ -55,12 +55,12 @@
>       Mode(GCCMode), SaveTemps(SaveTempsNone), BitcodeEmbed(EmbedNone),
>       LTOMode(LTOK_None), ClangExecutable(ClangExecutable),
>       SysRoot(DEFAULT_SYSROOT), UseStdLib(true),
> -      DefaultTargetTriple(DefaultTargetTriple),
>       DriverTitle("clang LLVM compiler"), CCPrintOptionsFilename(nullptr),
>       CCPrintHeadersFilename(nullptr), CCLogDiagnosticsFilename(nullptr),
>       CCCPrintBindings(false), CCPrintHeaders(false), CCLogDiagnostics(false),
> -      CCGenDiagnostics(false), CCCGenericGCCName(""), CheckInputsExist(true),
> -      CCCUsePCH(true), SuppressMissingInputWarning(false) {
> +      CCGenDiagnostics(false), DefaultTargetTriple(DefaultTargetTriple),
> +      CCCGenericGCCName(""), CheckInputsExist(true), CCCUsePCH(true),
> +      SuppressMissingInputWarning(false) {
> 
>   // Provide a sane fallback if no VFS is specified.
>   if (!this->VFS)
> Index: include/clang/Driver/Driver.h
> ===================================================================
> --- include/clang/Driver/Driver.h
> +++ include/clang/Driver/Driver.h
> @@ -132,9 +132,6 @@
>   /// If the standard library is used
>   bool UseStdLib;
> 
> -  /// Default target triple.
> -  std::string DefaultTargetTriple;
> -
>   /// Driver title to use with help.
>   std::string DriverTitle;
> 
> @@ -183,6 +180,9 @@
>   unsigned CCGenDiagnostics : 1;
> 
> private:
> +  /// Default target triple.
> +  std::string DefaultTargetTriple;
> +
>   /// Name to use when invoking gcc/g++.
>   std::string CCCGenericGCCName;
> 
> 
> 
> <D22289.63756.patch>

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to