[clang] a715041 - [clang][cli] Declare local variable for marshalling macros

Jan Svoboda via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 10 04:54:28 PST 2021


Author: Jan Svoboda
Date: 2021-02-10T13:54:08+01:00
New Revision: a7150415ddd8e520a4fa024f07575527d445a689

URL: https://github.com/llvm/llvm-project/commit/a7150415ddd8e520a4fa024f07575527d445a689
DIFF: https://github.com/llvm/llvm-project/commit/a7150415ddd8e520a4fa024f07575527d445a689.diff

LOG: [clang][cli] Declare local variable for marshalling macros

Some Windows build bots report `FileSystemOpts` and `MigratorOpts` as undeclared. This fix renames the parameter and declares a local variable with the original name.

Added: 
    

Modified: 
    clang/lib/Frontend/CompilerInvocation.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 52f0e50a2da5..53f90cf4aef4 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2155,9 +2155,11 @@ static bool checkVerifyPrefixes(const std::vector<std::string> &VerifyPrefixes,
   return Success;
 }
 
-static void GenerateFileSystemArgs(const FileSystemOptions &FileSystemOpts,
+static void GenerateFileSystemArgs(const FileSystemOptions &Opts,
                                    SmallVectorImpl<const char *> &Args,
                                    CompilerInvocation::StringAllocator SA) {
+  const FileSystemOptions &FileSystemOpts = Opts;
+
 #define FILE_SYSTEM_OPTION_WITH_MARSHALLING(                                   \
     PREFIX_TYPE, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM,        \
     HELPTEXT, METAVAR, VALUES, SPELLING, SHOULD_PARSE, ALWAYS_EMIT, KEYPATH,   \
@@ -2170,8 +2172,9 @@ static void GenerateFileSystemArgs(const FileSystemOptions &FileSystemOpts,
 #undef FILE_SYSTEM_OPTION_WITH_MARSHALLING
 }
 
-static bool ParseFileSystemArgs(FileSystemOptions &FileSystemOpts,
-                                const ArgList &Args, DiagnosticsEngine &Diags) {
+static bool ParseFileSystemArgs(FileSystemOptions &Opts, const ArgList &Args,
+                                DiagnosticsEngine &Diags) {
+  FileSystemOptions &FileSystemOpts = Opts;
   bool Success = true;
 
 #define FILE_SYSTEM_OPTION_WITH_MARSHALLING(                                   \
@@ -2189,9 +2192,11 @@ static bool ParseFileSystemArgs(FileSystemOptions &FileSystemOpts,
   return Success;
 }
 
-static void GenerateMigratorArgs(const MigratorOptions &MigratorOpts,
+static void GenerateMigratorArgs(const MigratorOptions &Opts,
                                  SmallVectorImpl<const char *> &Args,
                                  CompilerInvocation::StringAllocator SA) {
+  const MigratorOptions &MigratorOpts = Opts;
+
 #define MIGRATOR_OPTION_WITH_MARSHALLING(                                      \
     PREFIX_TYPE, NAME, ID, KIND, GROUP, ALIAS, ALIASARGS, FLAGS, PARAM,        \
     HELPTEXT, METAVAR, VALUES, SPELLING, SHOULD_PARSE, ALWAYS_EMIT, KEYPATH,   \
@@ -2204,8 +2209,9 @@ static void GenerateMigratorArgs(const MigratorOptions &MigratorOpts,
 #undef MIGRATOR_OPTION_WITH_MARSHALLING
 }
 
-static bool ParseMigratorArgs(MigratorOptions &MigratorOpts,
-                              const ArgList &Args, DiagnosticsEngine &Diags) {
+static bool ParseMigratorArgs(MigratorOptions &Opts, const ArgList &Args,
+                              DiagnosticsEngine &Diags) {
+  MigratorOptions &MigratorOpts = Opts;
   bool Success = true;
 
 #define MIGRATOR_OPTION_WITH_MARSHALLING(                                      \


        


More information about the cfe-commits mailing list