diff options
author | David Blaikie <dblaikie@gmail.com> | 2014-07-02 18:31:35 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2014-07-02 18:31:35 +0000 |
commit | d47fb5b33960d22c85e292b0f520fd5b4c080fa5 (patch) | |
tree | 6fdd31ad10cbb4043e3da88233c38f9eb0271caa /llvm/lib/CodeGen/LiveDebugVariables.h | |
parent | a8c3509ffe367d002f0f5d25849567a4e125a5c4 (diff) | |
download | bcm5719-llvm-d47fb5b33960d22c85e292b0f520fd5b4c080fa5.tar.gz bcm5719-llvm-d47fb5b33960d22c85e292b0f520fd5b4c080fa5.zip |
Don't try to construct debug LexicalScopes hierarchy for functions that do not have top level debug information.
If a function isn't actually in a CU's subprogram list in the debug info
metadata, ignore all the DebugLocs and don't try to build scopes, track
variables, etc.
While this is possibly a minor optimization, it's also a correctness fix
for an incoming patch that will add assertions to LexicalScopes and the
debug info verifier to ensure that all scope chains lead to debug info
for the current function.
Fix up a few test cases that had broken/incomplete debug info that could
violate this constraint.
Add a test case where this occurs by design (inlining a
debug-info-having function in an attribute nodebug function - we want
this to work because /if/ the nodebug function is then inlined into a
debug-info-having function, it should be fine (and will work fine - we
just stitch the scopes up as usual), but should the inlining not happen
we need to not assert fail either).
llvm-svn: 212203
Diffstat (limited to 'llvm/lib/CodeGen/LiveDebugVariables.h')
-rw-r--r-- | llvm/lib/CodeGen/LiveDebugVariables.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/LiveDebugVariables.h b/llvm/lib/CodeGen/LiveDebugVariables.h index bb6743547e3..7ec0d17e42d 100644 --- a/llvm/lib/CodeGen/LiveDebugVariables.h +++ b/llvm/lib/CodeGen/LiveDebugVariables.h @@ -22,6 +22,7 @@ #define LLVM_CODEGEN_LIVEDEBUGVARIABLES_H #include "llvm/ADT/ArrayRef.h" +#include "llvm/IR/DebugInfo.h" #include "llvm/CodeGen/MachineFunctionPass.h" namespace llvm { @@ -32,6 +33,7 @@ class VirtRegMap; class LiveDebugVariables : public MachineFunctionPass { void *pImpl; + DenseMap<const Function*, DISubprogram> FunctionDIs; public: static char ID; // Pass identification, replacement for typeid @@ -64,6 +66,7 @@ private: bool runOnMachineFunction(MachineFunction &) override; void releaseMemory() override; void getAnalysisUsage(AnalysisUsage &) const override; + bool doInitialization(Module &) override; }; |