summaryrefslogtreecommitdiff
path: root/lib/CodeGen/StackProtector.cpp
Commit message (Collapse)AuthorAge
...
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-25
| | | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
* Neuter stack protectors by only checking character arrays. This is what GCCBill Wendling2009-10-23
| | | | | | | does. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84916 91177308-0d34-0410-b5e6-96231b3b80d8
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert yesterday's change by removing the LLVMContext parameter to ↵Owen Anderson2009-07-15
| | | | | | AllocaInst and MallocInst. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
* This started as a small change, I swear. Unfortunately, lots of things call ↵Owen Anderson2009-07-09
| | | | | | the [I|F]CmpInst constructors. Who knew!? git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename PaddedSize to AllocSize, in the hope that thisDuncan Sands2009-05-09
| | | | | | | | will make it more obvious what it represents, and stop it being confused with the StoreSize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
* When we split a basic block, there's a default branch to the newly created BB.Bill Wendling2009-03-06
| | | | | | | Delete this default branch, because we're going to generate our own. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66234 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getABITypeSize to getTypePaddedSize, asDuncan Sands2009-01-12
| | | | | | | suggested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename stackprotector_create intrinsic to stackprotector.Bill Wendling2008-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59519 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the stackprotector_check intrinsic. Use a volatile load instead.Bill Wendling2008-11-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59504 91177308-0d34-0410-b5e6-96231b3b80d8
* - Use "moveAfter" instead of "remove/insert" of a basic block.Bill Wendling2008-11-18
| | | | | | | | | | - Use less indentation in coding. - Shorten description. - Update comments. - Move code around git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59496 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement stack protectors as function attributes: "ssp" and "sspreq".Bill Wendling2008-11-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59202 91177308-0d34-0410-b5e6-96231b3b80d8
* Small simplification. Use the iterator already present as the insertion point.Bill Wendling2008-11-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59008 91177308-0d34-0410-b5e6-96231b3b80d8
* - Make sure that we don't over-increment the iterator when going through theBill Wendling2008-11-10
| | | | | | | | basic blocks. - Minor code clean-up. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59002 91177308-0d34-0410-b5e6-96231b3b80d8
* - Modify the stack protector algorithm so that the stack slot is allocated inBill Wendling2008-11-07
| | | | | | | | | | | LLVM IR code and not in the selection DAG ISel. This is a cleaner solution. - Fix the heuristic for determining if protectors are necessary. The previous one wasn't checking the proper type size. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58824 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unneeded header file.Bill Wendling2008-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58823 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't build a vector of returns. Just modify the Function in the loop.Bill Wendling2008-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58822 91177308-0d34-0410-b5e6-96231b3b80d8
* The size limit is for individual arrays. So if any array has more than 8 bytesBill Wendling2008-11-06
| | | | | | | in it, then emit stack protectors. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58819 91177308-0d34-0410-b5e6-96231b3b80d8
* - Rename stackprotector_{prologue,epilogue} to stackprotector_{create,check}.Bill Wendling2008-11-06
| | | | | | | | - Get rid of "HasStackProtector" in MachineFrameInfo. - Modify intrinsics to tell which are doing what with memory. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58799 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust the stack protector heuristic to care about only arrays or calls toBill Wendling2008-11-06
| | | | | | | "alloca". git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58792 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the stack protector stack accesses via intrinsics:Bill Wendling2008-11-06
| | | | | | | | | | | | | - stackprotector_prologue creates a stack object and stores the guard there. - stackprotector_epilogue reads the stack guard from the stack position created by stackprotector_prologue. - The PrologEpilogInserter was changed to make sure that the stack guard is first on the stack frame. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58791 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove dead variable.Bill Wendling2008-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58741 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify the allocated size calculation.Bill Wendling2008-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58740 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix commentBill Wendling2008-11-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58739 91177308-0d34-0410-b5e6-96231b3b80d8
* Some code simplification. It now doesn't generate a prologue if the epilogueBill Wendling2008-11-05
| | | | | | | isn't going to be generated. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58734 91177308-0d34-0410-b5e6-96231b3b80d8
* Small simplification of the stack guard type.Bill Wendling2008-11-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58728 91177308-0d34-0410-b5e6-96231b3b80d8
* - Add a "getOrInsertGlobal" method to the Module class. This acts similarly toBill Wendling2008-11-04
| | | | | | | | | | | | "getOrInsertFunction" in that it either adds a new declaration of the global and returns it, or returns the current one -- optionally casting it to the correct type. - Use the new getOrInsertGlobal in the stack protector code. - Use "splitBasicBlock" in the stack protector code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58727 91177308-0d34-0410-b5e6-96231b3b80d8
* Update in response to feedback from Chris:Bill Wendling2008-11-04
| | | | | | | | | | | | | | | | | | - Use enums instead of magic numbers. - Rework algorithm to use the bytes size from the target to determine when to emit stack protectors. - Get rid of "propolice" in any comments. - Renamed an option to its expanded form. - Other miscellanenous changes. More changes will come after this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58723 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial checkin for stack protectors. Here's what it does:Bill Wendling2008-11-04
* The prologue is modified to read the __stack_chk_guard global and insert it onto the stack. * The epilogue is modified to read the stored guard from the stack and compare it to the original __stack_chk_guard value. If they differ, then the __stack_chk_fail() function is called. * The stack protector needs to be first on the stack (after the parameters) to catch any stack-smashing activities. Front-end support will follow after a round of beta testing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58673 91177308-0d34-0410-b5e6-96231b3b80d8