[cfe-commits] r158936 - in /cfe/trunk: include/clang/AST/RawCommentList.h lib/AST/ASTContext.cpp lib/AST/RawCommentList.cpp

Dmitri Gribenko gribozavr at gmail.com
Thu Jun 21 14:02:45 PDT 2012


Author: gribozavr
Date: Thu Jun 21 16:02:45 2012
New Revision: 158936

URL: http://llvm.org/viewvc/llvm-project?rev=158936&view=rev
Log:
VC9 does not like heterogenous compare function objects.

Modified:
    cfe/trunk/include/clang/AST/RawCommentList.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/RawCommentList.cpp

Modified: cfe/trunk/include/clang/AST/RawCommentList.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/RawCommentList.h?rev=158936&r1=158935&r2=158936&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/RawCommentList.h (original)
+++ cfe/trunk/include/clang/AST/RawCommentList.h Thu Jun 21 16:02:45 2012
@@ -129,9 +129,9 @@
 public:
   explicit BeforeThanCompare(const SourceManager &SM) : SM(SM) { }
 
-  bool operator()(const RawComment &LHS, const SourceRange &RHS) {
+  bool operator()(const RawComment &LHS, const RawComment &RHS) {
     return SM.isBeforeInTranslationUnit(LHS.getSourceRange().getBegin(),
-                                        RHS.getBegin());
+                                        RHS.getSourceRange().getBegin());
   }
 };
 

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=158936&r1=158935&r2=158936&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Thu Jun 21 16:02:45 2012
@@ -81,7 +81,7 @@
   ArrayRef<RawComment>::iterator Comment
       = std::lower_bound(RawComments.begin(),
                          RawComments.end(),
-                         SourceRange(DeclLoc),
+                         RawComment(SourceMgr, SourceRange(DeclLoc)),
                          BeforeThanCompare<RawComment>(SourceMgr));
 
   // Decompose the location for the declaration and find the beginning of the

Modified: cfe/trunk/lib/AST/RawCommentList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RawCommentList.cpp?rev=158936&r1=158935&r2=158936&view=diff
==============================================================================
--- cfe/trunk/lib/AST/RawCommentList.cpp (original)
+++ cfe/trunk/lib/AST/RawCommentList.cpp Thu Jun 21 16:02:45 2012
@@ -60,7 +60,7 @@
     Range(SR), RawTextValid(false), IsAlmostTrailingComment(false),
     BeginLineValid(false), EndLineValid(false) {
   // Extract raw comment text, if possible.
-  if (getRawText(SourceMgr).empty()) {
+  if (SR.getBegin() == SR.getEnd() || getRawText(SourceMgr).empty()) {
     Kind = CK_Invalid;
     return;
   }





More information about the cfe-commits mailing list