[llvm] r259937 - [llvm-nm] Transform a switch() statement in a pair of if(s).
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 5 14:12:13 PST 2016
On Fri, Feb 5, 2016 at 2:07 PM, Davide Italiano via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: davide
> Date: Fri Feb 5 16:07:09 2016
> New Revision: 259937
>
> URL: http://llvm.org/viewvc/llvm-project?rev=259937&view=rev
> Log:
> [llvm-nm] Transform a switch() statement in a pair of if(s).
>
> This is more uniform wrt what other tools do and makes the code
> a little bit more readable.
>
> Modified:
> llvm/trunk/tools/llvm-nm/llvm-nm.cpp
>
> Modified: llvm/trunk/tools/llvm-nm/llvm-nm.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-nm/llvm-nm.cpp?rev=259937&r1=259936&r2=259937&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-nm/llvm-nm.cpp (original)
> +++ llvm/trunk/tools/llvm-nm/llvm-nm.cpp Fri Feb 5 16:07:09 2016
> @@ -1267,15 +1267,10 @@ int main(int argc, char **argv) {
> PrintAddress = false;
> if (OutputFormat == sysv || SizeSort)
> PrintSize = true;
> -
> - switch (InputFilenames.size()) {
> - case 0:
> + if (InputFilenames.size() == 0)
>
Prefer 'empty' rather than size == 0
> InputFilenames.push_back("a.out");
> - case 1:
> - break;
> - default:
> + if (InputFilenames.size() > 1)
> MultipleFiles = true;
> - }
>
> for (unsigned i = 0; i < ArchFlags.size(); ++i) {
> if (ArchFlags[i] == "all") {
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160205/0a6604bf/attachment.html>
More information about the llvm-commits
mailing list