Skip to content
  1. May 01, 2011
  2. Apr 30, 2011
    • Benjamin Kramer's avatar
      Remove unused function. · ed5ca78d
      Benjamin Kramer authored
      llvm-svn: 130622
      ed5ca78d
    • Benjamin Kramer's avatar
      Remove noisy semicolons. · e63dbc37
      Benjamin Kramer authored
      llvm-svn: 130621
      e63dbc37
    • Eli Friedman's avatar
      PR9792: Make sure to use the right definition of wchar_t when the default · 786d087e
      Eli Friedman authored
      wchar_t is an unsigned type.
      
      llvm-svn: 130620
      786d087e
    • Jakob Stoklund Olesen's avatar
      When a physreg is live-in and live through a basic block, make sure its live · 38a0b94d
      Jakob Stoklund Olesen authored
      range covers the entire block.
      
      The live range can't be terminated at a random instruction.
      
      llvm-svn: 130619
      38a0b94d
    • Eli Friedman's avatar
      Some small improvements to the builtin (-ffreestanding) stdint.h; in · fe0739df
      Eli Friedman authored
      particular, make sure to handle WCHAR_MIN correctly.
      
      llvm-svn: 130618
      fe0739df
    • Rafael Espindola's avatar
      Pass -fno-dwarf2-cfi-asm and use FileCheck. · 6a10ed51
      Rafael Espindola authored
      llvm-svn: 130617
      6a10ed51
    • Rafael Espindola's avatar
      Implement -fno-dwarf2-cfi-asm. · e264187c
      Rafael Espindola authored
      llvm-svn: 130616
      e264187c
    • Benjamin Kramer's avatar
      InstCombine: Turn (zext A) udiv (zext B) into (zext (A udiv B)). Same for urem or constant B. · 9aa91b1f
      Benjamin Kramer authored
      This obviously helps a lot if the division would be turned into a libcall
      (think i64 udiv on i386), but div is also one of the few remaining instructions
      on modern CPUs that become more expensive when the bitwidth gets bigger.
      
      This also helps register pressure on i386 when dividing chars, divb needs
      two 8-bit parts of a 16 bit register as input where divl uses two registers.
      
      int foo(unsigned char a) { return a/10; }
      int bar(unsigned char a, unsigned char b) { return a/b; }
      
      compiles into (x86_64)
      _foo:
        imull $205, %edi, %eax
        shrl  $11, %eax
        ret
      _bar:
        movzbl        %dil, %eax
        divb  %sil, %al
        movzbl        %al, %eax
        ret
      
      llvm-svn: 130615
      9aa91b1f
    • Benjamin Kramer's avatar
      Use SimplifyDemandedBits on div instructions. · 57b3df59
      Benjamin Kramer authored
      This folds away silly stuff like (a&255)/1000 -> 0.
      
      llvm-svn: 130614
      57b3df59
    • Benjamin Kramer's avatar
      FileCheckize. · 6a50bbd2
      Benjamin Kramer authored
      llvm-svn: 130613
      6a50bbd2
    • Douglas Gregor's avatar
      When comparing parameters of reference-to-qualified type during · 85894a8f
      Douglas Gregor authored
      partial ordering of function templates, use a simple superset
      relationship rather than the convertibility-implying
      isMoreQualifiedThan/compatibilyIncludes relationship. Fixes partial
      ordering between references and address-space-qualified references.
      
      llvm-svn: 130612
      85894a8f
    • Rafael Espindola's avatar
      Implement MCAsmStreamer::EmitEHSymAttributes. Doing this in the asm streamer · bde52bca
      Rafael Espindola authored
      is a bit ugly, but doing it on the base MCStreamer would be redundant
      with the object streamer which does it using SD.
      
      llvm-svn: 130611
      bde52bca
    • Rafael Espindola's avatar
      Handle PrivateExtern eh symbols. · 0b474c2d
      Rafael Espindola authored
      llvm-svn: 130609
      0b474c2d
    • Ken Dyck's avatar
      Replace a literal 8 with Context->getCharWidth() in · d9c83e6c
      Ken Dyck authored
      SynthesizeByrefCopyDestroyHelper(). No change in functionality intended.
      
      llvm-svn: 130608
      d9c83e6c
    • Chandler Carruth's avatar
      61f4cbf3
    • Chandler Carruth's avatar
      Switch the type-trait like APIs on the AST to only check for incomplete · 7623757c
      Chandler Carruth authored
      types after looking through arrays. Arrays with an unknown bound seem to
      be specifically allowed in the library type traits in C++0x, and GCC's
      builtin __is_trivial returns 'true' for the type 'int[]'. Now Clang
      agrees with GCC about __is_trivial here.
      
      Also hardens these methods against dependent types by just returning false.
      
      llvm-svn: 130605
      7623757c
    • Chandler Carruth's avatar
      Extract a function to impose the completeness requirement on unary type · b077620c
      Chandler Carruth authored
      trait arguments. Reflow the logic to use early exit instead of a complex
      condition expression. Switch to a switch for acting on different type
      traits and add a bunch of the recently implemented type traits here.
      This fixes one of the regressions with the new __is_standard_layout
      trait to again require a complete type. It also fixes some latent bugs
      in other traits that never did impose this despite the standard
      requiring it. However, all these bugs were hidden for non-borland
      systems where the default is to require a complete type.
      
      It's unclear to me what the best approach here is: providing an explicit
      lists for the ones requiring complete types only w/ Borland and using
      a default for the rest, or forcing this switch to enumerate the traits
      and make it clear which way each one goes.
      
      I'm still working on cleaning up the tests so that they actually catch
      this, a much more comprehensive update to the tests will come once I've
      worked through the bugs I'm finding via inspection.
      
      llvm-svn: 130604
      b077620c
    • Chandler Carruth's avatar
      Rename the last '[hH]asStandardLayout' entites to '[iI]sStandardLayout' · 583edf88
      Chandler Carruth authored
      based on Doug's preferences when we discussed this in IRC. This brings
      the wording more in line with the standard.
      
      llvm-svn: 130603
      583edf88
    • Chandler Carruth's avatar
      Hoist all of the type-specific trait logic for __is_standard_layout into · c1ce4f58
      Chandler Carruth authored
      a Type method isStandardLayoutType, to keep our user API matching the
      type trait builtins as closely as possible. Also, implement it in terms
      of other Type APIs rather than in terms of other type traits. This
      models the implementation on that of isLiteralType and isTrivialType.
      There remain some common problems with these traits still, so this is
      a bit of a WIP. However, we can now fix all of these traits at the same
      time and in a consistent manner.
      
      llvm-svn: 130602
      c1ce4f58
    • Chandler Carruth's avatar
      Completely re-implement the core logic behind the __is_standard_layout · b196374f
      Chandler Carruth authored
      type trait. The previous implementation suffered from several problems:
      
      1) It implemented all of the logic in RecordType by walking over every
         base and field in a CXXRecordDecl and validating the constraints of
         the standard. This made for very straightforward code, but is
         extremely inefficient. It also is conceptually wrong, the logic tied
         to the C++ definition of standard-layout classes should be in
         CXXRecordDecl, not RecordType.
      2) To address the performance problems with #1, a cache bit was added to
         CXXRecordDecl, and at the completion of every C++ class, the
         RecordType was queried to determine if it was a standard layout
         class, and that state was cached. Two things went very very wrong
         with this. First, the caching version of the query *was never
         called*. Even within the recursive steps of the walk over all fields
         and bases the caching variant was not called, making each query
         a full *recursive* walk. Second, despite the cache not being used, it
         was computed for every class declared, even when the trait was never
         used in the program. This probably significantly regressed compile
         time performance for edge-case files.
      3) An ASTContext was required merely to query the type trait because
         querying it performed the actual computations.
      4) The caching bit wasn't managed correctly (uninitialized).
      
      The new implementation follows the system for all the other traits on
      C++ classes by encoding all the state needed in the definition data and
      building up the trait incrementally as each base and member are added to
      the definition of the class.
      
      The idiosyncracies of the specification of standard-layout classes
      requires more state than I would like; currently 5 bits. I could
      eliminate one of the bits easily at the expense of both clarity and
      resilience of the code. I might be able to eliminate one of the other
      bits by computing its state in terms of other state bits in the
      definition. I've already done that in one place where there was a fairly
      simple way to achieve it.
      
      It's possible some of the bits could be moved out of the definition data
      and into some other structure which isn't serialized if the serialized
      bloat is a problem. That would preclude serialization of a partial class
      declaration, but that's likely already precluded.
      
      Comments on any of these issues welcome.
      
      llvm-svn: 130601
      b196374f
    • Benjamin Kramer's avatar
      Initialize HasStandardLayout. · 08635fcc
      Benjamin Kramer authored
      llvm-svn: 130600
      08635fcc
    • Jakob Stoklund Olesen's avatar
      Allow folded spills in test. · f5eaa8dc
      Jakob Stoklund Olesen authored
      llvm-svn: 130599
      f5eaa8dc
    • Ted Kremenek's avatar
      Move the SelfInit checker to the 'cocoa.experimental' package. · 80677465
      Ted Kremenek authored
      llvm-svn: 130598
      80677465
Loading