diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-03-31 10:21:50 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-03-31 10:21:50 +0000 |
commit | dccbfaf917e009c8cf260091275b0e4d1cb5d456 (patch) | |
tree | 001f98c381ee6b1a96a21a4d8f29740cc2407893 /lldb/source/Expression/ClangExpressionParser.cpp | |
parent | 4c1b7467714e01335fcda3e396d8fed6ac273693 (diff) | |
download | bcm5719-llvm-dccbfaf917e009c8cf260091275b0e4d1cb5d456.tar.gz bcm5719-llvm-dccbfaf917e009c8cf260091275b0e4d1cb5d456.zip |
Fix type detection for 'char' variables
A char can have signed and unsigned encoding but previously lldb always
assumed it is signed. This CL adds a logic to detect the encoding of
'char' types based on the default encoding on the target architecture.
It fixes variable printing and expression evaluation on architectures
where 'char' is signed by default.
Differential revision: http://reviews.llvm.org/D8636
llvm-svn: 233682
Diffstat (limited to 'lldb/source/Expression/ClangExpressionParser.cpp')
-rw-r--r-- | lldb/source/Expression/ClangExpressionParser.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lldb/source/Expression/ClangExpressionParser.cpp b/lldb/source/Expression/ClangExpressionParser.cpp index b0a2dc138f0..c7d84e61813 100644 --- a/lldb/source/Expression/ClangExpressionParser.cpp +++ b/lldb/source/Expression/ClangExpressionParser.cpp @@ -228,6 +228,9 @@ ClangExpressionParser::ClangExpressionParser (ExecutionContextScope *exe_scope, if (expr.DesiredResultType() == ClangExpression::eResultTypeId) m_compiler->getLangOpts().DebuggerCastResultToId = true; + m_compiler->getLangOpts().CharIsSigned = + ArchSpec(m_compiler->getTargetOpts().Triple.c_str()).CharIsSignedByDefault(); + // Spell checking is a nice feature, but it ends up completing a // lot of types that we didn't strictly speaking need to complete. // As a result, we spend a long time parsing and importing debug |