Sun Studio 12: C++ User's Guide

B.2.14 #pragma rarely_called


#pragms rarely_called(funcname[, funcname])

This pragma provides a hint to the compiler that the specified functions are called infrequently. This allows the compiler to perform profile-feedback style optimizations on the call-sites of such routines without the overhead of a profile-collections phase. Since this pragma is a suggestion, the compiler may not perform any optimizations based on this pragma.

The #pragma rarely_called preprocessor directive is only permitted after the prototype for the specified functions are declares. The following is an example of #pragma rarely_called:


extern void error (char *message);
#pragma rarely_called(error)

For a more detailed explanation of how the pragma treats overloaded function names as arguments, see B.1.1 Overloaded Functions as Pragma Arguments.