aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/PatchableFunction.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-08-25MachineFunctionProperties/MIRParser: Rename AllVRegsAllocated->NoVRegs, ↵Matthias Braun1-1/+1
compute it Rename AllVRegsAllocated to NoVRegs. This avoids the connotation of running after register and simply describes that no vregs are used in a machine function. With that we can simply compute the property and do not need to dump/parse it in .mir files. Differential Revision: http://reviews.llvm.org/D23850 llvm-svn: 279698
2016-08-08Revert "[X86] Support the "ms-hotpatch" attribute."Charles Davis1-14/+16
This reverts commit r278048. Something changed between the last time I built this--it takes awhile on my ridiculously slow and ancient computer--and now that broke this. llvm-svn: 278053
2016-08-08[X86] Support the "ms-hotpatch" attribute.Charles Davis1-16/+14
Summary: Based on two patches by Michael Mueller. This is a target attribute that causes a function marked with it to be emitted as "hotpatchable". This particular mechanism was originally devised by Microsoft for patching their binaries (which they are constantly updating to stay ahead of crackers, script kiddies, and other ne'er-do-wells on the Internet), but is now commonly abused by Windows programs to hook API functions. This mechanism is target-specific. For x86, a two-byte no-op instruction is emitted at the function's entry point; the entry point must be immediately preceded by 64 (32-bit) or 128 (64-bit) bytes of padding. This padding is where the patch code is written. The two byte no-op is then overwritten with a short jump into this code. The no-op is usually a `movl %edi, %edi` instruction; this is used as a magic value indicating that this is a hotpatchable function. Reviewers: majnemer, sanjoy, rnk Subscribers: dberris, llvm-commits Differential Revision: https://reviews.llvm.org/D19908 llvm-svn: 278048
2016-07-13PatchableFunction: Skip pseudos that do not create codeMatthias Braun1-5/+23
This fixes http://llvm.org/PR28524 llvm-svn: 275278
2016-06-30Delete unused includes. NFC.Rafael Espindola1-1/+0
llvm-svn: 274225
2016-04-19Add a description for the PatchableFunction pass; NFCSanjoy Das1-1/+2
llvm-svn: 266721
2016-04-19Introduce a "patchable-function" function attributeSanjoy Das1-0/+70
Summary: The `"patchable-function"` attribute can be used by an LLVM client to influence LLVM's code generation in ways that makes the generated code easily patchable at runtime (for instance, to redirect control). Right now only one patchability scheme is supported, `"prologue-short-redirect"`, but this can be expanded in the future. Reviewers: joker.eph, rnk, echristo, dberris Subscribers: joker.eph, echristo, mcrosier, llvm-commits Differential Revision: http://reviews.llvm.org/D19046 llvm-svn: 266715