compiler.hh revision 3940:b87f85bb4275
19243SN/A/* 210889Sandreas.hansson@arm.com * Copyright (c) 2006 The Regents of The University of Michigan 39243SN/A * All rights reserved. 49243SN/A * 59243SN/A * Redistribution and use in source and binary forms, with or without 69243SN/A * modification, are permitted provided that the following conditions are 79243SN/A * met: redistributions of source code must retain the above copyright 89243SN/A * notice, this list of conditions and the following disclaimer; 99243SN/A * redistributions in binary form must reproduce the above copyright 109243SN/A * notice, this list of conditions and the following disclaimer in the 119243SN/A * documentation and/or other materials provided with the distribution; 129243SN/A * neither the name of the copyright holders nor the names of its 139243SN/A * contributors may be used to endorse or promote products derived from 149831SN/A * this software without specific prior written permission. 159831SN/A * 169831SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 179243SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 189243SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 199243SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 209243SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 219243SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 229243SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 239243SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 249243SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 259243SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 269243SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 279243SN/A * 289243SN/A * Authors: Ali Saidi 299243SN/A */ 309243SN/A 319243SN/A#ifndef __BASE_COMPILER_HH__ 329243SN/A#define __BASE_COMPILER_HH__ 339243SN/A 349243SN/A//http://msdn2.microsoft.com/en-us/library/ms937669.aspx 359243SN/A//http://msdn2.microsoft.com/en-us/library/aa448724.aspx 369243SN/A//http://docs.sun.com/source/819-3688/sun.specific.html#marker-998278 379243SN/A//http://gcc.gnu.org/onlinedocs/gcc-3.3.1/gcc/Function-Attributes.html#Function%20Attributes 389243SN/A 399243SN/A#if defined(__GNUC__) 409243SN/A#define M5_ATTR_NORETURN __attribute__((noreturn)) 419243SN/A#define M5_PRAGMA_NORETURN(x) 429967SN/A#define M5_DUMMY_RETURN 4310618SOmar.Naji@arm.com#elif defined(__SUNPRO_CC) 449243SN/A// this doesn't do anything with sun cc, but why not 459243SN/A#define M5_ATTR_NORETURN __sun_attr__((__noreturn__)) 4610146Sandreas.hansson@arm.com#define M5_DUMMY_RETURN return (0); 479356SN/A#define DO_PRAGMA(x) _Pragma(#x) 4810146Sandreas.hansson@arm.com#define M5_PRAGMA_NORETURN(x) DO_PRAGMA(does_not_return(x)) 4910247Sandreas.hansson@arm.com#else 5010208Sandreas.hansson@arm.com#error "Need to define compiler options in base/compiler.hh" 519352SN/A#endif 5210146Sandreas.hansson@arm.com 539814SN/A#endif // __BASE_COMPILER_HH__ 549243SN/A