]> granicus.if.org Git - clang/commitdiff
Renamed RawComment kinds to avoid name clash.
authorAbramo Bagnara <abramo.bagnara@gmail.com>
Wed, 4 Jul 2012 07:30:26 +0000 (07:30 +0000)
committerAbramo Bagnara <abramo.bagnara@gmail.com>
Wed, 4 Jul 2012 07:30:26 +0000 (07:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159706 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/OperationKinds.h
include/clang/AST/RawCommentList.h
lib/AST/RawCommentList.cpp
lib/Sema/Sema.cpp

index 258637d7f9bddd35a9aeeebadd0a6c4ae7ce696d..63594141ac6638998fd7d2a2972c818ee3d8c0dd 100644 (file)
@@ -291,7 +291,7 @@ enum CastKind {
   CK_CopyAndAutoreleaseBlockObject
 };
 
-#define CK_Invalid ((CastKind) -1)
+static const CastKind CK_Invalid = static_cast<CastKind>(-1);
 
 enum BinaryOperatorKind {
   // Operators listed in order of precedence.
index dc8bbad1d5a78d651b07c71afcba030656379d4e..299502acb6bebea8f92b9984279e2ee9c7ef9b12 100644 (file)
@@ -21,17 +21,17 @@ class ASTReader;
 class RawComment {
 public:
   enum CommentKind {
-    CK_Invalid,      ///< Invalid comment
-    CK_OrdinaryBCPL, ///< Any normal BCPL comments
-    CK_OrdinaryC,    ///< Any normal C comment
-    CK_BCPLSlash,    ///< \code /// stuff \endcode
-    CK_BCPLExcl,     ///< \code //! stuff \endcode
-    CK_JavaDoc,      ///< \code /** stuff */ \endcode
-    CK_Qt,           ///< \code /*! stuff */ \endcode, also used by HeaderDoc
-    CK_Merged        ///< Two or more documentation comments merged together
+    RCK_Invalid,      ///< Invalid comment
+    RCK_OrdinaryBCPL, ///< Any normal BCPL comments
+    RCK_OrdinaryC,    ///< Any normal C comment
+    RCK_BCPLSlash,    ///< \code /// stuff \endcode
+    RCK_BCPLExcl,     ///< \code //! stuff \endcode
+    RCK_JavaDoc,      ///< \code /** stuff */ \endcode
+    RCK_Qt,           ///< \code /*! stuff */ \endcode, also used by HeaderDoc
+    RCK_Merged        ///< Two or more documentation comments merged together
   };
 
-  RawComment() : Kind(CK_Invalid), IsAlmostTrailingComment(false) { }
+  RawComment() : Kind(RCK_Invalid), IsAlmostTrailingComment(false) { }
 
   RawComment(const SourceManager &SourceMgr, SourceRange SR,
              bool Merged = false);
@@ -41,11 +41,11 @@ public:
   }
 
   bool isInvalid() const LLVM_READONLY {
-    return Kind == CK_Invalid;
+    return Kind == RCK_Invalid;
   }
 
   bool isMerged() const LLVM_READONLY {
-    return Kind == CK_Merged;
+    return Kind == RCK_Merged;
   }
 
   /// Returns true if it is a comment that should be put after a member:
@@ -67,7 +67,7 @@ public:
 
   /// Returns true if this comment is not a documentation comment.
   bool isOrdinary() const LLVM_READONLY {
-    return (Kind == CK_OrdinaryBCPL) || (Kind == CK_OrdinaryC);
+    return (Kind == RCK_OrdinaryBCPL) || (Kind == RCK_OrdinaryC);
   }
 
   /// Returns true if this comment any kind of a documentation comment.
index e7b86dffb283bd0ab13cdac24ec1c5ad569425c3..791215103f0a0d21c5a106db964cd6ce232f8260 100644 (file)
@@ -19,19 +19,19 @@ namespace {
 /// Get comment kind and bool describing if it is a trailing comment.
 std::pair<RawComment::CommentKind, bool> getCommentKind(StringRef Comment) {
   if (Comment.size() < 3 || Comment[0] != '/')
-    return std::make_pair(RawComment::CK_Invalid, false);
+    return std::make_pair(RawComment::RCK_Invalid, false);
 
   RawComment::CommentKind K;
   if (Comment[1] == '/') {
     if (Comment.size() < 3)
-      return std::make_pair(RawComment::CK_OrdinaryBCPL, false);
+      return std::make_pair(RawComment::RCK_OrdinaryBCPL, false);
 
     if (Comment[2] == '/')
-      K = RawComment::CK_BCPLSlash;
+      K = RawComment::RCK_BCPLSlash;
     else if (Comment[2] == '!')
-      K = RawComment::CK_BCPLExcl;
+      K = RawComment::RCK_BCPLExcl;
     else
-      return std::make_pair(RawComment::CK_OrdinaryBCPL, false);
+      return std::make_pair(RawComment::RCK_OrdinaryBCPL, false);
   } else {
     assert(Comment.size() >= 4);
 
@@ -40,14 +40,14 @@ std::pair<RawComment::CommentKind, bool> getCommentKind(StringRef Comment) {
     if (Comment[1] != '*' ||
         Comment[Comment.size() - 2] != '*' ||
         Comment[Comment.size() - 1] != '/')
-      return std::make_pair(RawComment::CK_Invalid, false);
+      return std::make_pair(RawComment::RCK_Invalid, false);
 
     if (Comment[2] == '*')
-      K = RawComment::CK_JavaDoc;
+      K = RawComment::RCK_JavaDoc;
     else if (Comment[2] == '!')
-      K = RawComment::CK_Qt;
+      K = RawComment::RCK_Qt;
     else
-      return std::make_pair(RawComment::CK_OrdinaryC, false);
+      return std::make_pair(RawComment::RCK_OrdinaryC, false);
   }
   const bool TrailingComment = (Comment.size() > 3) && (Comment[3] == '<');
   return std::make_pair(K, TrailingComment);
@@ -65,7 +65,7 @@ RawComment::RawComment(const SourceManager &SourceMgr, SourceRange SR,
     BeginLineValid(false), EndLineValid(false) {
   // Extract raw comment text, if possible.
   if (SR.getBegin() == SR.getEnd() || getRawText(SourceMgr).empty()) {
-    Kind = CK_Invalid;
+    Kind = RCK_Invalid;
     return;
   }
 
@@ -78,7 +78,7 @@ RawComment::RawComment(const SourceManager &SourceMgr, SourceRange SR,
     IsAlmostTrailingComment = RawText.startswith("//<") ||
                                  RawText.startswith("/*<");
   } else {
-    Kind = CK_Merged;
+    Kind = RCK_Merged;
     IsTrailingComment = mergedCommentIsTrailingComment(RawText);
   }
 }
index 42d5fb7481099fbe84cf9905cbbb2d02fe21e7db..0569a3725c9048ec6520f3f01d5b85db5ad7b2f9 100644 (file)
@@ -1029,10 +1029,10 @@ void Sema::ActOnComment(SourceRange Comment) {
                                  Comment.getBegin().getLocWithOffset(3));
     StringRef MagicMarkerText;
     switch (RC.getKind()) {
-    case RawComment::CK_OrdinaryBCPL:
+    case RawComment::RCK_OrdinaryBCPL:
       MagicMarkerText = "///<";
       break;
-    case RawComment::CK_OrdinaryC:
+    case RawComment::RCK_OrdinaryC:
       MagicMarkerText = "/**<";
       break;
     default: