aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/decl2.c
diff options
context:
space:
mode:
authorDave Korn <dave.korn.cygwin@gmail.com>2011-01-26 01:41:23 +0000
committerDave Korn <davek@gcc.gnu.org>2011-01-26 01:41:23 +0000
commit47ea1edfbce523efbccac2377388798ec7800460 (patch)
tree7791b2c5afa7301952887cfb93c353a67dacb1ce /gcc/cp/decl2.c
parent744f0946bcbf7be92a725383d41c31673849efa9 (diff)
downloadgcc-47ea1edfbce523efbccac2377388798ec7800460.zip
gcc-47ea1edfbce523efbccac2377388798ec7800460.tar.gz
gcc-47ea1edfbce523efbccac2377388798ec7800460.tar.bz2
c.opt (-fkeep-inline-dllexport): New switch.
gcc/c-family/ChangeLog: * c.opt (-fkeep-inline-dllexport): New switch. gcc/ChangeLog: * tree.c (handle_dll_attribute): Handle it. * doc/extend.texi (@item dllexport): Mention it. * doc/invoke.texi (@item -fno-keep-inline-dllexport): Document it. gcc/cp/ChangeLog: * semantics.c (expand_or_defer_fn_1): Handle it. * decl2.c (decl_needed_p): Likewise. gcc/testsuite/ChangeLog: * gcc.dg/dll-9a.c: New test file. * gcc.dg/dll-11.c: Likewise. * gcc.dg/dll-12.c: Likewise. * gcc.dg/dll-12a.c: Likewise. * gcc.dg/dll-11a.c: Likewise. * gcc.dg/dll-9.c: Likewise. * gcc.dg/dll-10.c: Likewise. * gcc.dg/dll-10a.c: Likewise. * g++.dg/ext/dllexport4a.cc: Likewise. * g++.dg/ext/dllexport4.C: Likewise. * g++.dg/ext/dllexport5.C: Likewise. * g++.dg/ext/dllexport5a.cc: Likewise. From-SVN: r169268
Diffstat (limited to 'gcc/cp/decl2.c')
-rw-r--r--gcc/cp/decl2.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 2885528..a4b7dfa 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1,7 +1,7 @@
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
- Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010,
+ 2011 Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
This file is part of GCC.
@@ -1781,7 +1781,8 @@ decl_needed_p (tree decl)
return true;
/* Functions marked "dllexport" must be emitted so that they are
visible to other DLLs. */
- if (lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
+ if (flag_keep_inline_dllexport
+ && lookup_attribute ("dllexport", DECL_ATTRIBUTES (decl)))
return true;
/* Otherwise, DECL does not need to be emitted -- yet. A subsequent
reference to DECL might cause it to be emitted later. */