[llvm-commits] [llvm] r82376 - /llvm/trunk/include/llvm/Target/TargetRegistry.h
Daniel Dunbar
daniel at zuster.org
Sun Sep 20 14:31:20 PDT 2009
On Sat, Sep 19, 2009 at 11:21 PM, Chris Lattner <sabre at nondot.org> wrote:
> Author: lattner
> Date: Sun Sep 20 01:21:20 2009
> New Revision: 82376
>
> URL: http://llvm.org/viewvc/llvm-project?rev=82376&view=rev
> Log:
> add a helper method.
Isn't std::distance fine for this?
- Daniel
> Modified:
> llvm/trunk/include/llvm/Target/TargetRegistry.h
>
> Modified: llvm/trunk/include/llvm/Target/TargetRegistry.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegistry.h?rev=82376&r1=82375&r2=82376&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/Target/TargetRegistry.h (original)
> +++ llvm/trunk/include/llvm/Target/TargetRegistry.h Sun Sep 20 01:21:20 2009
> @@ -268,6 +268,13 @@
> /// @name Registry Access
> /// @{
>
> + static unsigned getNumTargets() {
> + unsigned Res = 0;
> + for (iterator I = begin(), E = end(); I != E; ++I)
> + ++Res;
> + return Res;
> + }
> +
> static iterator begin();
>
> static iterator end() { return iterator(); }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
More information about the llvm-commits
mailing list