mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-24 06:10:12 +00:00
[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:
parent
5c23410fdf
commit
e67d23905f
@ -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 == "" {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user