[clang] 2e298a6 - [Driver] Fix a shadowing warning. NFC

Ilya Biryukov via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 21 03:21:36 PST 2019


Author: Ilya Biryukov
Date: 2019-11-21T12:21:20+01:00
New Revision: 2e298a6a51065a25240d15872cb350e0761ea04d

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

LOG: [Driver] Fix a shadowing warning. NFC

Found by the following buildbot:
http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/30084

Added: 
    

Modified: 
    clang/unittests/Driver/SanitizerArgsTest.cpp

Removed: 
    


################################################################################
diff  --git a/clang/unittests/Driver/SanitizerArgsTest.cpp b/clang/unittests/Driver/SanitizerArgsTest.cpp
index 164bc68051f6..e58826c2669a 100644
--- a/clang/unittests/Driver/SanitizerArgsTest.cpp
+++ b/clang/unittests/Driver/SanitizerArgsTest.cpp
@@ -50,14 +50,14 @@ class SanitizerArgsTest : public ::testing::Test {
 protected:
   const Command &emulateSingleCompilation(std::vector<std::string> ExtraArgs,
                                           std::vector<std::string> ExtraFiles) {
-    assert(!Driver && "Running twice is not allowed");
+    assert(!DriverInstance && "Running twice is not allowed");
 
     llvm::IntrusiveRefCntPtr<DiagnosticOptions> Opts = new DiagnosticOptions;
     DiagnosticsEngine Diags(
         new DiagnosticIDs, Opts,
         new TextDiagnosticPrinter(llvm::errs(), Opts.get()));
-    Driver.emplace(ClangBinary, "x86_64-unknown-linux-gnu", Diags,
-                   prepareFS(ExtraFiles));
+    DriverInstance.emplace(ClangBinary, "x86_64-unknown-linux-gnu", Diags,
+                           prepareFS(ExtraFiles));
 
     std::vector<const char *> Args = {ClangBinary};
     for (const auto &A : ExtraArgs)
@@ -65,13 +65,13 @@ class SanitizerArgsTest : public ::testing::Test {
     Args.push_back("-c");
     Args.push_back(InputFile);
 
-    Compilation.reset(Driver->BuildCompilation(Args));
+    CompilationJob.reset(DriverInstance->BuildCompilation(Args));
 
     if (Diags.hasErrorOccurred())
       ADD_FAILURE() << "Error occurred while parsing compilation arguments. "
                        "See stderr for details.";
 
-    const auto &Commands = Compilation->getJobs().getJobs();
+    const auto &Commands = CompilationJob->getJobs().getJobs();
     assert(Commands.size() == 1);
     return *Commands.front();
   }
@@ -88,8 +88,8 @@ class SanitizerArgsTest : public ::testing::Test {
     return FS;
   }
 
-  llvm::Optional<Driver> Driver;
-  std::unique_ptr<driver::Compilation> Compilation;
+  llvm::Optional<Driver> DriverInstance;
+  std::unique_ptr<driver::Compilation> CompilationJob;
 };
 
 TEST_F(SanitizerArgsTest, Blacklists) {


        


More information about the cfe-commits mailing list