From: Argyrios Kyrtzidis Date: Thu, 15 Nov 2012 20:59:00 +0000 (+0000) Subject: [utils/ClangDataFormat.py] For invalid source locations just return X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=596be9372b79842b74c0654ab3dab33200812e8a;p=clang [utils/ClangDataFormat.py] For invalid source locations just return "" for summary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168087 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/ClangDataFormat.py b/utils/ClangDataFormat.py index bde38111d2..23aaba2211 100644 --- a/utils/ClangDataFormat.py +++ b/utils/ClangDataFormat.py @@ -34,10 +34,14 @@ def StringRef_summary(strref, internal_dict): class SourceLocation(object): def __init__(self, srcloc): self.srcloc = srcloc + self.ID = srcloc.GetChildAtIndex(0).GetValueAsUnsigned() def offset(self): return getValueFromExpression(self.srcloc, ".getOffset()").GetValueAsUnsigned() + def isInvalid(self): + return self.ID == 0 + def isMacro(self): return getValueFromExpression(self.srcloc, ".isMacroID()").GetValueAsUnsigned() @@ -49,6 +53,8 @@ class SourceLocation(object): return print_str.GetSummary() def summary(self): + if self.isInvalid(): + return "" desc = "(offset: %d, %s)" % (self.offset(), "macro" if self.isMacro() else "file") srcmgr_path = findObjectExpressionPath("clang::SourceManager", lldb.frame) if srcmgr_path: