]> granicus.if.org Git - clang/commitdiff
Driver: inline some small arrays
authorSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 29 Oct 2015 03:36:42 +0000 (03:36 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Thu, 29 Oct 2015 03:36:42 +0000 (03:36 +0000)
Use an initializer list to remove a couple of small static arrays.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@251599 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Tools.cpp

index e90e616bbf26408e82ffb2a0353b9002f876c62c..1b5d2ce877f23892ce824edea3b6bc83a19b4ed9 100644 (file)
@@ -9088,22 +9088,16 @@ void visualstudio::Linker::ConstructJob(Compilation &C, const JobAction &JA,
     CmdArgs.push_back(Args.MakeArgString("-debug"));
     CmdArgs.push_back(Args.MakeArgString("-incremental:no"));
     if (Args.hasArg(options::OPT__SLASH_MD, options::OPT__SLASH_MDd)) {
-      static const char *const CompilerRTComponents[] = {
-          "asan_dynamic", "asan_dynamic_runtime_thunk",
-      };
-      for (const auto &Component : CompilerRTComponents)
-        CmdArgs.push_back(TC.getCompilerRTArgString(Args, Component));
+      for (const auto &Lib : {"asan_dynamic", "asan_dynamic_runtime_thunk"})
+        CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
       // Make sure the dynamic runtime thunk is not optimized out at link time
       // to ensure proper SEH handling.
       CmdArgs.push_back(Args.MakeArgString("-include:___asan_seh_interceptor"));
     } else if (DLL) {
       CmdArgs.push_back(TC.getCompilerRTArgString(Args, "asan_dll_thunk"));
     } else {
-      static const char *const CompilerRTComponents[] = {
-          "asan", "asan_cxx",
-      };
-      for (const auto &Component : CompilerRTComponents)
-        CmdArgs.push_back(TC.getCompilerRTArgString(Args, Component));
+      for (const auto &Lib : {"asan", "asan_cxx"})
+        CmdArgs.push_back(TC.getCompilerRTArgString(Args, Lib));
     }
   }