From 488e993a135ce700b982bf099c3d6b856301d642 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Sat, 16 Aug 2008 00:56:44 +0000 Subject: [PATCH] Change WarnUnsupported to ErrorUnsupported (in name and in practice). - We are beyond the point where this shows up often and when it does generating miscompiled files is bad. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54836 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGBuiltin.cpp | 2 +- lib/CodeGen/CGExpr.cpp | 3 +-- lib/CodeGen/CGExprAgg.cpp | 4 ++-- lib/CodeGen/CGExprComplex.cpp | 2 +- lib/CodeGen/CGExprConstant.cpp | 10 +++++----- lib/CodeGen/CGExprScalar.cpp | 2 +- lib/CodeGen/CGStmt.cpp | 2 +- lib/CodeGen/CodeGenFunction.cpp | 6 +++--- lib/CodeGen/CodeGenFunction.h | 4 ++-- lib/CodeGen/CodeGenModule.cpp | 14 +++++++------- lib/CodeGen/CodeGenModule.h | 8 ++++---- 11 files changed, 28 insertions(+), 29 deletions(-) diff --git a/lib/CodeGen/CGBuiltin.cpp b/lib/CodeGen/CGBuiltin.cpp index 66d4e60c96..1b6a3ff8a3 100644 --- a/lib/CodeGen/CGBuiltin.cpp +++ b/lib/CodeGen/CGBuiltin.cpp @@ -427,7 +427,7 @@ RValue CodeGenFunction::EmitBuiltinExpr(unsigned BuiltinID, const CallExpr *E) { 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())) diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index e6bc5016e9..4a80269230 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -90,8 +90,7 @@ unsigned CodeGenFunction::getAccessedFieldNo(unsigned Idx, 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()); diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 5fa7ef5c52..019d7be50c 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -60,7 +60,7 @@ public: //===--------------------------------------------------------------------===// void VisitStmt(Stmt *S) { - CGF.WarnUnsupported(S, "aggregate expression"); + CGF.ErrorUnsupported(S, "aggregate expression"); } void VisitParenExpr(ParenExpr *PE) { Visit(PE->getSubExpr()); } @@ -235,7 +235,7 @@ void AggExprEmitter::VisitStmtExpr(const StmtExpr *E) { } void AggExprEmitter::VisitBinaryOperator(const BinaryOperator *E) { - CGF.WarnUnsupported(E, "aggregate binary expression"); + CGF.ErrorUnsupported(E, "aggregate binary expression"); } void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) { diff --git a/lib/CodeGen/CGExprComplex.cpp b/lib/CodeGen/CGExprComplex.cpp index dacbd865c3..ba384e7f4f 100644 --- a/lib/CodeGen/CGExprComplex.cpp +++ b/lib/CodeGen/CGExprComplex.cpp @@ -228,7 +228,7 @@ void ComplexExprEmitter::EmitStoreOfComplex(ComplexPairTy Val, llvm::Value *Ptr, //===----------------------------------------------------------------------===// 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); diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index dfd047c89d..ec6a75f356 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -39,7 +39,7 @@ public: //===--------------------------------------------------------------------===// llvm::Constant *VisitStmt(Stmt *S) { - CGM.WarnUnsupported(S, "constant expression"); + CGM.ErrorUnsupported(S, "constant expression"); QualType T = cast(S)->getType(); return llvm::UndefValue::get(CGM.getTypes().ConvertType(T)); } @@ -129,7 +129,7 @@ public: llvm::Constant *C = Visit(E); llvm::ConstantInt *CI = dyn_cast(C); if (!CI) { - CGM.WarnUnsupported(E, "bitfield initialization"); + CGM.ErrorUnsupported(E, "bitfield initialization"); return; } llvm::APInt V = CI->getValue(); @@ -541,7 +541,7 @@ public: } 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(); } @@ -584,7 +584,7 @@ public: llvm::Constant *CondVal = EmitConversionToBool(Cond, E->getType()); llvm::ConstantInt *CondValInt = dyn_cast(CondVal); if (!CondValInt) { - CGM.WarnUnsupported(E, "constant expression"); + CGM.ErrorUnsupported(E, "constant expression"); return llvm::Constant::getNullValue(ConvertType(E->getType())); } if (CondValInt->isOne()) { @@ -789,7 +789,7 @@ public: 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); } diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index ff7a20aea7..e408e9ff9e 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -453,7 +453,7 @@ EmitComplexToScalarConversion(CodeGenFunction::ComplexPairTy Src, //===----------------------------------------------------------------------===// 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())); diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp index bfcddd2df3..daad062619 100644 --- a/lib/CodeGen/CGStmt.cpp +++ b/lib/CodeGen/CGStmt.cpp @@ -52,7 +52,7 @@ void CodeGenFunction::EmitStmt(const Stmt *S) { else EmitAggExpr(E, 0, false); } else { - WarnUnsupported(S, "statement"); + ErrorUnsupported(S, "statement"); } break; case Stmt::NullStmtClass: break; diff --git a/lib/CodeGen/CodeGenFunction.cpp b/lib/CodeGen/CodeGenFunction.cpp index d02c860a10..af63be73fe 100644 --- a/lib/CodeGen/CodeGenFunction.cpp +++ b/lib/CodeGen/CodeGenFunction.cpp @@ -173,10 +173,10 @@ const CGRecordLayout *CodeGenFunction::getCGRecordLayout(CodeGenTypes &CGT, 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) { diff --git a/lib/CodeGen/CodeGenFunction.h b/lib/CodeGen/CodeGenFunction.h index 45f239ac24..b595363ff0 100644 --- a/lib/CodeGen/CodeGenFunction.h +++ b/lib/CodeGen/CodeGenFunction.h @@ -315,9 +315,9 @@ public: 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 diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 99390c1135..1867207248 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -65,10 +65,10 @@ void CodeGenModule::Release() { 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; @@ -76,10 +76,10 @@ void CodeGenModule::WarnUnsupported(const Stmt *S, const char *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, @@ -888,7 +888,7 @@ void CodeGenModule::EmitTopLevelDecl(Decl *D) { case Decl::LinkageSpec: { LinkageSpecDecl *LSD = cast(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; diff --git a/lib/CodeGen/CodeGenModule.h b/lib/CodeGen/CodeGenModule.h index 5f3714cb28..81882515a6 100644 --- a/lib/CodeGen/CodeGenModule.h +++ b/lib/CodeGen/CodeGenModule.h @@ -188,13 +188,13 @@ public: 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, -- 2.40.0