summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-08-20 19:50:13 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-08-20 19:50:13 +0000
commit9fd495be1fb1470bfefa59938904a8f38920e0f1 (patch)
treeefbfc9920d985a6ba518f65348e610072393b4aa /clang/lib/Sema/Sema.cpp
parent250951abf551bd6d91fcf568739f84f046fe280a (diff)
downloadbcm5719-llvm-9fd495be1fb1470bfefa59938904a8f38920e0f1.tar.gz
bcm5719-llvm-9fd495be1fb1470bfefa59938904a8f38920e0f1.zip
[OPENMP]Fix delayed diagnostics for standalone declare target directive.
If the function is marked as declare target in a standalone directive, the delayed diagnostics is not emitted. Patch fixes this problem. llvm-svn: 369432
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 89e7d4c9e6d..9a84a3d4c80 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -1383,7 +1383,7 @@ static void emitCallStackNotes(Sema &S, FunctionDecl *FD) {
// Emit any deferred diagnostics for FD and erase them from the map in which
// they're stored.
-static void emitDeferredDiags(Sema &S, FunctionDecl *FD) {
+static void emitDeferredDiags(Sema &S, FunctionDecl *FD, bool ShowCallStack) {
auto It = S.DeviceDeferredDiags.find(FD);
if (It == S.DeviceDeferredDiags.end())
return;
@@ -1402,7 +1402,7 @@ static void emitDeferredDiags(Sema &S, FunctionDecl *FD) {
// FIXME: Should this be called after every warning/error emitted in the loop
// above, instead of just once per function? That would be consistent with
// how we handle immediate errors, but it also seems like a bit much.
- if (HasWarningOrError)
+ if (HasWarningOrError && ShowCallStack)
emitCallStackNotes(S, FD);
}
@@ -1505,7 +1505,7 @@ void Sema::markKnownEmitted(
assert(!IsKnownEmitted(S, C.Callee) &&
"Worklist should not contain known-emitted functions.");
S.DeviceKnownEmittedFns[C.Callee] = {C.Caller, C.Loc};
- emitDeferredDiags(S, C.Callee);
+ emitDeferredDiags(S, C.Callee, C.Caller);
// If this is a template instantiation, explore its callgraph as well:
// Non-dependent calls are part of the template's callgraph, while dependent
OpenPOWER on IntegriCloud