Mercurial > hg > CbC > CbC_llvm
diff lib/CodeGen/ShadowStackGCLowering.cpp @ 147:c2174574ed3a
LLVM 10
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 14 Aug 2019 16:55:33 +0900 |
parents | 803732b1fca8 |
children |
line wrap: on
line diff
--- a/lib/CodeGen/ShadowStackGCLowering.cpp Sat Feb 17 09:57:20 2018 +0900 +++ b/lib/CodeGen/ShadowStackGCLowering.cpp Wed Aug 14 16:55:33 2019 +0900 @@ -1,9 +1,8 @@ //===- ShadowStackGCLowering.cpp - Custom lowering for shadow-stack gc ----===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -175,7 +174,7 @@ } if (!Active) return false; - + // struct FrameMap { // int32_t NumRoots; // Number of roots in stack frame. // int32_t NumMeta; // Number of metadata descriptors. May be < NumRoots. @@ -286,7 +285,7 @@ if (!F.hasGC() || F.getGC() != std::string("shadow-stack")) return false; - + LLVMContext &Context = F.getContext(); // Find calls to llvm.gcroot. @@ -313,7 +312,8 @@ AtEntry.SetInsertPoint(IP->getParent(), IP); // Initialize the map pointer and load the current head of the shadow stack. - Instruction *CurrentHead = AtEntry.CreateLoad(Head, "gc_currhead"); + Instruction *CurrentHead = + AtEntry.CreateLoad(StackEntryTy->getPointerTo(), Head, "gc_currhead"); Instruction *EntryMapPtr = CreateGEP(Context, AtEntry, ConcreteStackEntryTy, StackEntry, 0, 1, "gc_frame.map"); AtEntry.CreateStore(FrameMap, EntryMapPtr); @@ -354,7 +354,8 @@ Instruction *EntryNextPtr2 = CreateGEP(Context, *AtExit, ConcreteStackEntryTy, StackEntry, 0, 0, "gc_frame.next"); - Value *SavedHead = AtExit->CreateLoad(EntryNextPtr2, "gc_savedhead"); + Value *SavedHead = AtExit->CreateLoad(StackEntryTy->getPointerTo(), + EntryNextPtr2, "gc_savedhead"); AtExit->CreateStore(SavedHead, Head); }