[llvm-commits] [llvm] r142403 - in /llvm/trunk: include/llvm/Object/COFF.h lib/Object/COFFObjectFile.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Tue Oct 18 12:31:59 PDT 2011
Author: mspencer
Date: Tue Oct 18 14:31:59 2011
New Revision: 142403
URL: http://llvm.org/viewvc/llvm-project?rev=142403&view=rev
Log:
Object/COFF: Change type from a struct to a uint16_t. The struct would be
incorrect for bigendian systems.
Modified:
llvm/trunk/include/llvm/Object/COFF.h
llvm/trunk/lib/Object/COFFObjectFile.cpp
Modified: llvm/trunk/include/llvm/Object/COFF.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Object/COFF.h?rev=142403&r1=142402&r2=142403&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Object/COFF.h (original)
+++ llvm/trunk/include/llvm/Object/COFF.h Tue Oct 18 14:31:59 2011
@@ -45,13 +45,18 @@
support::ulittle32_t Value;
support::little16_t SectionNumber;
- struct {
- support::ulittle8_t BaseType;
- support::ulittle8_t ComplexType;
- } Type;
+ support::ulittle16_t Type;
support::ulittle8_t StorageClass;
support::ulittle8_t NumberOfAuxSymbols;
+
+ uint8_t getBaseType() const {
+ return Type & 0x0F;
+ }
+
+ uint8_t getComplexType() const {
+ return (Type & 0xF0) >> 4;
+ }
};
struct coff_section {
Modified: llvm/trunk/lib/Object/COFFObjectFile.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Object/COFFObjectFile.cpp?rev=142403&r1=142402&r2=142403&view=diff
==============================================================================
--- llvm/trunk/lib/Object/COFFObjectFile.cpp (original)
+++ llvm/trunk/lib/Object/COFFObjectFile.cpp Tue Oct 18 14:31:59 2011
@@ -147,7 +147,7 @@
symb->SectionNumber == COFF::IMAGE_SYM_UNDEFINED) {
Result = SymbolRef::ST_External;
} else {
- if (symb->Type.ComplexType == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
+ if (symb->getComplexType() == COFF::IMAGE_SYM_DTYPE_FUNCTION) {
Result = SymbolRef::ST_Function;
} else {
char Type;
More information about the llvm-commits
mailing list