From e76e010ff719d9e32dff9dcc6361a62b9f09d55f Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 20 Jun 2014 21:12:53 +0000 Subject: [PATCH] Driver: Remove some superfluous calls to Arg->claim() Args.getLastArg() claims the Arg it returns, so calling claim on these results is unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@211403 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Driver/Tools.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp index a86f06ac9d..d2b72a0977 100644 --- a/lib/Driver/Tools.cpp +++ b/lib/Driver/Tools.cpp @@ -3570,25 +3570,19 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, // -fmodule-name specifies the module that is currently being built (or // used for header checking by -fmodule-maps). - if (Arg *A = Args.getLastArg(options::OPT_fmodule_name)) { - A->claim(); + if (Arg *A = Args.getLastArg(options::OPT_fmodule_name)) A->render(Args, CmdArgs); - } // -fmodule-map-file can be used to specify a file containing module // definitions. - if (Arg *A = Args.getLastArg(options::OPT_fmodule_map_file)) { - A->claim(); + if (Arg *A = Args.getLastArg(options::OPT_fmodule_map_file)) A->render(Args, CmdArgs); - } // If a module path was provided, pass it along. Otherwise, use a temporary // directory. if (Arg *A = Args.getLastArg(options::OPT_fmodules_cache_path)) { - A->claim(); - if (HaveModules) { + if (HaveModules) A->render(Args, CmdArgs); - } } else if (HaveModules) { SmallString<128> DefaultModuleCache; llvm::sys::path::system_temp_directory(/*erasedOnReboot=*/false, @@ -3601,12 +3595,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(Args.MakeArgString(DefaultModuleCache)); } - if (Arg *A = Args.getLastArg(options::OPT_fmodules_user_build_path)) { - A->claim(); - if (HaveModules) { + if (Arg *A = Args.getLastArg(options::OPT_fmodules_user_build_path)) + if (HaveModules) A->render(Args, CmdArgs); - } - } // Pass through all -fmodules-ignore-macro arguments. Args.AddAllArgs(CmdArgs, options::OPT_fmodules_ignore_macro); -- 2.40.0