[LLVMdev] non-POD type with llvm-objdump
Eli Friedman
eli.friedman at gmail.com
Tue Oct 18 17:01:16 PDT 2011
On Tue, Oct 18, 2011 at 4:25 PM, Joe Abbey <jabbey at arxan.com> wrote:
> I'm so close to having LLVM build on PowerPC. If there's any PowerPC
> experts, help?
> Lines like this:
> outs() << "[" << format("%2d", i) << "]"
> << "(sec " << format("%2d", int16_t(symbol->SectionNumber)) <<
> ")"
> << "(fl 0x" << format("%02x", symbol->Type.BaseType) << ")"
> << "(ty " << format("%3x", symbol->Type.ComplexType) << ")"
> << "(scl " << format("%3x", symbol->StorageClass) << ") "
> << "(nx " << unsigned(symbol->NumberOfAuxSymbols) << ") "
> << "0x" << format("%08x", symbol->Value) << " "
> << name << "\n";
> Are trying to call the format function with
> struct coff_symbol {
> struct StringTableOffset {
> support::ulittle32_t Zeroes;
> support::ulittle32_t Offset;
> };
> union {
> char ShortName[8];
> StringTableOffset Offset;
> } Name;
> support::ulittle32_t Value;
> support::little16_t SectionNumber;
> struct {
> support::ulittle8_t BaseType;
> support::ulittle8_t ComplexType;
> } Type;
> support::ulittle8_t StorageClass;
> support::ulittle8_t NumberOfAuxSymbols;
> };
> and on PowerPC it generates errors like:
> /Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
> 'int llvm::format_object1<T>::snprint(char*, unsigned int) const [with T =
> llvm::support::detail::packed_endian_specific_integral<unsigned int, little,
> unaligned>]':
> /Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622:
> instantiated from here
> /Users/jabbey/src/llvm/include/llvm/Support/Format.h:88: warning: cannot
> pass objects of non-POD type 'const struct
> llvm::support::detail::packed_endian_specific_integral<unsigned int, little,
> unaligned>' through '...'; call will abort at runtime
> /Users/jabbey/src/llvm/include/llvm/Support/Format.h: In member function
> 'int llvm::format_object2<T1, T2>::snprint(char*, unsigned int) const [with
> T1 = llvm::support::detail::packed_endian_specific_integral<unsigned char,
> little, unaligned>, T2 =
> llvm::support::detail::packed_endian_specific_integral<unsigned char,
> little, unaligned>]':
> /Users/jabbey/src/llvm/tools/llvm-objdump/llvm-objdump.cpp:622:
> instantiated from here
> /Users/jabbey/src/llvm/include/llvm/Support/Format.h:106: warning: cannot
> pass objects of non-POD type 'const struct
> llvm::support::detail::packed_endian_specific_integral<unsigned char,
> little, unaligned>' through '...'; call will abort at runtime
> Can I just cast the value, or would the correct fix be in something like
> include/llvm/Support/Endian.h?
Try to "svn up" first. :)
-Eli
More information about the llvm-dev
mailing list