From a165fa55138e10aca3826bfda3987023b02648e6 Mon Sep 17 00:00:00 2001 From: Kaelyn Takata Date: Thu, 20 Nov 2014 22:06:29 +0000 Subject: [PATCH] Add a few small helper methods to the TypoCorrectionConsumer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@222461 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/Sema/SemaInternal.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/clang/Sema/SemaInternal.h b/include/clang/Sema/SemaInternal.h index 321d9364fa..045bacf213 100644 --- a/include/clang/Sema/SemaInternal.h +++ b/include/clang/Sema/SemaInternal.h @@ -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 { -- 2.40.0