[llgo]: fix compilation under current llvm

Patch rL322965 changed how intrinsics for memset and memzero
were defined. This causes a regression in LLGO making it no
longer buidable. In addition to that one pass was renamed,
so this also addresses the pass naming disparity.

I removed all split stack related bits from this patch as
as asked.

Differential Revision: https://reviews.llvm.org/D56638

llvm-svn: 351722
This commit is contained in:
Kristina Brooks 2019-01-21 04:36:43 +00:00
parent 5c23410fdf
commit e67d23905f
2 changed files with 4 additions and 8 deletions

View File

@ -117,7 +117,7 @@ func (san *sanitizerOptions) addPasses(mpm, fpm llvm.PassManager) {
case san.thread:
mpm.AddThreadSanitizerPass()
case san.memory:
mpm.AddMemorySanitizerPass()
mpm.AddMemorySanitizerLegacyPassPass()
case san.dataflow:
blacklist := san.blacklist
if blacklist == "" {

View File

@ -517,7 +517,6 @@ func newRuntimeInterface(module llvm.Module, tm *llvmTypeMap) (*runtimeInterface
llvm.PointerType(llvm.Int8Type(), 0),
llvm.Int8Type(),
tm.target.IntPtrType(),
llvm.Int32Type(),
llvm.Int1Type(),
},
false,
@ -530,8 +529,7 @@ func newRuntimeInterface(module llvm.Module, tm *llvmTypeMap) (*runtimeInterface
[]llvm.Type{
llvm.PointerType(llvm.Int8Type(), 0),
llvm.PointerType(llvm.Int8Type(), 0),
tm.target.IntPtrType(),
llvm.Int32Type(),
llvm.Int64Type(),
llvm.Int1Type(),
},
false,
@ -589,9 +587,8 @@ func (fr *frame) memsetZero(ptr llvm.Value, size llvm.Value) {
ptr = fr.builder.CreateBitCast(ptr, llvm.PointerType(llvm.Int8Type(), 0), "")
fill := llvm.ConstNull(llvm.Int8Type())
size = fr.createZExtOrTrunc(size, fr.target.IntPtrType(), "")
align := llvm.ConstInt(llvm.Int32Type(), 1, false)
isvolatile := llvm.ConstNull(llvm.Int1Type())
fr.builder.CreateCall(memset, []llvm.Value{ptr, fill, size, align, isvolatile}, "")
fr.builder.CreateCall(memset, []llvm.Value{ptr, fill, size, isvolatile}, "")
}
func (fr *frame) memcpy(dest llvm.Value, src llvm.Value, size llvm.Value) {
@ -599,9 +596,8 @@ func (fr *frame) memcpy(dest llvm.Value, src llvm.Value, size llvm.Value) {
dest = fr.builder.CreateBitCast(dest, llvm.PointerType(llvm.Int8Type(), 0), "")
src = fr.builder.CreateBitCast(src, llvm.PointerType(llvm.Int8Type(), 0), "")
size = fr.createZExtOrTrunc(size, fr.target.IntPtrType(), "")
align := llvm.ConstInt(llvm.Int32Type(), 1, false)
isvolatile := llvm.ConstNull(llvm.Int1Type())
fr.builder.CreateCall(memcpy, []llvm.Value{dest, src, size, align, isvolatile}, "")
fr.builder.CreateCall(memcpy, []llvm.Value{dest, src, size, isvolatile}, "")
}
func (fr *frame) returnAddress(level uint64) llvm.Value {