diff --git a/include/clang/Basic/BuiltinsARM.def b/include/clang/Basic/BuiltinsARM.def index ea50f6ce53ced6e62c3397ef63e2065229fc2924..4a8b9ac965d4a9ea3858ec56185e26eebaa2ffdf 100644 --- a/include/clang/Basic/BuiltinsARM.def +++ b/include/clang/Basic/BuiltinsARM.def @@ -14,6 +14,9 @@ // The format of this database matches clang/Basic/Builtins.def. +// In libgcc +BUILTIN(__clear_cache, "vc*c*", "") + // FIXME: This is just a placeholder. NEON intrinsics should be listed here. BUILTIN(__builtin_thread_pointer, "v*", "") diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index ae61c046d93f9b723b78d8d9cb5e3d4c181d5e59..409829687a06b69c85aa2302730138b4ce042972 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -923,10 +923,15 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID, switch (BuiltinID) { default: return 0; - - case ARM::BI__builtin_thread_pointer: { - Value *AtomF = CGM.getIntrinsic(Intrinsic::arm_thread_pointer, 0, 0); - return Builder.CreateCall(AtomF); + case ARM::BI__clear_cache: { + const FunctionDecl *FD = E->getDirectCallee(); + Value *a = EmitScalarExpr(E->getArg(0)); + Value *b = EmitScalarExpr(E->getArg(1)); + const llvm::Type *Ty = CGM.getTypes().ConvertType(FD->getType()); + const llvm::FunctionType *FTy = cast<llvm::FunctionType>(Ty); + llvm::StringRef Name = FD->getName(); + return Builder.CreateCall2(CGM.CreateRuntimeFunction(FTy, Name), + a, b); } // FIXME: bitcast args, return. case ARM::BI__builtin_neon_vaba_v: