add a helper method.

llvm-svn: 82376
This commit is contained in:
Chris Lattner 2009-09-20 06:21:20 +00:00
parent 131dca9c48
commit 5c63f7b6b8
1 changed files with 7 additions and 0 deletions

View File

@ -268,6 +268,13 @@ namespace llvm {
/// @name Registry Access /// @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 begin();
static iterator end() { return iterator(); } static iterator end() { return iterator(); }