summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Bogner <mail@justinbogner.com>2014-06-20 21:12:53 +0000
committerJustin Bogner <mail@justinbogner.com>2014-06-20 21:12:53 +0000
commit5443ad57721e9c817bfe4fa87898c2d4292aec8d (patch)
tree42c46f66a2fa94b841cfd9456075ef9a62a4abe5
parentf1c9cbc2a21ee4321374146a2d85ab57e09b2d24 (diff)
downloadbcm5719-llvm-5443ad57721e9c817bfe4fa87898c2d4292aec8d.tar.gz
bcm5719-llvm-5443ad57721e9c817bfe4fa87898c2d4292aec8d.zip
Driver: Remove some superfluous calls to Arg->claim()
Args.getLastArg() claims the Arg it returns, so calling claim on these results is unnecessary. llvm-svn: 211403
-rw-r--r--clang/lib/Driver/Tools.cpp19
1 files changed, 5 insertions, 14 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index a86f06ac9d0..d2b72a09773 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/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);
OpenPOWER on IntegriCloud