[cfe-commits] r105537 - in /cfe/trunk: include/clang/Basic/BuiltinsARM.def lib/CodeGen/CGBuiltin.cpp
Rafael Espindola
rafael.espindola at gmail.com
Mon Jun 7 10:26:50 PDT 2010
Author: rafael
Date: Mon Jun 7 12:26:50 2010
New Revision: 105537
URL: http://llvm.org/viewvc/llvm-project?rev=105537&view=rev
Log:
Implement __clear_cache on ARM.
Modified:
cfe/trunk/include/clang/Basic/BuiltinsARM.def
cfe/trunk/lib/CodeGen/CGBuiltin.cpp
Modified: cfe/trunk/include/clang/Basic/BuiltinsARM.def
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsARM.def?rev=105537&r1=105536&r2=105537&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/BuiltinsARM.def (original)
+++ cfe/trunk/include/clang/Basic/BuiltinsARM.def Mon Jun 7 12:26:50 2010
@@ -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*", "")
Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=105537&r1=105536&r2=105537&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Jun 7 12:26:50 2010
@@ -923,10 +923,15 @@
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:
More information about the cfe-commits
mailing list