]> granicus.if.org Git - clang/commitdiff
[Driver] Fix unused variables and test-writing-into-workdir after r321621
authorSam McCall <sam.mccall@gmail.com>
Tue, 2 Jan 2018 09:35:10 +0000 (09:35 +0000)
committerSam McCall <sam.mccall@gmail.com>
Tue, 2 Jan 2018 09:35:10 +0000 (09:35 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321639 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/Driver.cpp
test/Driver/config-file.c

index 4d6cc682952ff3d7d81c85143564f0ae28490330..325b233ac5ec77d2fb663f27109c2f56f439e1fc 100644 (file)
@@ -682,7 +682,7 @@ bool Driver::loadConfigFile() {
       CfgDir.append(
           CLOptions->getLastArgValue(options::OPT_config_system_dir_EQ));
       if (!CfgDir.empty()) {
-        if (std::error_code EC = llvm::sys::fs::make_absolute(CfgDir))
+        if (llvm::sys::fs::make_absolute(CfgDir).value() != 0)
           SystemConfigDir.clear();
         else
           SystemConfigDir = std::string(CfgDir.begin(), CfgDir.end());
@@ -693,7 +693,7 @@ bool Driver::loadConfigFile() {
       CfgDir.append(
           CLOptions->getLastArgValue(options::OPT_config_user_dir_EQ));
       if (!CfgDir.empty()) {
-        if (std::error_code EC = llvm::sys::fs::make_absolute(CfgDir))
+        if (llvm::sys::fs::make_absolute(CfgDir).value() != 0)
           UserConfigDir.clear();
         else
           UserConfigDir = std::string(CfgDir.begin(), CfgDir.end());
index 2d2d7a72b4461abea40979e28465b0e8feb22046..3b42f950cf4f6837ce9f0b3afeba88bcb5e20c15 100644 (file)
@@ -1,6 +1,6 @@
 //--- Config file search directories
 //
-// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 -v 2>&1 | FileCheck %s -check-prefix CHECK-DIRS
+// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-DIRS
 // CHECK-DIRS: System configuration file directory: {{.*}}/Inputs/config
 // CHECK-DIRS: User configuration file directory: {{.*}}/Inputs/config2
 
@@ -15,7 +15,7 @@
 
 //--- Config file (full path) in output of -v
 //
-// RUN: %clang --config %S/Inputs/config-1.cfg -c %s -v 2>&1 | FileCheck %s -check-prefix CHECK-V
+// RUN: %clang --config %S/Inputs/config-1.cfg -c %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-V
 // CHECK-V: Configuration file: {{.*}}Inputs{{.}}config-1.cfg
 // CHECK-V: -Werror
 // CHECK-V: -std=c99
@@ -31,7 +31,7 @@
 
 //--- Config file in output of -v
 //
-// RUN: %clang --config-system-dir=%S/Inputs --config-user-dir= --config config-1.cfg -c %s -v 2>&1 | FileCheck %s -check-prefix CHECK-V2
+// RUN: %clang --config-system-dir=%S/Inputs --config-user-dir= --config config-1.cfg -c %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-V2
 // CHECK-V2: Configuration file: {{.*}}Inputs{{.}}config-1.cfg
 // CHECK-V2: -Werror
 // CHECK-V2: -std=c99
 
 //--- Unused options in config file do not produce warnings
 //
-// RUN: %clang --config %S/Inputs/config-4.cfg -c %s -v 2>&1 | FileCheck %s -check-prefix CHECK-UNUSED
+// RUN: %clang --config %S/Inputs/config-4.cfg -c %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-UNUSED
 // CHECK-UNUSED-NOT: argument unused during compilation:
 
 
 //--- User directory is searched first.
 //
-// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 -c %s -v 2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
+// RUN: %clang --config-system-dir=%S/Inputs/config --config-user-dir=%S/Inputs/config2 --config config-4 -c %s -o /dev/null -v 2>&1 | FileCheck %s -check-prefix CHECK-PRECEDENCE
 // CHECK-PRECEDENCE: Configuration file: {{.*}}Inputs{{.}}config2{{.}}config-4.cfg
 // CHECK-PRECEDENCE: -Wall