diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-05 20:15:21 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2013-05-05 20:15:21 +0000 |
commit | d8ffd0b7b61566f15a67192883a607f7703bcece (patch) | |
tree | 1589b51840a6db685aa0913ea7c019eef0f47e36 /lib/CodeGen/CodeGenModule.cpp | |
parent | 287f24d3991994b9a263af9e2a873f4feadfb8fa (diff) |
Make all 'is in extern "C"' tests use the lexical context.
I was not able to find a case (other than the fix in r181163) where this
makes a difference, but it is a more obviously correct API to have.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181165 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 6ebd1d1410..ff183c96e0 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -1731,8 +1731,8 @@ void CodeGenModule::MaybeHandleStaticInExternC(const SomeDecl *D, // Must be in an extern "C" context. Entities declared directly within // a record are not extern "C" even if the record is in such a context. - const DeclContext *DC = D->getFirstDeclaration()->getDeclContext(); - if (DC->isRecord() || !DC->isExternCContext()) + const SomeDecl *First = D->getFirstDeclaration(); + if (First->getDeclContext()->isRecord() || !First->isInExternCContext()) return; // OK, this is an internal linkage entity inside an extern "C" linkage |