| Index: tools/gn/command_check.cc
 | 
| diff --git a/tools/gn/command_check.cc b/tools/gn/command_check.cc
 | 
| index 5d30a09168727b73b444d5fb5d167b3bd55d1e38..73660c9ec7be88e43f62ed63a6637854fcca9ab7 100644
 | 
| --- a/tools/gn/command_check.cc
 | 
| +++ b/tools/gn/command_check.cc
 | 
| @@ -70,15 +70,24 @@ int RunCheck(const std::vector<std::string>& args) {
 | 
|  
 | 
|    bool filtered_by_build_config = false;
 | 
|    std::vector<const Target*> targets_to_check;
 | 
| -  if (args.size() == 2) {
 | 
| -    // Compute the target to check.
 | 
| -    if (!ResolveTargetsFromCommandLinePattern(setup, args[1], false,
 | 
| -                                              &targets_to_check))
 | 
| +  if (args.size() > 1) {
 | 
| +    // Compute the targets to check.
 | 
| +    std::vector<std::string> inputs(args.begin() + 1, args.end());
 | 
| +    UniqueVector<const Target*> target_matches;
 | 
| +    UniqueVector<const Config*> config_matches;
 | 
| +    UniqueVector<const Toolchain*> toolchain_matches;
 | 
| +    UniqueVector<SourceFile> file_matches;
 | 
| +    if (!ResolveFromCommandLineInput(setup, inputs, false,
 | 
| +                                     &target_matches, &config_matches,
 | 
| +                                     &toolchain_matches, &file_matches))
 | 
|        return 1;
 | 
| -    if (targets_to_check.size() == 0) {
 | 
| +
 | 
| +    if (target_matches.size() == 0) {
 | 
|        OutputString("No matching targets.\n");
 | 
|        return 1;
 | 
|      }
 | 
| +    targets_to_check.insert(targets_to_check.begin(),
 | 
| +                            target_matches.begin(), target_matches.end());
 | 
|    } else {
 | 
|      // No argument means to check everything allowed by the filter in
 | 
|      // the build config file.
 | 
| @@ -132,17 +141,4 @@ bool CheckPublicHeaders(const BuildSettings* build_settings,
 | 
|    return header_errors.empty();
 | 
|  }
 | 
|  
 | 
| -void FilterTargetsByPatterns(const std::vector<const Target*>& input,
 | 
| -                             const std::vector<LabelPattern>& filter,
 | 
| -                             std::vector<const Target*>* output) {
 | 
| -  for (const auto& target : input) {
 | 
| -    for (const auto& pattern : filter) {
 | 
| -      if (pattern.Matches(target->label())) {
 | 
| -        output->push_back(target);
 | 
| -        break;
 | 
| -      }
 | 
| -    }
 | 
| -  }
 | 
| -}
 | 
| -
 | 
|  }  // namespace commands
 | 
| 
 |