[cfe-commits] r163465 - /cfe/trunk/lib/Basic/Targets.cpp

David Blaikie dblaikie at gmail.com
Sat Sep 8 09:51:56 PDT 2012


On Sat, Sep 8, 2012 at 1:22 AM, Anton Korobeynikov <asl at math.spbu.ru> wrote:
> Author: asl
> Date: Sat Sep  8 03:22:13 2012
> New Revision: 163465
>
> URL: http://llvm.org/viewvc/llvm-project?rev=163465&view=rev
> Log:
> Do not construct StringRef from NULL argument.
>
> Modified:
>     cfe/trunk/lib/Basic/Targets.cpp
>
> Modified: cfe/trunk/lib/Basic/Targets.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=163465&r1=163464&r2=163465&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Basic/Targets.cpp (original)
> +++ cfe/trunk/lib/Basic/Targets.cpp Sat Sep  8 03:22:13 2012
> @@ -3014,7 +3014,7 @@
>      return llvm::StringSwitch<const char*>(Name)
>        .Cases("cortex-a8", "cortex-a9", "A")
>        .Cases("cortex-m3", "cortex-m4", "cortex-m0", "M")
> -      .Default(0);
> +      .Default("");

How'd you come across this? Any reasonable test case?

(alternatively/in addition: should we annotate StringRef's ctor with
nonnull? (I don't suppose we bother with this in general, but given
the prevailing LLVM style of using raw zero literals (rather than the
NULL macro) for null pointers, I wonder whether it'd help catch a few
surprising cases))

>    }
>    virtual bool setCPU(const std::string &Name) {
>      if (!getCPUDefineSuffix(Name))
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits



More information about the cfe-commits mailing list