summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorPaul Robinson <paul.robinson@sony.com>2016-06-16 00:42:36 +0000
committerPaul Robinson <paul.robinson@sony.com>2016-06-16 00:42:36 +0000
commitafd2dde2fdf23658cd0cbe55175953e735fcb62a (patch)
treeed9901b2430749e12ded8fce7ab96fd98298f2e7 /clang/lib
parentd01720d46d9456fce63f58497f56e106d2311efc (diff)
downloadbcm5719-llvm-afd2dde2fdf23658cd0cbe55175953e735fcb62a.tar.gz
bcm5719-llvm-afd2dde2fdf23658cd0cbe55175953e735fcb62a.zip
Allow 'nodebug' on local variables.
Parameters and non-static members of aggregates are still excluded, and probably should remain that way. Differential Revision: http://reviews.llvm.org/D19754 llvm-svn: 272859
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGDebugInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp
index e2000ea79aa..0e756d348c4 100644
--- a/clang/lib/CodeGen/CGDebugInfo.cpp
+++ b/clang/lib/CodeGen/CGDebugInfo.cpp
@@ -3019,6 +3019,8 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, llvm::Value *Storage,
CGBuilderTy &Builder) {
assert(DebugKind >= codegenoptions::LimitedDebugInfo);
assert(!LexicalBlockStack.empty() && "Region stack mismatch, stack empty!");
+ if (VD->hasAttr<NoDebugAttr>())
+ return;
bool Unwritten =
VD->isImplicit() || (isa<Decl>(VD->getDeclContext()) &&
@@ -3163,6 +3165,8 @@ void CGDebugInfo::EmitDeclareOfBlockDeclRefVariable(
if (Builder.GetInsertBlock() == nullptr)
return;
+ if (VD->hasAttr<NoDebugAttr>())
+ return;
bool isByRef = VD->hasAttr<BlocksAttr>();
OpenPOWER on IntegriCloud