summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaelyn Takata <rikka@google.com>2014-11-20 22:06:29 +0000
committerKaelyn Takata <rikka@google.com>2014-11-20 22:06:29 +0000
commit6fc91a9d5e7d151890c7fc344e1999b8b11f34c2 (patch)
tree585ad562182b7775ffbef1274fce1e544070cd77
parent0a31302fa11726ca749548a198eb3e98fbc59549 (diff)
downloadbcm5719-llvm-6fc91a9d5e7d151890c7fc344e1999b8b11f34c2.tar.gz
bcm5719-llvm-6fc91a9d5e7d151890c7fc344e1999b8b11f34c2.zip
Add a few small helper methods to the TypoCorrectionConsumer.
llvm-svn: 222461
-rw-r--r--clang/include/clang/Sema/SemaInternal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/clang/include/clang/Sema/SemaInternal.h b/clang/include/clang/Sema/SemaInternal.h
index 321d9364fa1..045bacf2136 100644
--- a/clang/include/clang/Sema/SemaInternal.h
+++ b/clang/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 {
OpenPOWER on IntegriCloud