[cfe-commits] r141120 - /cfe/trunk/lib/Driver/ToolChains.cpp

Chris Lattner clattner at apple.com
Tue Oct 4 14:42:25 PDT 2011


On Oct 4, 2011, at 2:22 PM, Chandler Carruth wrote:

> +    // Loop over the various components which exist and select the best GCC
> +    // installation available. GCC installs are ranked by version number.
> +    static const GCCVersion MinVersion = { 4, 1, 1 };
> +    GCCVersion BestVersion = {};
> +    for (unsigned i = 0, ie = Prefixes.size(); i < ie; ++i) {
> +      if (!PathExists(Prefixes[i]))
> +        continue;
> +      for (unsigned j = 0, je = CandidateLibDirs.size(); j < je; ++j) {
> +        const std::string LibDir = Prefixes[i] + CandidateLibDirs[j].str();
> +        if (!PathExists(LibDir))
> +          continue;
> +        for (unsigned k = 0, ke = CandidateTriples.size(); k < ke; ++k) {

...
> linux-gnu"));
> +          for (unsigned l = 0; l < NumSuffixes; ++l) {
> +            StringRef Suffix = Suffixes[l];
> +            llvm::error_code EC;
> +            for (llvm::sys::fs::directory_iterator LI(TripleDir + Suffix, EC),
> +                     

Hi Chandler, please split some of these quintuply nested loops out to a helper function or two.  Thanks :)

-Chris



More information about the cfe-commits mailing list