[PATCH] D10805: Disabling of "redefine_extname" pragma for C++ code

Aaron Ballman aaron.ballman at gmail.com
Thu Jul 16 04:58:19 PDT 2015


On Thu, Jul 16, 2015 at 7:39 AM, Andrey Bokhanko
<andreybokhanko at gmail.com> wrote:
> andreybokhanko added a comment.
>
> Ping!
>
>
> http://reviews.llvm.org/D10805

LGTM with one minor nit:

> Index: lib/Sema/SemaDecl.cpp
> ===================================================================
> --- lib/Sema/SemaDecl.cpp
> +++ lib/Sema/SemaDecl.cpp
> @@ -5561,15 +5561,12 @@
>    return true;
>  }
>
> -/// \brief Returns true if given declaration is TU-scoped and externally
> -/// visible.
> -static bool isDeclTUScopedExternallyVisible(const Decl *D) {
> +/// \brief Returns true if given declaration has external C language linkage.
> +static bool isDeclExternC(const Decl *D) {
>    if (auto *FD = dyn_cast<FunctionDecl>(D))
> -    return (FD->getDeclContext()->isTranslationUnit() || FD->isExternC()) &&
> -           FD->hasExternalFormalLinkage();
> -  else if (auto *VD = dyn_cast<VarDecl>(D))
> -    return (VD->getDeclContext()->isTranslationUnit() || VD->isExternC()) &&
> -           VD->hasExternalFormalLinkage();
> +    return FD->isExternC();
> +  if (auto *VD = dyn_cast<VarDecl>(D))

const auto *

~Aaron



More information about the cfe-commits mailing list