forked from OSchip/llvm-project
Emit a warning the first time that one tries to resolve the size of a type passing a nullptr ExecutionContext - but only when it might actually make a difference
This should help us find these cases and act on them llvm-svn: 227289
This commit is contained in:
parent
ccd2a6d958
commit
d7cb643ef0
|
@ -2081,6 +2081,20 @@ ClangASTType::GetBitSize (ExecutionContext *exe_ctx) const
|
|||
return bit_size;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
static bool g_printed = false;
|
||||
StreamString s;
|
||||
s.Printf("warning: trying to determine the size of type ");
|
||||
DumpTypeDescription(&s);
|
||||
s.Printf("\n without a valid ExecutionContext. this is not reliable. please file a bug against LLDB.\nbacktrace:\n");
|
||||
Host::Backtrace(s, 10);
|
||||
if (!g_printed)
|
||||
{
|
||||
printf("%s\n", s.GetData());
|
||||
g_printed = true;
|
||||
}
|
||||
}
|
||||
// fallthrough
|
||||
default:
|
||||
const uint32_t bit_size = m_ast->getTypeSize (qual_type);
|
||||
|
|
Loading…
Reference in New Issue