[PATCH] Make global named registers internal variables
Rafael EspĂndola
rafael.espindola at gmail.com
Tue May 20 10:11:43 PDT 2014
LGTM with a nit.
On 20 May 2014 10:00, Renato Golin <renato.golin at linaro.org> wrote:
> Hi rnk,
>
> To avoid emission of the global variable (on both IR and asm/obj), we need to mark it internal (ie. "should not emit").
>
> http://reviews.llvm.org/D3847
>
> Files:
> lib/AST/ASTContext.cpp
> test/CodeGen/named_reg_global.c
>
> Index: lib/AST/ASTContext.cpp
> ===================================================================
> --- lib/AST/ASTContext.cpp
> +++ lib/AST/ASTContext.cpp
> @@ -7874,6 +7874,9 @@
> if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {
> if (!VD->isFileVarDecl())
> return false;
> + // Global named register variables (GNU extension) are never emitted.
> + if (VD->getStorageClass() == SC_Register && !VD->isLocalVarDecl())
> + return false;
This can be just "VD->getStorageClass() == SC_Register", no?
Cheers,
Rafael
More information about the cfe-commits
mailing list