summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-14 22:56:43 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-03-14 22:56:43 +0000
commit3e56dd4fc94a189505f80c09422470f81ce19ca4 (patch)
tree6b65ba5a0c3e4c5624378c230cfd2e4ef922b78e /clang/lib/Sema/Sema.cpp
parent4a89501f820d6472e680f8187e3fe30a6559f140 (diff)
downloadbcm5719-llvm-3e56dd4fc94a189505f80c09422470f81ce19ca4.tar.gz
bcm5719-llvm-3e56dd4fc94a189505f80c09422470f81ce19ca4.zip
Don't try to typo-correct 'super' in an objc method.
This created 2 issues: 1) Performance issue, since typo-correction with PCH/modules is rather expensive. 2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would be emitted, like this: 3.m:8:3: error: unknown type name 'super'; did you mean 'super1'? super.x = 0; ^~~~~ super1 t3.m:5:13: note: 'super1' declared here typedef int super1; ^ t3.m:8:8: error: expected identifier or '(' super.x = 0; ^ llvm-svn: 177126
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 0ddd0619f92..4aeb511abd6 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -90,7 +90,7 @@ Sema::Sema(Preprocessor &pp, ASTContext &ctxt, ASTConsumer &consumer,
AccessCheckingSFINAE(false), InNonInstantiationSFINAEContext(false),
NonInstantiationEntries(0), ArgumentPackSubstitutionIndex(-1),
CurrentInstantiationScope(0), TyposCorrected(0),
- AnalysisWarnings(*this)
+ AnalysisWarnings(*this), Ident_super(0)
{
TUScope = 0;
@@ -1302,3 +1302,9 @@ bool Sema::tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD,
E = ExprError();
return true;
}
+
+IdentifierInfo *Sema::getSuperIdentifier() const {
+ if (!Ident_super)
+ Ident_super = &Context.Idents.get("super");
+ return Ident_super;
+}
OpenPOWER on IntegriCloud