diff options
author | David Blaikie <dblaikie@gmail.com> | 2016-05-03 23:06:40 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2016-05-03 23:06:40 +0000 |
commit | af09f4ac7296ad7a3539c114151f2c520d091637 (patch) | |
tree | 3e06eff719c7a942139846d343281aaff3baffe6 /clang/lib/CodeGen/CGDebugInfo.cpp | |
parent | 43e3a64270eff0782e72afd839bcdd860b582c77 (diff) | |
download | bcm5719-llvm-af09f4ac7296ad7a3539c114151f2c520d091637.tar.gz bcm5719-llvm-af09f4ac7296ad7a3539c114151f2c520d091637.zip |
[modules][debuginfo] Only include imported modules when targeting LLDB
These constructs are only applicable to a debugger capable of loading a
Clang AST, so omit them for brevity when not doing so.
We could potentially propagate more of CodeGenOptions through the
ObjectFilePCGContainerOperations for consistency (so the next person who
adds some CodeGenOpts feature that tweaks debug info output doesn't get
caught by this), so I'm open to objections/alternatives there, but went
with this for now.
Tested just a couple of basic cases (one direct, one indirect (through
the ObjectFilePCHContainerOperations) & fixed up other cases to pass the
-debugger-tuning flag as appropriate.
llvm-svn: 268460
Diffstat (limited to 'clang/lib/CodeGen/CGDebugInfo.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGDebugInfo.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGDebugInfo.cpp b/clang/lib/CodeGen/CGDebugInfo.cpp index 29f597112c1..a98df93a042 100644 --- a/clang/lib/CodeGen/CGDebugInfo.cpp +++ b/clang/lib/CodeGen/CGDebugInfo.cpp @@ -3505,6 +3505,8 @@ void CGDebugInfo::EmitUsingDecl(const UsingDecl &UD) { } void CGDebugInfo::EmitImportDecl(const ImportDecl &ID) { + if (CGM.getCodeGenOpts().getDebuggerTuning() != llvm::DebuggerKind::LLDB) + return; if (Module *M = ID.getImportedModule()) { auto Info = ExternalASTSource::ASTSourceDescriptor(*M); DBuilder.createImportedDeclaration( |