[cfe-commits] r44502 - in /cfe/trunk/CodeGen: CGStmt.cpp CodeGenFunction.cpp CodeGenFunction.h

Chris Lattner sabre at nondot.org
Sat Dec 1 17:43:38 PST 2007


Author: lattner
Date: Sat Dec  1 19:43:38 2007
New Revision: 44502

URL: http://llvm.org/viewvc/llvm-project?rev=44502&view=rev
Log:
move unsupported warning into a centralized place.

Modified:
    cfe/trunk/CodeGen/CGStmt.cpp
    cfe/trunk/CodeGen/CodeGenFunction.cpp
    cfe/trunk/CodeGen/CodeGenFunction.h

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

==============================================================================
--- cfe/trunk/CodeGen/CGStmt.cpp (original)
+++ cfe/trunk/CodeGen/CGStmt.cpp Sat Dec  1 19:43:38 2007
@@ -19,9 +19,6 @@
 using namespace clang;
 using namespace CodeGen;
 
-#include "clang/Basic/Diagnostic.h"
-#include "CodeGenModule.h"
-
 //===----------------------------------------------------------------------===//
 //                              Statement Emission
 //===----------------------------------------------------------------------===//
@@ -41,11 +38,7 @@
       else
         EmitAggExpr(E, 0, false);
     } else {
-      
-      unsigned DiagID = CGM.getDiags().getCustomDiagID(Diagnostic::Warning, 
-                                                  "cannot codegen this yet");
-      SourceRange Range = S->getSourceRange();
-      CGM.getDiags().Report(S->getLocStart(), DiagID, 0, 0, &Range, 1);
+      WarnUnsupported(S);
     }
     break;
   case Stmt::NullStmtClass: break;

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

==============================================================================
--- cfe/trunk/CodeGen/CodeGenFunction.cpp (original)
+++ cfe/trunk/CodeGen/CodeGenFunction.cpp Sat Dec  1 19:43:38 2007
@@ -14,6 +14,7 @@
 #include "CodeGenFunction.h"
 #include "CodeGenModule.h"
 #include "clang/Basic/TargetInfo.h"
+#include "clang/Basic/Diagnostic.h"
 #include "clang/AST/AST.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
@@ -143,3 +144,13 @@
   
   return CGT.getCGRecordLayout(Ty);
 }
+
+/// WarnUnsupported - Print out a warning that codegen doesn't support the
+/// specified stmt yet.
+void CodeGenFunction::WarnUnsupported(const Stmt *S) {
+  unsigned DiagID = CGM.getDiags().getCustomDiagID(Diagnostic::Warning, 
+                                                   "cannot codegen this yet");
+  SourceRange Range = S->getSourceRange();
+  CGM.getDiags().Report(S->getLocStart(), DiagID, 0, 0, &Range, 1);
+}
+

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

==============================================================================
--- cfe/trunk/CodeGen/CodeGenFunction.h (original)
+++ cfe/trunk/CodeGen/CodeGenFunction.h Sat Dec  1 19:43:38 2007
@@ -269,6 +269,10 @@
   
   
   void EmitBlock(llvm::BasicBlock *BB);
+  
+  /// WarnUnsupported - Print out a warning that codegen doesn't support the
+  /// specified stmt yet.
+  void WarnUnsupported(const Stmt *S);
 
   //===--------------------------------------------------------------------===//
   //                                  Helpers





More information about the cfe-commits mailing list