summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2017-03-22 10:38:07 +0000
committerChandler Carruth <chandlerc@gmail.com>2017-03-22 10:38:07 +0000
commit421fa6c9e27adacdb52e2195da7f67292e5b18ac (patch)
tree9ac992c3dba9a8bff54810ab599bf7060e196693 /clang/lib/CodeGen/CGCall.cpp
parent00aee43734e040de1d8d98722abfc78db7dc5c82 (diff)
downloadbcm5719-llvm-421fa6c9e27adacdb52e2195da7f67292e5b18ac.tar.gz
bcm5719-llvm-421fa6c9e27adacdb52e2195da7f67292e5b18ac.zip
Remove an overly aggressive assert in r298491 and leave a comment
explaining why we have to ignore errors here even though in other parts of codegen we can be more strict with builtins. Also add a test case based on the code in a TSan test that found this issue. llvm-svn: 298494
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index b9090b413c6..e56fe2c1c1d 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1813,7 +1813,11 @@ void CodeGenModule::ConstructAttributeList(
ASTContext::GetBuiltinTypeError Error;
getContext().GetBuiltinType(BuiltinID, Error, nullptr,
&OverrideNonnullReturn, &OverrideNonnullArgs);
- assert(Error == ASTContext::GE_None && "Should not codegen an error");
+ // Note that we can't check the 'Error' here as there may be errors that
+ // have been diagnosed and reported to the programmer as warnings but
+ // repaired in the AST such as for implicit declarations of builtin
+ // functions. None of those impact our usage of this to analyze attributes
+ // for the builtins.
}
bool HasOptnone = false;
OpenPOWER on IntegriCloud