04.01.2015 Views

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

RealView Compilation Tools - ARM Information Center

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Compiler-specific Features<br />

Examples<br />

__declspec(dllimport) int i;<br />

class __declspec(dllimport) X<br />

{<br />

void f();<br />

};<br />

See also<br />

• __declspec(dllexport) on page 4-24.<br />

4.2.3 __declspec(noinline)<br />

The __declspec(noinline) attribute suppresses the inlining of a function at the call<br />

points of the function.<br />

__declspec(noinline) can also be applied to constant data, to prevent the compiler from<br />

using the value for optimization purposes, without affecting its placement in the object.<br />

This is a feature that can be used for patchable constants, that is, data that is later<br />

patched to a different value. It is an error to try to use such constants in a context where<br />

a constant value is required. For example, an array dimension.<br />

Note<br />

This __declspec attribute has the function attribute equivalent<br />

__attribute__((noinline)).<br />

Examples<br />

/* Prevent y being used for optimization */<br />

__declspec(noinline) const int y = 5;<br />

/* Suppress inlining of foo() wherever foo() is called */<br />

__declspec(noinline) int foo(void);<br />

See also<br />

• #pragma inline, #pragma no_inline on page 4-66<br />

• __attribute__((noinline)) on page 4-34.<br />

• __attribute__((noinline)) constant variable attribute on page 4-51.<br />

<strong>ARM</strong> DUI 0348C Copyright © 2007-2010 <strong>ARM</strong>. All rights reserved. 4-27<br />

ID101213<br />

Non-Confidential,

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!