12.07.2015 Views

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

RealView 编译工具编译器参考指南 - ARM Information Center

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

编 译 器 特 有 的 功 能另 请 参 阅• 第 4-27 页 的 __declspec(noreturn)4.3.11 __attribute__((notailcall))此 函 数 属 性 防 止 函 数 的 尾 调 用 。 也 就 是 说 , 即 使 可 由 普 通 跳 转 传 送 ( 因 为 调 用发 生 在 函 数 的 结 尾 ), 也 始 终 通 过 跳 转 并 链 接 的 方 式 调 用 函 数 。另 请 参 阅• 第 4-35 页 的 __attribute__((nomerge))• 第 2-109 页 的 --retain=option4.3.12 __attribute__((pure))很 多 函 数 只 影 响 返 回 值 , 并 且 返 回 值 仅 取 决 于 参 数 和 全 局 变 量 。 可 以 对 此 类 函数 进 行 数 据 流 分 析 , 并 且 可 以 将 其 删 除 。注 意此 函 数 属 性 是 <strong>ARM</strong> 编 译 器 支 持 的 GNU 编 译 器 扩 展 。虽 然 此 函 数 属 性 与 __pure 关 键 字 有 关 , 但 它 们 并 不 等 效 。 __pure 的 等 效 函 数 属性 是 __attribute__((const))。示 例int Function_Attributes_pure_0(int b) __attribute__ ((pure));int Function_Attributes_pure_0(int b){static int aStatic;aStatic++;return b++;}int Function_Attributes_pure_2(int b){int aLocal=0;aLocal += Function_Attributes_pure_0(b);return 0;}在 此 示 例 中 , 由 于 不 使 用 Function_Attributes_pure_0 调 用 的 结 果 , 因 此 可 以 删除 该 调 用 。<strong>ARM</strong> DUI 0348BC Copyright © 2007-2009 <strong>ARM</strong> Limited. All rights reserved. 4-37ID090708Non-Confidential, Unrestricted Access

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

Saved successfully!

Ooh no, something went wrong!