diff options
| author | Douglas Gregor <dgregor@apple.com> | 2010-01-11 23:29:10 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2010-01-11 23:29:10 +0000 |
| commit | 411e5acce101cc51bd1406f765c443a5dcf1d3a8 (patch) | |
| tree | 2cfec0b40c8966dfbe1a35fc222389d8fb4c16ff /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | 2d2c0a00adca58fa2904094771fcb17caca2cd10 (diff) | |
| download | bcm5719-llvm-411e5acce101cc51bd1406f765c443a5dcf1d3a8.tar.gz bcm5719-llvm-411e5acce101cc51bd1406f765c443a5dcf1d3a8.zip | |
Eliminate an embarrassing performance regression in C/ObjC, where we
were performing name lookup for template names in C/ObjC and always
finding nothing. Turn off such lookup unless we're in C++ mode, along
with the check that determines whether the given identifier is a
"current class name", and assert that we don't make this mistake
again.
llvm-svn: 93207
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index fd2abf88cdc..e10013e3a54 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -424,6 +424,8 @@ void Sema::CheckCXXDefaultArguments(FunctionDecl *FD) { /// the innermost class. bool Sema::isCurrentClassName(const IdentifierInfo &II, Scope *, const CXXScopeSpec *SS) { + assert(getLangOptions().CPlusPlus && "No class names in C!"); + CXXRecordDecl *CurDecl; if (SS && SS->isSet() && !SS->isInvalid()) { DeclContext *DC = computeDeclContext(*SS, true); |

