[PATCH] D67455: [Clang][CodeGen] support alias attribute w/ gnu_inline

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 11 13:49:57 PDT 2019


nickdesaulniers updated this revision to Diff 219790.
nickdesaulniers added a comment.

- adjust parens


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67455/new/

https://reviews.llvm.org/D67455

Files:
  clang/lib/AST/Decl.cpp
  clang/test/CodeGen/alias.c


Index: clang/test/CodeGen/alias.c
===================================================================
--- clang/test/CodeGen/alias.c
+++ clang/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: clang/lib/AST/Decl.cpp
===================================================================
--- clang/lib/AST/Decl.cpp
+++ clang/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.219790.patch
Type: text/x-patch
Size: 1167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190911/ea691f34/attachment.bin>


More information about the cfe-commits mailing list