[cfe-commits] r38637 - /cfe/cfe/trunk/include/clang/Lex/Pragma.h

sabre at cs.uiuc.edu sabre at cs.uiuc.edu
Wed Jul 11 09:23:25 PDT 2007


Author: sabre
Date: Wed Jul 11 11:23:24 2007
New Revision: 38637

URL: http://llvm.org/viewvc/llvm-project?rev=38637&view=rev
Log:
Move a PragmaNamespace method out of line, add class comment for PragmaNamespace.

Modified:
    cfe/cfe/trunk/include/clang/Lex/Pragma.h

Modified: cfe/cfe/trunk/include/clang/Lex/Pragma.h
URL: http://llvm.org/viewvc/llvm-project/cfe/cfe/trunk/include/clang/Lex/Pragma.h?rev=38637&r1=38636&r2=38637&view=diff

==============================================================================
--- cfe/cfe/trunk/include/clang/Lex/Pragma.h (original)
+++ cfe/cfe/trunk/include/clang/Lex/Pragma.h Wed Jul 11 11:23:24 2007
@@ -47,7 +47,10 @@
   virtual PragmaNamespace *getIfNamespace() { return 0; }
 };
 
-
+/// PragmaNamespace - This PragmaHandler subdivides the namespace of pragmas,
+/// allowing hierarchical pragmas to be defined.  Common examples of namespaces
+/// are "#pragma GCC", "#pragma STDC", and "#pragma omp", but any namespaces may
+/// be (potentially recursively) defined.
 class PragmaNamespace : public PragmaHandler {
   /// Handlers - This is the list of handlers in this namespace.
   ///
@@ -61,17 +64,7 @@
   /// exists, otherwise return null.  If IgnoreNull is true (the default) then
   /// the null handler isn't returned on failure to match.
   PragmaHandler *FindHandler(const IdentifierTokenInfo *Name,
-                             bool IgnoreNull = true) const {
-    PragmaHandler *NullHandler = 0;
-    for (unsigned i = 0, e = Handlers.size(); i != e; ++i) {
-      if (Handlers[i]->getName() == Name) 
-        return Handlers[i];
-      
-      if (Handlers[i]->getName() == 0)
-        NullHandler = Handlers[i];
-    }
-    return IgnoreNull ? 0 : NullHandler;
-  }
+                             bool IgnoreNull = true) const;
   
   /// AddPragma - Add a pragma to this namespace.
   ///





More information about the cfe-commits mailing list