зеркало из https://github.com/microsoft/clang-1.git
Add bzero builtin; this should help codegen quality for code using this
function. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94320 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
c07b8c02f7
Коммит
e6dddfd907
|
@ -277,7 +277,7 @@ BUILTIN(__builtin_va_copy, "vAA", "n")
|
|||
BUILTIN(__builtin_stdarg_start, "vA.", "n")
|
||||
BUILTIN(__builtin_bcmp, "iv*v*z", "n")
|
||||
BUILTIN(__builtin_bcopy, "vv*v*z", "n")
|
||||
BUILTIN(__builtin_bzero, "vv*z", "n")
|
||||
BUILTIN(__builtin_bzero, "vv*z", "nF")
|
||||
BUILTIN(__builtin_memchr, "v*vC*iz", "nF")
|
||||
BUILTIN(__builtin_memcmp, "ivC*vC*z", "nF")
|
||||
BUILTIN(__builtin_memcpy, "v*v*vC*z", "nF")
|
||||
|
@ -527,6 +527,7 @@ LIBBUILTIN(strndup, "c*cC*z", "f", "string.h")
|
|||
// POSIX strings.h
|
||||
LIBBUILTIN(index, "c*cC*i", "f", "strings.h")
|
||||
LIBBUILTIN(rindex, "c*cC*i", "f", "strings.h")
|
||||
LIBBUILTIN(bzero, "vv*z", "f", "strings.h")
|
||||
// POSIX unistd.h
|
||||
LIBBUILTIN(_exit, "vi", "fr", "unistd.h")
|
||||
// POSIX setjmp.h
|
||||
|
|
|
@ -304,6 +304,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
|
|||
Size = Builder.CreateIntCast(Size, llvm::Type::getInt32Ty(VMContext), false, "tmp");
|
||||
return RValue::get(Builder.CreateAlloca(llvm::Type::getInt8Ty(VMContext), Size, "tmp"));
|
||||
}
|
||||
case Builtin::BIbzero:
|
||||
case Builtin::BI__builtin_bzero: {
|
||||
Value *Address = EmitScalarExpr(E->getArg(0));
|
||||
Builder.CreateCall4(CGM.getMemSetFn(), Address,
|
||||
|
|
Загрузка…
Ссылка в новой задаче