]> granicus.if.org Git - clang/commitdiff
move unsupported warning into a centralized place.
authorChris Lattner <sabre@nondot.org>
Sun, 2 Dec 2007 01:43:38 +0000 (01:43 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 2 Dec 2007 01:43:38 +0000 (01:43 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44502 91177308-0d34-0410-b5e6-96231b3b80d8

CodeGen/CGStmt.cpp
CodeGen/CodeGenFunction.cpp
CodeGen/CodeGenFunction.h

index d41d2dec690c4f17ef48e85f321dc5cf35d70ffe..40cdcd351f5a44c7af4f3030899c02de4cf7e67a 100644 (file)
@@ -19,9 +19,6 @@
 using namespace clang;
 using namespace CodeGen;
 
-#include "clang/Basic/Diagnostic.h"
-#include "CodeGenModule.h"
-
 //===----------------------------------------------------------------------===//
 //                              Statement Emission
 //===----------------------------------------------------------------------===//
@@ -41,11 +38,7 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {
       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;
index 3602d60029b141e06bc6dada6d113e7e490954d5..db5072be0b9e0fc3d4b880d09cc1eea472f6b25e 100644 (file)
@@ -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 @@ const CGRecordLayout *CodeGenFunction::getCGRecordLayout(CodeGenTypes &CGT,
   
   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);
+}
+
index e4bf09b15eac90c32cd7cca0932ae7e4c2b29026..2fd8063837f3d596f023b04e6ab9ee78d8c83cd2 100644 (file)
@@ -269,6 +269,10 @@ public:
   
   
   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