Changeset View
Changeset View
Standalone View
Standalone View
cfe/trunk/lib/Sema/SemaExpr.cpp
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 5,047 Lines • ▼ Show 20 Lines | |||||
Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, | Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, | ||||
SourceLocation LParenLoc, | SourceLocation LParenLoc, | ||||
ArrayRef<Expr *> Args, | ArrayRef<Expr *> Args, | ||||
SourceLocation RParenLoc, | SourceLocation RParenLoc, | ||||
Expr *Config, bool IsExecConfig) { | Expr *Config, bool IsExecConfig) { | ||||
FunctionDecl *FDecl = dyn_cast_or_null<FunctionDecl>(NDecl); | FunctionDecl *FDecl = dyn_cast_or_null<FunctionDecl>(NDecl); | ||||
unsigned BuiltinID = (FDecl ? FDecl->getBuiltinID() : 0); | unsigned BuiltinID = (FDecl ? FDecl->getBuiltinID() : 0); | ||||
// Functions with 'interrupt' attribute cannot be called directly. | |||||
if (FDecl && FDecl->hasAttr<AnyX86InterruptAttr>()) { | |||||
Diag(Fn->getExprLoc(), diag::err_anyx86_interrupt_called); | |||||
return ExprError(); | |||||
} | |||||
// Promote the function operand. | // Promote the function operand. | ||||
// We special-case function promotion here because we only allow promoting | // We special-case function promotion here because we only allow promoting | ||||
// builtin functions to function pointers in the callee of a call. | // builtin functions to function pointers in the callee of a call. | ||||
ExprResult Result; | ExprResult Result; | ||||
if (BuiltinID && | if (BuiltinID && | ||||
Fn->getType()->isSpecificBuiltinType(BuiltinType::BuiltinFn)) { | Fn->getType()->isSpecificBuiltinType(BuiltinType::BuiltinFn)) { | ||||
Result = ImpCastExprToType(Fn, Context.getPointerType(FDecl->getType()), | Result = ImpCastExprToType(Fn, Context.getPointerType(FDecl->getType()), | ||||
CK_BuiltinFnToFnPtr).get(); | CK_BuiltinFnToFnPtr).get(); | ||||
▲ Show 20 Lines • Show All 9,578 Lines • Show Last 20 Lines |