llvm.org GIT mirror llvm / de86d47
Add an 'inline hint' attribute to represent source code hints that it would be a good idea to inline a function ("inline" keyword). No functional change yet; FEs do not emit this and inliner does not use it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80063 91177308-0d34-0410-b5e6-96231b3b80d8 Dale Johannesen 11 years ago
10 changed file(s) with 18 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
10411041 function into callers whenever possible, ignoring any active inlining size
10421042 threshold for this caller.
10431043
1044
inlinehint
1045
This attribute indicates that the source code contained a hint that inlining
1046 this function is desirable (such as the "inline" keyword in C/C++). It
1047 is just a hint; it imposes no requirements on the inliner.
1048
10441049
noinline
10451050
This attribute indicates that the inliner should never inline this
10461051 function in any situation. This attribute may not be used together with
5656 const Attributes NoRedZone = 1<<22; /// disable redzone
5757 const Attributes NoImplicitFloat = 1<<23; /// disable implicit floating point
5858 /// instructions.
59 const Attributes Naked = 1<<24; ///< Naked function
59 const Attributes Naked = 1<<24; ///< Naked function
60 const Attributes InlineHint = 1<<25; ///< source said inlining was desirable
6061
6162 /// @brief Attributes that only apply to function parameters.
6263 const Attributes ParameterOnly = ByVal | Nest | StructRet | NoCapture;
6566 /// be used on return values or function parameters.
6667 const Attributes FunctionOnly = NoReturn | NoUnwind | ReadNone | ReadOnly |
6768 NoInline | AlwaysInline | OptimizeForSize | StackProtect | StackProtectReq |
68 NoRedZone | NoImplicitFloat | Naked;
69 NoRedZone | NoImplicitFloat | Naked | InlineHint;
6970
7071 /// @brief Parameter attributes that do not apply to vararg call arguments.
7172 const Attributes VarArgsIncompatible = StructRet;
108108 LLVMNoCaptureAttribute = 1<<21,
109109 LLVMNoRedZoneAttribute = 1<<22,
110110 LLVMNoImplicitFloatAttribute = 1<<23,
111 LLVMNakedAttribute = 1<<24
111 LLVMNakedAttribute = 1<<24,
112 LLVMInlineHintAttribute = 1<<25
112113 } LLVMAttribute;
113114
114115 typedef enum {
555555 KEYWORD(readnone);
556556 KEYWORD(readonly);
557557
558 KEYWORD(inlinehint);
558559 KEYWORD(noinline);
559560 KEYWORD(alwaysinline);
560561 KEYWORD(optsize);
906906 case lltok::kw_noinline: Attrs |= Attribute::NoInline; break;
907907 case lltok::kw_readnone: Attrs |= Attribute::ReadNone; break;
908908 case lltok::kw_readonly: Attrs |= Attribute::ReadOnly; break;
909 case lltok::kw_inlinehint: Attrs |= Attribute::InlineHint; break;
909910 case lltok::kw_alwaysinline: Attrs |= Attribute::AlwaysInline; break;
910911 case lltok::kw_optsize: Attrs |= Attribute::OptimizeForSize; break;
911912 case lltok::kw_ssp: Attrs |= Attribute::StackProtect; break;
8181 kw_readnone,
8282 kw_readonly,
8383
84 kw_inlinehint,
8485 kw_noinline,
8586 kw_alwaysinline,
8687 kw_optsize,
471471 HANDLE_ATTR(Nest);
472472 HANDLE_ATTR(ReadNone);
473473 HANDLE_ATTR(ReadOnly);
474 HANDLE_ATTR(InlineHint);
474475 HANDLE_ATTR(NoInline);
475476 HANDLE_ATTR(AlwaysInline);
476477 HANDLE_ATTR(OptimizeForSize);
5454 Result += "optsize ";
5555 if (Attrs & Attribute::NoInline)
5656 Result += "noinline ";
57 if (Attrs & Attribute::InlineHint)
58 Result += "inlinehint ";
5759 if (Attrs & Attribute::AlwaysInline)
5860 Result += "alwaysinline ";
5961 if (Attrs & Attribute::StackProtect)
160160 | signext
161161 | readnone
162162 | readonly
163 | inlinehint
163164 | noinline
164165 | alwaysinline
165166 | optsize
5050 syn keyword llvmKeyword x86_stdcallcc x86_fastcallcc
5151 syn keyword llvmKeyword signext zeroext inreg sret nounwind noreturn
5252 syn keyword llvmKeyword nocapture byval nest readnone readonly noalias
53 syn keyword llvmKeyword noinline alwaysinline optsize ssp sspreq
53 syn keyword llvmKeyword inlinehint noinline alwaysinline optsize ssp sspreq
5454 syn keyword llvmKeyword noredzone noimplicitfloat naked
5555 syn keyword llvmKeyword module asm align tail to
5656 syn keyword llvmKeyword addrspace section alias sideeffect c gc