[llvm] r239357 - [MC] Use unsigned for the Kind bitfield in MCSymbol
mail at justinbogner.com
Mon Jun 15 12:53:07 PDT 2015
Reid Kleckner <reid at kleckner.net> writes:
> Author: rnk
> Date: Mon Jun 8 17:12:44 2015
> New Revision: 239357
> URL: http://llvm.org/viewvc/llvm-project?rev=239357&view=rev
> [MC] Use unsigned for the Kind bitfield in MCSymbol
> Fixes most of the test suite on Windows with clang-cl.
> I'm not sure why the test suite was passing with MSVC 2013. Maybe they
> changed their behavior and we are emulating their old sign extension
> behavior. I think this deserves more investigation, but I want to green
> the bot first.
Does MSVC DTRT if we give the enum an underlying type of unsigned
> Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
> --- llvm/trunk/include/llvm/MC/MCSymbol.h (original)
> +++ llvm/trunk/include/llvm/MC/MCSymbol.h Mon Jun 8 17:12:44 2015
> @@ -90,7 +90,9 @@ protected:
> /// This symbol is private extern.
> mutable unsigned IsPrivateExtern : 1;
> - SymbolKind Kind : 2;
> + /// LLVM RTTI discriminator. This is actually a SymbolKind enumerator, but is
> + /// unsigned to avoid sign extension and achieve better bitpacking with MSVC.
> + unsigned Kind : 2;
> /// Index field, for use by the object file implementation.
> mutable uint32_t Index = 0;
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
More information about the llvm-commits