[llvm-commits] [llvm] r44825 - in /llvm/trunk: include/llvm/Target/TargetData.h lib/Target/TargetData.cpp

Chris Lattner clattner at apple.com
Mon Dec 10 16:33:31 PST 2007


> URL: http://llvm.org/viewvc/llvm-project?rev=44825&view=rev
> Log:
> Move TargetData::hostIsLittleEndian out of line, which means we
> don't have to #include config.h in it.  #including config.h breaks
> other projects that have their own autoconf stuff and try to #include
> the llvm headers.  One obscure example is llvm-gcc.

Duncan, this patch gets llvm-gcc to build, but it still doesn't  
answer the big question: why does TargetData contain information  
about the host?  I don't think this is the right approach.  Also, you  
can get the host endianness without autoconf by using something  
simple like:

bool islittleendian() {
   union {
     int i;
     char c;
   };

   i = 1;
   return c;
}

-Chris






More information about the llvm-commits mailing list