From: Chris Lattner Date: Sun, 2 Dec 2007 01:43:38 +0000 (+0000) Subject: move unsupported warning into a centralized place. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc5e8268292046114ffe02e48773572a91a310f1;p=clang move unsupported warning into a centralized place. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44502 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/CodeGen/CGStmt.cpp b/CodeGen/CGStmt.cpp index d41d2dec69..40cdcd351f 100644 --- a/CodeGen/CGStmt.cpp +++ b/CodeGen/CGStmt.cpp @@ -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; diff --git a/CodeGen/CodeGenFunction.cpp b/CodeGen/CodeGenFunction.cpp index 3602d60029..db5072be0b 100644 --- a/CodeGen/CodeGenFunction.cpp +++ b/CodeGen/CodeGenFunction.cpp @@ -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); +} + diff --git a/CodeGen/CodeGenFunction.h b/CodeGen/CodeGenFunction.h index e4bf09b15e..2fd8063837 100644 --- a/CodeGen/CodeGenFunction.h +++ b/CodeGen/CodeGenFunction.h @@ -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