From d8ffd0b7b61566f15a67192883a607f7703bcece Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Sun, 5 May 2013 20:15:21 +0000 Subject: 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 --- lib/CodeGen/CodeGenModule.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CodeGenModule.cpp') 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 -- cgit v1.2.3-18-g5258