[PATCH] D67455: [Clang][CodeGen] support alias attribute w/ gnu_inline
Nick Desaulniers via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 12 12:52:14 PDT 2019
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();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67455.219980.patch
Type: text/x-patch
Size: 1191 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190912/0893ecbb/attachment.bin>
More information about the cfe-commits
mailing list