[cfe-commits] r54836 - in /cfe/trunk/lib/CodeGen: CGBuiltin.cpp CGExpr.cpp CGExprAgg.cpp CGExprComplex.cpp CGExprConstant.cpp CGExprScalar.cpp CGStmt.cpp CodeGenFunction.cpp CodeGenFunction.h CodeGenModule.cpp CodeGenModule.h

Daniel Dunbar daniel at zuster.org
Fri Aug 15 17:56:44 PDT 2008


Author: ddunbar
Date: Fri Aug 15 19:56:44 2008
New Revision: 54836

URL: http://llvm.org/viewvc/llvm-project?rev=54836&view=rev
Log:
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.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/CodeGen/CGExpr.cpp
    cfe/trunk/lib/CodeGen/CGExprAgg.cpp
    cfe/trunk/lib/CodeGen/CGExprComplex.cpp
    cfe/trunk/lib/CodeGen/CGExprConstant.cpp
    cfe/trunk/lib/CodeGen/CGExprScalar.cpp
    cfe/trunk/lib/CodeGen/CGStmt.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
    cfe/trunk/lib/CodeGen/CodeGenFunction.h
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp
    cfe/trunk/lib/CodeGen/CodeGenModule.h

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Fri Aug 15 19:56:44 2008
@@ -427,7 +427,7 @@
   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()))

Modified: cfe/trunk/lib/CodeGen/CGExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExpr.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExpr.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExpr.cpp Fri Aug 15 19:56:44 2008
@@ -90,8 +90,7 @@
 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());

Modified: cfe/trunk/lib/CodeGen/CGExprAgg.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprAgg.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprAgg.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprAgg.cpp Fri Aug 15 19:56:44 2008
@@ -60,7 +60,7 @@
   //===--------------------------------------------------------------------===//
   
   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::VisitBinaryOperator(const BinaryOperator *E) {
-  CGF.WarnUnsupported(E, "aggregate binary expression");
+  CGF.ErrorUnsupported(E, "aggregate binary expression");
 }
 
 void AggExprEmitter::VisitBinAssign(const BinaryOperator *E) {

Modified: cfe/trunk/lib/CodeGen/CGExprComplex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprComplex.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprComplex.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprComplex.cpp Fri Aug 15 19:56:44 2008
@@ -228,7 +228,7 @@
 //===----------------------------------------------------------------------===//
 
 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);

Modified: cfe/trunk/lib/CodeGen/CGExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprConstant.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprConstant.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprConstant.cpp Fri Aug 15 19:56:44 2008
@@ -39,7 +39,7 @@
   //===--------------------------------------------------------------------===//
     
   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));
   }
@@ -129,7 +129,7 @@
     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();
@@ -541,7 +541,7 @@
     } 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 @@
     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()) {
@@ -789,7 +789,7 @@
       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);
   }

Modified: cfe/trunk/lib/CodeGen/CGExprScalar.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGExprScalar.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGExprScalar.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGExprScalar.cpp Fri Aug 15 19:56:44 2008
@@ -453,7 +453,7 @@
 //===----------------------------------------------------------------------===//
 
 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()));

Modified: cfe/trunk/lib/CodeGen/CGStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGStmt.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGStmt.cpp Fri Aug 15 19:56:44 2008
@@ -52,7 +52,7 @@
       else
         EmitAggExpr(E, 0, false);
     } else {
-      WarnUnsupported(S, "statement");
+      ErrorUnsupported(S, "statement");
     }
     break;
   case Stmt::NullStmtClass: break;

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.cpp Fri Aug 15 19:56:44 2008
@@ -173,10 +173,10 @@
   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) {

Modified: cfe/trunk/lib/CodeGen/CodeGenFunction.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenFunction.h?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenFunction.h Fri Aug 15 19:56:44 2008
@@ -315,9 +315,9 @@
   
   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

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Fri Aug 15 19:56:44 2008
@@ -65,10 +65,10 @@
   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 @@
                     &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 @@
   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;

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.h?rev=54836&r1=54835&r2=54836&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.h (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.h Fri Aug 15 19:56:44 2008
@@ -188,13 +188,13 @@
   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,





More information about the cfe-commits mailing list