]> granicus.if.org Git - clang/commitdiff
Make MSVC happy.
authorDaniel Dunbar <daniel@zuster.org>
Wed, 18 Nov 2009 21:42:57 +0000 (21:42 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Wed, 18 Nov 2009 21:42:57 +0000 (21:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@89247 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Driver/OptTable.cpp

index 67e3019e0f2cb14945fb5536027a44b46f677ad1..6065b2df228f19db8bce4c7a207dbd0b9fb4e421 100644 (file)
@@ -44,6 +44,8 @@ static int StrCmpOptionName(const char *A, const char *B) {
   return (a < b) ? -1 : 1;
 }
 
+namespace clang {
+namespace driver {
 static inline bool operator<(const OptTable::Info &A, const OptTable::Info &B) {
   if (&A == &B)
     return false;
@@ -58,6 +60,16 @@ static inline bool operator<(const OptTable::Info &A, const OptTable::Info &B) {
   return B.Kind == Option::JoinedClass;
 }
 
+// Support lower_bound between info and an option name.
+static inline bool operator<(const OptTable::Info &I, const char *Name) {
+  return StrCmpOptionName(I.Name, Name) == -1;
+}
+static inline bool operator<(const char *Name, const OptTable::Info &I) {
+  return StrCmpOptionName(Name, I.Name) == -1;
+}
+}
+}
+
 //
 
 OptTable::OptTable(const Info *_OptionInfos, unsigned _NumOptionInfos)
@@ -164,18 +176,6 @@ Option *OptTable::CreateOption(unsigned id) const {
   return Opt;
 }
 
-// Support lower_bound between info and an option name.
-namespace clang {
-namespace driver {
-static inline bool operator<(const OptTable::Info &I, const char *Name) {
-  return StrCmpOptionName(I.Name, Name) == -1;
-}
-static inline bool operator<(const char *Name, const OptTable::Info &I) {
-  return StrCmpOptionName(Name, I.Name) == -1;
-}
-}
-}
-
 Arg *OptTable::ParseOneArg(const InputArgList &Args, unsigned &Index) const {
   unsigned Prev = Index;
   const char *Str = Args.getArgString(Index);