Make get_label_info take into account the toolchain for target_gen_dir

Previously get_label_info(<label>, "target_gen_dir") discarded toolchain information for the <label> and used the current toolchain. This makes this query useless for anything but the current toolchain. The other label info categories included this properly.

The actual bugfix is passing label.GetToolchainLabel() for the "target_gen_dir" case in function_get_label_info. This is tested by the new test in function-get_label_info_unittest.cc which was missing a test for this case.

Adding the toolchain label required adding more variants of the directory getters in filesystem_utils which were already passed the point of reason in terms of number of variants taking and returning slightly different but related things.

So this does a refactoring of the directory getter functions there to rationalize them among 4 classes of functions which can return one of two things, and a helper class that generalizes the input with whatever information the caller has. The rest of the changes are updates to the callers for this new system. There are some additional cases added to filesystem_utils_unittest.cc to test more combinations.

BUG=632412

Review-Url: https://codereview.chromium.org/2198433004
Cr-Original-Commit-Position: refs/heads/master@{#409334}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 8d6e145e3c939895491b83219583dfef48a94fac
14 files changed
tree: e541d73c2078fb1cd594023631dd7ada41fe1f86
  1. tools/