[llvm] r239357 - [MC] Use unsigned for the Kind bitfield in MCSymbol
Justin Bogner
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
> Log:
> [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
instead?
> Modified:
> llvm/trunk/include/llvm/MC/MCSymbol.h
>
> Modified: llvm/trunk/include/llvm/MC/MCSymbol.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCSymbol.h?rev=239357&r1=239356&r2=239357&view=diff
> ==============================================================================
> --- 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
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list