if (V)
return RValue::get(V);
- WarnUnsupported(E, "builtin function");
+ ErrorUnsupported(E, "builtin function");
// Unknown builtin, for now just dump it out and return undef.
if (hasAggregateLLVMType(E->getType()))
LValue CodeGenFunction::EmitLValue(const Expr *E) {
switch (E->getStmtClass()) {
default: {
- printf("Statement class: %d\n", E->getStmtClass());
- WarnUnsupported(E, "l-value expression");
+ ErrorUnsupported(E, "l-value expression");
llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));
return LValue::MakeAddr(llvm::UndefValue::get(Ty),
E->getType().getCVRQualifiers());
//===--------------------------------------------------------------------===//
void VisitStmt(Stmt *S) {
- CGF.WarnUnsupported(S, "aggregate expression");
+ CGF.ErrorUnsupported(S, "aggregate expression");
}
void VisitParenExpr(ParenExpr *PE) { Visit(PE->getSubExpr()); }
}
void AggExprEmitter::VisitBinaryOperator(const BinaryOperator *E) {
- CGF.WarnUnsupported(E, "aggregate binary expression");
+ CGF.ErrorUnsupported(E, "aggregate binary expression");
}
void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {
//===----------------------------------------------------------------------===//
ComplexPairTy ComplexExprEmitter::VisitExpr(Expr *E) {
- CGF.WarnUnsupported(E, "complex expression");
+ CGF.ErrorUnsupported(E, "complex expression");
const llvm::Type *EltTy =
CGF.ConvertType(E->getType()->getAsComplexType()->getElementType());
llvm::Value *U = llvm::UndefValue::get(EltTy);
//===--------------------------------------------------------------------===//
llvm::Constant *VisitStmt(Stmt *S) {
- CGM.WarnUnsupported(S, "constant expression");
+ CGM.ErrorUnsupported(S, "constant expression");
QualType T = cast<Expr>(S)->getType();
return llvm::UndefValue::get(CGM.getTypes().ConvertType(T));
}
llvm::Constant *C = Visit(E);
llvm::ConstantInt *CI = dyn_cast<llvm::ConstantInt>(C);
if (!CI) {
- CGM.WarnUnsupported(E, "bitfield initialization");
+ CGM.ErrorUnsupported(E, "bitfield initialization");
return;
}
llvm::APInt V = CI->getValue();
} else if (LHS->getType()->isFloatingPoint()) {
Result = llvm::ConstantExpr::getFCmp(FloatPred, LHS, RHS);
} else {
- CGM.WarnUnsupported(E, "constant expression");
+ CGM.ErrorUnsupported(E, "constant expression");
Result = llvm::ConstantInt::getFalse();
}
llvm::Constant *CondVal = EmitConversionToBool(Cond, E->getType());
llvm::ConstantInt *CondValInt = dyn_cast<llvm::ConstantInt>(CondVal);
if (!CondValInt) {
- CGM.WarnUnsupported(E, "constant expression");
+ CGM.ErrorUnsupported(E, "constant expression");
return llvm::Constant::getNullValue(ConvertType(E->getType()));
}
if (CondValInt->isOne()) {
break;
}
}
- CGM.WarnUnsupported(E, "constant l-value expression");
+ CGM.ErrorUnsupported(E, "constant l-value expression");
llvm::Type *Ty = llvm::PointerType::getUnqual(ConvertType(E->getType()));
return llvm::UndefValue::get(Ty);
}
//===----------------------------------------------------------------------===//
Value *ScalarExprEmitter::VisitExpr(Expr *E) {
- CGF.WarnUnsupported(E, "scalar expression");
+ CGF.ErrorUnsupported(E, "scalar expression");
if (E->getType()->isVoidType())
return 0;
return llvm::UndefValue::get(CGF.ConvertType(E->getType()));
else
EmitAggExpr(E, 0, false);
} else {
- WarnUnsupported(S, "statement");
+ ErrorUnsupported(S, "statement");
}
break;
case Stmt::NullStmtClass: break;
return CGT.getCGRecordLayout(RTy->getDecl());
}
-/// WarnUnsupported - Print out a warning that codegen doesn't support the
+/// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified stmt yet.
-void CodeGenFunction::WarnUnsupported(const Stmt *S, const char *Type) {
- CGM.WarnUnsupported(S, Type);
+void CodeGenFunction::ErrorUnsupported(const Stmt *S, const char *Type) {
+ CGM.ErrorUnsupported(S, Type);
}
unsigned CodeGenFunction::GetIDForAddrOfLabel(const LabelStmt *L) {
void EmitBlock(llvm::BasicBlock *BB);
- /// WarnUnsupported - Print out a warning that codegen doesn't support the
+ /// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified stmt yet.
- void WarnUnsupported(const Stmt *S, const char *Type);
+ void ErrorUnsupported(const Stmt *S, const char *Type);
//===--------------------------------------------------------------------===//
// Helpers
assert(!verifyModule(TheModule));
}
-/// WarnUnsupported - Print out a warning that codegen doesn't support the
+/// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified stmt yet.
-void CodeGenModule::WarnUnsupported(const Stmt *S, const char *Type) {
- unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Warning,
+void CodeGenModule::ErrorUnsupported(const Stmt *S, const char *Type) {
+ unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error,
"cannot codegen this %0 yet");
SourceRange Range = S->getSourceRange();
std::string Msg = Type;
&Msg, 1, &Range, 1);
}
-/// WarnUnsupported - Print out a warning that codegen doesn't support the
+/// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified decl yet.
-void CodeGenModule::WarnUnsupported(const Decl *D, const char *Type) {
- unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Warning,
+void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type) {
+ unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error,
"cannot codegen this %0 yet");
std::string Msg = Type;
getDiags().Report(Context.getFullLoc(D->getLocation()), DiagID,
case Decl::LinkageSpec: {
LinkageSpecDecl *LSD = cast<LinkageSpecDecl>(D);
if (LSD->getLanguage() == LinkageSpecDecl::lang_cxx)
- WarnUnsupported(LSD, "linkage spec");
+ ErrorUnsupported(LSD, "linkage spec");
// FIXME: implement C++ linkage, C linkage works mostly by C
// language reuse already.
break;
llvm::Constant *EmitAnnotateAttr(llvm::GlobalValue *GV,
const AnnotateAttr *AA, unsigned LineNo);
- /// WarnUnsupported - Print out a warning that codegen doesn't support the
+ /// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified stmt yet.
- void WarnUnsupported(const Stmt *S, const char *Type);
+ void ErrorUnsupported(const Stmt *S, const char *Type);
- /// WarnUnsupported - Print out a warning that codegen doesn't support the
+ /// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified decl yet.
- void WarnUnsupported(const Decl *D, const char *Type);
+ void ErrorUnsupported(const Decl *D, const char *Type);
private:
void SetFunctionAttributes(const FunctionDecl *FD,