aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2008-09-04 03:43:08 +0000
committerDaniel Dunbar <daniel@zuster.org>2008-09-04 03:43:08 +0000
commit90df4b6661968a84bf64baee489bb2f6d948fcc1 (patch)
tree633ecc6ea2f0535f2737541f6cc94d946b12251c /lib/CodeGen/CodeGenModule.cpp
parent80e62c29fe21cd06c93eba6e72b7e32dca06fcf9 (diff)
Avoid superfluous errors regarding variable-length arrays (casts).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55759 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 5b784aada3..87f5c24b82 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -67,7 +67,10 @@ void CodeGenModule::Release() {
/// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified stmt yet.
-void CodeGenModule::ErrorUnsupported(const Stmt *S, const char *Type) {
+void CodeGenModule::ErrorUnsupported(const Stmt *S, const char *Type,
+ bool OmitOnError) {
+ if (OmitOnError && getDiags().hasErrorOccurred())
+ return;
unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error,
"cannot codegen this %0 yet");
SourceRange Range = S->getSourceRange();
@@ -78,7 +81,10 @@ void CodeGenModule::ErrorUnsupported(const Stmt *S, const char *Type) {
/// ErrorUnsupported - Print out an error that codegen doesn't support the
/// specified decl yet.
-void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type) {
+void CodeGenModule::ErrorUnsupported(const Decl *D, const char *Type,
+ bool OmitOnError) {
+ if (OmitOnError && getDiags().hasErrorOccurred())
+ return;
unsigned DiagID = getDiags().getCustomDiagID(Diagnostic::Error,
"cannot codegen this %0 yet");
std::string Msg = Type;