r222461 - Add a few small helper methods to the TypoCorrectionConsumer.

Kaelyn Takata rikka at google.com
Thu Nov 20 14:06:29 PST 2014


Author: rikka
Date: Thu Nov 20 16:06:29 2014
New Revision: 222461

URL: http://llvm.org/viewvc/llvm-project?rev=222461&view=rev
Log:
Add a few small helper methods to the TypoCorrectionConsumer.

Modified:
    cfe/trunk/include/clang/Sema/SemaInternal.h

Modified: cfe/trunk/include/clang/Sema/SemaInternal.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Sema/SemaInternal.h?rev=222461&r1=222460&r2=222461&view=diff
==============================================================================
--- cfe/trunk/include/clang/Sema/SemaInternal.h (original)
+++ cfe/trunk/include/clang/Sema/SemaInternal.h Thu Nov 20 16:06:29 2014
@@ -162,6 +162,17 @@ public:
                : ValidatedCorrections[0];  // The empty correction.
   }
 
+  /// \brief Return the next typo correction like getNextCorrection, but keep
+  /// the internal state pointed to the current correction (i.e. the next time
+  /// getNextCorrection is called, it will return the same correction returned
+  /// by peekNextcorrection).
+  const TypoCorrection &peekNextCorrection() {
+    auto Current = CurrentTCIndex;
+    const TypoCorrection &TC = getNextCorrection();
+    CurrentTCIndex = Current;
+    return TC;
+  }
+
   /// \brief Reset the consumer's position in the stream of viable corrections
   /// (i.e. getNextCorrection() will return each of the previously returned
   /// corrections in order before returning any new corrections).
@@ -179,6 +190,10 @@ public:
   ASTContext &getContext() const { return SemaRef.Context; }
   const LookupResult &getLookupResult() const { return Result; }
 
+  bool isAddressOfOperand() const { return CorrectionValidator->IsAddressOfOperand; }
+  const CXXScopeSpec *getSS() const { return SS.get(); }
+  Scope *getScope() const { return S; }
+
 private:
   class NamespaceSpecifierSet {
     struct SpecifierInfo {





More information about the cfe-commits mailing list