Handle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias

Grosser.

llvm-svn: 165720
This commit is contained in:
Rafael Espindola 2012-10-11 16:32:25 +00:00
parent 76831c6cd4
commit fb9d4b4c3b
2 changed files with 10 additions and 1 deletions

View File

@ -193,7 +193,7 @@ static bool useInlineVisibilityHidden(const NamedDecl *D) {
// anyway.
return TSK != TSK_ExplicitInstantiationDeclaration &&
TSK != TSK_ExplicitInstantiationDefinition &&
FD->hasBody(Def) && Def->isInlined();
FD->hasBody(Def) && Def->isInlined() && !Def->hasAttr<GNUInlineAttr>();
}
static LinkageInfo getLVForNamespaceScopeDecl(const NamedDecl *D,

View File

@ -126,3 +126,12 @@ namespace test3 {
// CHECK: define linkonce_odr hidden void @_ZN5test33fooEv
// CHECK: define linkonce_odr hidden void @_ZN5test33zedIiEEvv
}
namespace test4 {
extern inline __attribute__ ((__gnu_inline__))
void foo() {}
void bar() {
foo();
}
// CHECK: define available_externally void @_ZN5test43fooE
}