This revision was automatically updated to reflect the committed changes. Closed by commit rL371766: [Clang][CodeGen] support alias attribute w/ gnu_inline (authored by nickdesaulniers, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D67455?vs=219790&id=219980#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67455/new/ https://reviews.llvm.org/D67455 Files: cfe/trunk/lib/AST/Decl.cpp cfe/trunk/test/CodeGen/alias.c Index: cfe/trunk/test/CodeGen/alias.c =================================================================== --- cfe/trunk/test/CodeGen/alias.c +++ cfe/trunk/test/CodeGen/alias.c @@ -99,3 +99,8 @@ // CHECKGLOBALS-NOT: @test11_foo = dso_local void test11(void) {} static void test11_foo(void) __attribute__((alias("test11"))); + +// Test that gnu_inline+alias work. +// CHECKGLOBALS: @test12_alias = alias void (), void ()* @test12 +void test12(void) {} +inline void test12_alias(void) __attribute__((gnu_inline, alias("test12"))); Index: cfe/trunk/lib/AST/Decl.cpp =================================================================== --- cfe/trunk/lib/AST/Decl.cpp +++ cfe/trunk/lib/AST/Decl.cpp @@ -3348,7 +3348,8 @@ /// an externally visible symbol, but "extern inline" will not create an /// externally visible symbol. bool FunctionDecl::isInlineDefinitionExternallyVisible() const { - assert((doesThisDeclarationHaveABody() || willHaveBody()) && + assert((doesThisDeclarationHaveABody() || willHaveBody() || + hasAttr<AliasAttr>()) && "Must be a function definition"); assert(isInlined() && "Function must be inline"); ASTContext &Context = getASTContext();
Index: cfe/trunk/test/CodeGen/alias.c =================================================================== --- cfe/trunk/test/CodeGen/alias.c +++ cfe/trunk/test/CodeGen/alias.c @@ -99,3 +99,8 @@ // CHECKGLOBALS-NOT: @test11_foo = dso_local void test11(void) {} static void test11_foo(void) __attribute__((alias("test11"))); + +// Test that gnu_inline+alias work. +// CHECKGLOBALS: @test12_alias = alias void (), void ()* @test12 +void test12(void) {} +inline void test12_alias(void) __attribute__((gnu_inline, alias("test12"))); Index: cfe/trunk/lib/AST/Decl.cpp =================================================================== --- cfe/trunk/lib/AST/Decl.cpp +++ cfe/trunk/lib/AST/Decl.cpp @@ -3348,7 +3348,8 @@ /// an externally visible symbol, but "extern inline" will not create an /// externally visible symbol. bool FunctionDecl::isInlineDefinitionExternallyVisible() const { - assert((doesThisDeclarationHaveABody() || willHaveBody()) && + assert((doesThisDeclarationHaveABody() || willHaveBody() || + hasAttr<AliasAttr>()) && "Must be a function definition"); assert(isInlined() && "Function must be inline"); ASTContext &Context = getASTContext();
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits