r201205 - Add Multilib selection machinery
Jonathan Roelofs
jonathan at codesourcery.com
Tue Feb 18 18:10:30 PST 2014
Hi Yunzhong,
Sounds good to me, although I think we ought to still print out "Selected
multilib: .;" when the default is selected but isn't the only one found.
Jon
On 2/18/14, 1:36 PM, Gao, Yunzhong wrote:
> Hi Jonathan,
>
> I wonder whether it makes more sense to only print the selected multilib when something is actually found on the host.
> I propose the following patch.
>
> Index: include/clang/Driver/Multilib.h
> ===================================================================
> --- include/clang/Driver/Multilib.h (revision 201600)
> +++ include/clang/Driver/Multilib.h (working copy)
> @@ -82,6 +82,8 @@
> /// Check whether any of the 'against' flags contradict the 'for' flags.
> bool isValid() const;
>
> + bool empty() const { return GCCSuffix.empty() && Flags.size() == 0; }
Perhaps this would better capture what you mean by 'empty()'?
bool isDefault() const { return GCCSuffix.empty() && OSSuffix.empty() &&
IncludeSuffix.empty(); }
> +
> bool operator==(const Multilib &Other) const;
> };
>
> Index: lib/Driver/ToolChains.cpp
> ===================================================================
> --- lib/Driver/ToolChains.cpp (revision 201600)
> +++ lib/Driver/ToolChains.cpp (working copy)
> @@ -1263,12 +1263,16 @@
> I != E; ++I)
> OS << "Found candidate GCC installation: " << *I << "\n";
>
> - OS << "Selected GCC installation: " << GCCInstallPath << "\n";
> + if (!GCCInstallPath.empty())
> + OS << "Selected GCC installation: " << GCCInstallPath << "\n";
> +
> for (MultilibSet::const_iterator I = Multilibs.begin(), E = Multilibs.end();
> I != E; ++I) {
> OS << "Candidate multiilb: " << *I << "\n";
> }
> - OS << "Selected multilib: " << SelectedMultilib << "\n";
> +
> + if (!SelectedMultilib.empty())
> + OS << "Selected multilib: " << SelectedMultilib << "\n";
> }
>
> bool Generic_GCC::GCCInstallationDetector::getBiarchSibling(Multilib &M) const {
>
--
Jon Roelofs
jonathan at codesourcery.com
CodeSourcery / Mentor Embedded
More information about the cfe-commits
mailing list