[cfe-commits] r156298 - /cfe/trunk/include/clang/AST/ExprCXX.h

Abramo Bagnara abramo.bagnara at gmail.com
Mon May 7 02:06:17 PDT 2012


Author: abramo
Date: Mon May  7 04:06:16 2012
New Revision: 156298

URL: http://llvm.org/viewvc/llvm-project?rev=156298&view=rev
Log:
Fixed UserDefinedLiteral source locations.

Modified:
    cfe/trunk/include/clang/AST/ExprCXX.h

Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=156298&r1=156297&r2=156298&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Mon May  7 04:06:16 2012
@@ -375,10 +375,21 @@
     return const_cast<UserDefinedLiteral*>(this)->getCookedLiteral();
   }
 
+  SourceLocation getLocStart() const {
+    if (getLiteralOperatorKind() == LOK_Template)
+      return getRParenLoc();
+    return getArg(0)->getLocStart();
+  }
+  SourceLocation getLocEnd() const { return getRParenLoc(); }
+  SourceRange getSourceRange() const {
+    return SourceRange(getLocStart(), getLocEnd());
+  }
+
+
   /// getUDSuffixLoc - Returns the location of a ud-suffix in the expression.
   /// For a string literal, there may be multiple identical suffixes. This
   /// returns the first.
-  SourceLocation getUDSuffixLoc() const { return getRParenLoc(); }
+  SourceLocation getUDSuffixLoc() const { return UDSuffixLoc; }
 
   /// getUDSuffix - Returns the ud-suffix specified for this literal.
   const IdentifierInfo *getUDSuffix() const;





More information about the cfe-commits mailing list