mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00:00
Whitespace cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161788 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
786556c268
commit
6d86f3cdfc
@ -47,7 +47,7 @@ namespace {
|
|||||||
Function *F;
|
Function *F;
|
||||||
Module *M;
|
Module *M;
|
||||||
|
|
||||||
DominatorTree* DT;
|
DominatorTree *DT;
|
||||||
|
|
||||||
/// InsertStackProtectors - Insert code into the prologue and epilogue of
|
/// InsertStackProtectors - Insert code into the prologue and epilogue of
|
||||||
/// the function.
|
/// the function.
|
||||||
@ -71,8 +71,8 @@ namespace {
|
|||||||
}
|
}
|
||||||
StackProtector(const TargetLowering *tli)
|
StackProtector(const TargetLowering *tli)
|
||||||
: FunctionPass(ID), TLI(tli) {
|
: FunctionPass(ID), TLI(tli) {
|
||||||
initializeStackProtectorPass(*PassRegistry::getPassRegistry());
|
initializeStackProtectorPass(*PassRegistry::getPassRegistry());
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
|
||||||
AU.addPreserved<DominatorTree>();
|
AU.addPreserved<DominatorTree>();
|
||||||
@ -96,7 +96,7 @@ bool StackProtector::runOnFunction(Function &Fn) {
|
|||||||
DT = getAnalysisIfAvailable<DominatorTree>();
|
DT = getAnalysisIfAvailable<DominatorTree>();
|
||||||
|
|
||||||
if (!RequiresStackProtector()) return false;
|
if (!RequiresStackProtector()) return false;
|
||||||
|
|
||||||
return InsertStackProtectors();
|
return InsertStackProtectors();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -168,17 +168,17 @@ bool StackProtector::InsertStackProtectors() {
|
|||||||
// StackGuardSlot = alloca i8*
|
// StackGuardSlot = alloca i8*
|
||||||
// StackGuard = load __stack_chk_guard
|
// StackGuard = load __stack_chk_guard
|
||||||
// call void @llvm.stackprotect.create(StackGuard, StackGuardSlot)
|
// call void @llvm.stackprotect.create(StackGuard, StackGuardSlot)
|
||||||
//
|
//
|
||||||
PointerType *PtrTy = Type::getInt8PtrTy(RI->getContext());
|
PointerType *PtrTy = Type::getInt8PtrTy(RI->getContext());
|
||||||
unsigned AddressSpace, Offset;
|
unsigned AddressSpace, Offset;
|
||||||
if (TLI->getStackCookieLocation(AddressSpace, Offset)) {
|
if (TLI->getStackCookieLocation(AddressSpace, Offset)) {
|
||||||
Constant *OffsetVal =
|
Constant *OffsetVal =
|
||||||
ConstantInt::get(Type::getInt32Ty(RI->getContext()), Offset);
|
ConstantInt::get(Type::getInt32Ty(RI->getContext()), Offset);
|
||||||
|
|
||||||
StackGuardVar = ConstantExpr::getIntToPtr(OffsetVal,
|
StackGuardVar = ConstantExpr::getIntToPtr(OffsetVal,
|
||||||
PointerType::get(PtrTy, AddressSpace));
|
PointerType::get(PtrTy, AddressSpace));
|
||||||
} else {
|
} else {
|
||||||
StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy);
|
StackGuardVar = M->getOrInsertGlobal("__stack_chk_guard", PtrTy);
|
||||||
}
|
}
|
||||||
|
|
||||||
BasicBlock &Entry = F->getEntryBlock();
|
BasicBlock &Entry = F->getEntryBlock();
|
||||||
|
Loading…
Reference in New Issue
Block a user