summaryrefslogtreecommitdiff
path: root/include/llvm/DebugInfo.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-01-26 21:55:23 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-01-26 21:55:23 +0000
commitff715b240351dc2b8fba1be236d7a1746d2f0031 (patch)
tree19700863ada4b512b416da8ef3fd7be035292bdc /include/llvm/DebugInfo.h
parentda6de52435d05e73e3691006e9f8d78e0102343e (diff)
downloadllvm-ff715b240351dc2b8fba1be236d7a1746d2f0031.tar.gz
llvm-ff715b240351dc2b8fba1be236d7a1746d2f0031.tar.bz2
llvm-ff715b240351dc2b8fba1be236d7a1746d2f0031.tar.xz
PR14566: Debug Info: Removing top level lexical blocks
This adds support for LLVM to accept metadata that doesn't include a top level lexical block in a function. Specifically LLVM couldn't handle this when there were file changes relating to these blocks. I've updated a few test cases to ensure other functionality (such as inlining) isn't affected by this change, but haven't pervasively updated all the test cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173592 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/DebugInfo.h')
-rw-r--r--include/llvm/DebugInfo.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/DebugInfo.h b/include/llvm/DebugInfo.h
index dd32de9f39..47b58e22e0 100644
--- a/include/llvm/DebugInfo.h
+++ b/include/llvm/DebugInfo.h
@@ -734,7 +734,7 @@ namespace llvm {
class DILexicalBlockFile : public DIScope {
public:
explicit DILexicalBlockFile(const MDNode *N = 0) : DIScope(N) {}
- DIScope getContext() const { return getScope().getContext(); }
+ DIScope getContext() const { if (getScope().isSubprogram()) return getScope(); return getScope().getContext(); }
unsigned getLineNumber() const { return getScope().getLineNumber(); }
unsigned getColumnNumber() const { return getScope().getColumnNumber(); }
StringRef getDirectory() const {