Skip to content
  1. Jun 16, 2012
    • Chandler Carruth's avatar
      Relax one assertion -- long double has strange alignments on lots of · 3bbbeebd
      Chandler Carruth authored
      platforms.
      
      Also, remove one assertion on MSVC because it produces a completely
      preposterous result, claiming something needs 12-byte alignment.
      
      llvm-svn: 158599
      3bbbeebd
    • Chandler Carruth's avatar
      Try to reduce the size of the array used for compile-time testing by · 8710d886
      Chandler Carruth authored
      making the bounds all '1', and chunking it a bit.
      
      llvm-svn: 158598
      8710d886
    • Chandler Carruth's avatar
      Add support to the alignment support header for conjuring a character · dea00d7c
      Chandler Carruth authored
      array of a suitable size and alignment for any of a number of different
      types to be stored into the character array.
      
      The mechanisms for producing an explicitly aligned type are fairly
      complex because this operation is poorly supported on all compilers.
      We've spent a fairly significant amount of time experimenting with
      different implementations inside of Google, and the one using explicitly
      expanded templates has been the most robust.
      
      Credit goes to Nick Lewycky for writing the first 20 versions or so of
      this logic we had inside of Google. I based this on the only one to
      actually survive. In case anyone is worried, yes we are both explicitly
      re-contributing and re-licensing it for LLVM. =]
      
      Once the issues with actually specifying the alignment are finished, it
      turns out that most compilers don't in turn align anything the way they
      are instructed. Testing of this logic against both Clang and GCC
      indicate that the alignment constraints are largely ignored by both
      compilers! I've come up with and used a work-around by wrapping each
      alignment-hinted type directly in a struct, and using that struct to
      align the character array through a union. This elaborate hackery is
      terrifying, but I've included testing that caught a terrifying number of
      bugs in every other technique I've tried.
      
      All of this in order to implement a poor C++98 programmers emulation of
      C++11 unrestricted unions in classes such as SmallDenseMap.
      
      llvm-svn: 158597
      dea00d7c
Loading