forked from OSchip/llvm-project
Add support for __builtin_expect which is needed for assert,
among other things. Also change a codegen warning to dump to stderr so it doesn't mess with -emit-llvm output llvm-svn: 44497
This commit is contained in:
parent
9724ce12f9
commit
a96fe8d5c5
|
@ -97,6 +97,10 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) {
|
|||
|
||||
return RValue::get(Result);
|
||||
}
|
||||
case Builtin::BI__builtin_expect: {
|
||||
llvm::Value *Condition = EmitScalarExpr(E->getArg(0));
|
||||
return RValue::get(Condition);
|
||||
}
|
||||
}
|
||||
|
||||
return RValue::get(0);
|
||||
|
|
|
@ -38,7 +38,7 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {
|
|||
else
|
||||
EmitAggExpr(E, 0, false);
|
||||
} else {
|
||||
printf("Unimplemented stmt!\n");
|
||||
fprintf(stderr, "Unimplemented stmt!\n");
|
||||
S->dump(getContext().SourceMgr);
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -67,5 +67,6 @@ BUILTIN(__builtin_va_start, "va&.", "n")
|
|||
BUILTIN(__builtin_va_end, "va&", "n")
|
||||
BUILTIN(__builtin_va_copy, "va&a", "n")
|
||||
BUILTIN(__builtin_memcpy, "v*v*vC*z", "n")
|
||||
BUILTIN(__builtin_expect, "iii" , "nc")
|
||||
|
||||
#undef BUILTIN
|
||||
|
|
Loading…
Reference in New Issue