Skip to content
Snippets Groups Projects
Commit 52e8c4a6 authored by Akash Kothari's avatar Akash Kothari :speech_balloon:
Browse files

Update LLVM-9 Attribute table to add in and out attributes

parent d0504e01
No related branches found
No related tags found
No related merge requests found
......@@ -85,6 +85,9 @@ def NoCapture : EnumAttr<"nocapture">;
/// Call cannot be duplicated.
def NoDuplicate : EnumAttr<"noduplicate">;
/// Function does not deallocate memory.
def NoFree : EnumAttr<"nofree">;
/// Disable implicit floating point insts.
def NoImplicitFloat : EnumAttr<"noimplicitfloat">;
......@@ -106,9 +109,18 @@ def NoRedZone : EnumAttr<"noredzone">;
/// Mark the function as not returning.
def NoReturn : EnumAttr<"noreturn">;
/// Function does not synchronize.
def NoSync : EnumAttr<"nosync">;
/// Disable Indirect Branch Tracking.
def NoCfCheck : EnumAttr<"nocf_check">;
/// Function doesn't unwind stack.
def NoUnwind : EnumAttr<"nounwind">;
/// Select optimizations for best fuzzing signal.
def OptForFuzzing : EnumAttr<"optforfuzzing">;
/// opt_size.
def OptimizeForSize : EnumAttr<"optsize">;
......@@ -124,19 +136,39 @@ def ReadOnly : EnumAttr<"readonly">;
/// Return value is always equal to this argument.
def Returned : EnumAttr<"returned">;
/// Parameter is required to be a trivial constant.
def ImmArg : EnumAttr<"immarg">;
/// Function can return twice.
def ReturnsTwice : EnumAttr<"returns_twice">;
/// Safe Stack protection.
def SafeStack : EnumAttr<"safestack">;
/// Shadow Call Stack protection.
def ShadowCallStack : EnumAttr<"shadowcallstack">;
/// Sign extended before/after call.
def SExt : EnumAttr<"signext">;
/// VISC Attributes
/// Pointer to read only memory
def In : EnumAttr<"in">;
/// Pointer to write only memory
def Out : EnumAttr<"out">;
/// Pointer to read/write memory
def InOut : EnumAttr<"inout">;
/// Alignment of stack for function (3 bits) stored as log2 of alignment with
/// +1 bias 0 means unaligned (different from alignstack=(1)).
def StackAlignment : EnumAttr<"alignstack">;
/// Function can be speculated.
def Speculatable : EnumAttr<"speculatable">;
/// Stack protection.
def StackProtect : EnumAttr<"ssp">;
......@@ -146,6 +178,9 @@ def StackProtectReq : EnumAttr<"sspreq">;
/// Strong Stack protection.
def StackProtectStrong : EnumAttr<"sspstrong">;
/// Function was called in a scope requiring strict floating point semantics.
def StrictFP : EnumAttr<"strictfp">;
/// Hidden pointer to structure to return.
def StructRet : EnumAttr<"sret">;
......@@ -158,6 +193,20 @@ def SanitizeThread : EnumAttr<"sanitize_thread">;
/// MemorySanitizer is on.
def SanitizeMemory : EnumAttr<"sanitize_memory">;
/// HWAddressSanitizer is on.
def SanitizeHWAddress : EnumAttr<"sanitize_hwaddress">;
/// MemTagSanitizer is on.
def SanitizeMemTag : EnumAttr<"sanitize_memtag">;
/// Speculative Load Hardening is enabled.
///
/// Note that this uses the default compatibility (always compatible during
/// inlining) and a conservative merge strategy where inlining an attributed
/// body will add the attribute to the caller. This ensures that code carrying
/// this attribute will always be lowered with hardening enabled.
def SpeculativeLoadHardening : EnumAttr<"speculative_load_hardening">;
/// Argument is swift error.
def SwiftError : EnumAttr<"swifterror">;
......@@ -167,28 +216,22 @@ def SwiftSelf : EnumAttr<"swiftself">;
/// Function must be in a unwind table.
def UWTable : EnumAttr<"uwtable">;
/// Function always comes back to callsite.
def WillReturn : EnumAttr<"willreturn">;
/// Function only writes to memory.
def WriteOnly : EnumAttr<"writeonly">;
/// Zero extended before/after call.
def ZExt : EnumAttr<"zeroext">;
/// VISC Attributes
/// Pointer to read only memory
def In : EnumAttr<"in">;
/// Pointer to write only memory
def Out : EnumAttr<"out">;
/// Pointer to read/write memory
def InOut : EnumAttr<"inout">;
/// Target-independent string attributes.
def LessPreciseFPMAD : StrBoolAttr<"less-precise-fpmad">;
def NoInfsFPMath : StrBoolAttr<"no-infs-fp-math">;
def NoNansFPMath : StrBoolAttr<"no-nans-fp-math">;
def UnsafeFPMath : StrBoolAttr<"unsafe-fp-math">;
def NoJumpTables : StrBoolAttr<"no-jump-tables">;
def ProfileSampleAccurate : StrBoolAttr<"profile-sample-accurate">;
class CompatRule<string F> {
// The name of the function called to check the attribute of the caller and
......@@ -203,7 +246,10 @@ class CompatRule<string F> {
def : CompatRule<"isEqual<SanitizeAddressAttr>">;
def : CompatRule<"isEqual<SanitizeThreadAttr>">;
def : CompatRule<"isEqual<SanitizeMemoryAttr>">;
def : CompatRule<"isEqual<SanitizeHWAddressAttr>">;
def : CompatRule<"isEqual<SanitizeMemTagAttr>">;
def : CompatRule<"isEqual<SafeStackAttr>">;
def : CompatRule<"isEqual<ShadowCallStackAttr>">;
class MergeRule<string F> {
// The name of the function called to merge the attributes of the caller and
......@@ -220,4 +266,10 @@ def : MergeRule<"setAND<NoNansFPMathAttr>">;
def : MergeRule<"setAND<UnsafeFPMathAttr>">;
def : MergeRule<"setOR<NoImplicitFloatAttr>">;
def : MergeRule<"setOR<NoJumpTablesAttr>">;
def : MergeRule<"setOR<ProfileSampleAccurateAttr>">;
def : MergeRule<"setOR<SpeculativeLoadHardeningAttr>">;
def : MergeRule<"adjustCallerSSPLevel">;
def : MergeRule<"adjustCallerStackProbes">;
def : MergeRule<"adjustCallerStackProbeSize">;
def : MergeRule<"adjustMinLegalVectorWidth">;
def : MergeRule<"adjustNullPointerValidAttr">;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment