[Lldb-commits] [PATCH] Fix type detection for 'char' when it is unsigned

Tamas Berghammer tberghammer at google.com
Thu Mar 26 11:50:39 PDT 2015


If LangOpts.CharIsSigned is correctly set in ASTContext then CharTy will be set to BuiltinType::Char_S or to BuiltinType::Char_U based on what is used in the target and BuiltinType::Char_S behaves exactly the same way as BuiltinType::SChar (what is used for SignedCharTy) expect that they use different name when displayed to the user (if they behave differently then that one is a bug in Clang and should be fixed). The same is true for BuiltinType::Char_U and for UnsignedCharTy.

Based on it I still believe if the dwarf file contains a basic type with name "char" and it is a DW_ATE_unsigned_char then CharTy will be initialized to Char_U and everything will work fine and the user will see the type name defined in the dwarf file ("char"). If you want I can add a check (possibly an assert) to verify that we hit this case only when ASTContext.LangOpts.CharIsSigned is false (if it is not true then the dwarf file or lldb is broken).


http://reviews.llvm.org/D8636

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the lldb-commits mailing list