opal: support __attribute__((__noinline__))
First cut does not attempt any "cross-check". As we discover compilers which complain about __noinline__, we will add specific cross checks to handle those cases. Reviewed-by: Jeff Squyres <jsquyres@cisco.com> This commit was SVN r29488.
Этот коммит содержится в:
родитель
e9dbb66e58
Коммит
25dd719d4d
@ -11,7 +11,7 @@
|
||||
# Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
# All rights reserved.
|
||||
# Copyright (c) 2009 Oak Ridge National Labs. All rights reserved.
|
||||
# Copyright (c) 2010 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2010-2013 Cisco Systems, Inc. All rights reserved.
|
||||
# Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
# All rights reserved.
|
||||
# $COPYRIGHT$
|
||||
@ -207,6 +207,7 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
|
||||
opal_cv___attribute__malloc=0
|
||||
opal_cv___attribute__may_alias=0
|
||||
opal_cv___attribute__no_instrument_function=0
|
||||
opal_cv___attribute__noinline=0
|
||||
opal_cv___attribute__nonnull=0
|
||||
opal_cv___attribute__noreturn=0
|
||||
opal_cv___attribute__noreturn_funcptr=0
|
||||
@ -355,6 +356,16 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
|
||||
[])
|
||||
|
||||
|
||||
_OMPI_CHECK_SPECIFIC_ATTRIBUTE([noinline],
|
||||
[
|
||||
int foo(int arg1, int arg2) __attribute__ ((__noinline__));
|
||||
int foo(int arg1, int arg2) { return arg1 * arg2 + arg1; }
|
||||
static int bar(int arg1, int arg2) __attribute__ ((__noinline__));
|
||||
static int bar(int arg1, int arg2) { return arg1 * arg2 + arg1; }
|
||||
],
|
||||
[],
|
||||
[])
|
||||
|
||||
#
|
||||
# Attribute nonnull:
|
||||
# Ignored by intel-compiler 9.1.045 -- recognized by cross-check
|
||||
@ -571,6 +582,8 @@ AC_DEFUN([OPAL_CHECK_ATTRIBUTES], [
|
||||
[Whether your compiler has __attribute__ may_alias or not])
|
||||
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_NO_INSTRUMENT_FUNCTION, [$opal_cv___attribute__no_instrument_function],
|
||||
[Whether your compiler has __attribute__ no_instrument_function or not])
|
||||
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_NOINLINE, [$opal_cv___attribute__noinline],
|
||||
[Whether your compiler has __attribute__ noinline or not])
|
||||
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_NONNULL, [$opal_cv___attribute__nonnull],
|
||||
[Whether your compiler has __attribute__ nonnull or not])
|
||||
AC_DEFINE_UNQUOTED(OPAL_HAVE_ATTRIBUTE_NORETURN, [$opal_cv___attribute__noreturn],
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Copyright (c) 2004-2005 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
* Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009-2011 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2009-2013 Cisco Systems, Inc. All rights reserved.
|
||||
* Copyright (c) 2013 Mellanox Technologies, Inc.
|
||||
* All rights reserved.
|
||||
* $COPYRIGHT$
|
||||
@ -159,6 +159,12 @@
|
||||
# define __opal_attribute_no_instrument_function__
|
||||
#endif
|
||||
|
||||
#if OPAL_HAVE_ATTRIBUTE_NOINLINE
|
||||
# define __opal_attribute_noinline__ __attribute__((__noinline__))
|
||||
#else
|
||||
# define __opal_attribute_noinline__
|
||||
#endif
|
||||
|
||||
#if OPAL_HAVE_ATTRIBUTE_NONNULL
|
||||
# define __opal_attribute_nonnull__(a) __attribute__((__nonnull__(a)))
|
||||
# define __opal_attribute_nonnull_all__ __attribute__((__nonnull__))
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user