Skip to content
  1. Feb 05, 2014
  2. Feb 04, 2014
    • Chandler Carruth's avatar
      Silence a warning: · f6ae4922
      Chandler Carruth authored
      In file included from ../unittests/Support/ProcessTest.cpp:11:
      ../utils/unittest/googletest/include/gtest/gtest.h:1448:28: warning: comparison of integers of different signs: 'const unsigned int' and 'const int' [-Wsign-compare]
      GTEST_IMPL_CMP_HELPER_(NE, !=);
      ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
      ../utils/unittest/googletest/include/gtest/gtest.h:1433:12: note: expanded from macro 'GTEST_IMPL_CMP_HELPER_'
        if (val1 op val2) {\
                 ^
      ../unittests/Support/ProcessTest.cpp:46:3: note: in instantiation of function template specialization 'testing::internal::CmpHelperNE<unsigned int, int>' requested here
        EXPECT_NE((r1 | r2), 0);
        ^
      
      llvm-svn: 200801
      f6ae4922
    • Aaron Ballman's avatar
      Implemented support for Process::GetRandomNumber on Windows. · 78440734
      Aaron Ballman authored
      Patch thanks to Stephan Tolksdorf!
      
      llvm-svn: 200767
      78440734
  3. Feb 01, 2014
    • Peter Collingbourne's avatar
      Introduce line editor library. · c7d437c1
      Peter Collingbourne authored
      This library will be used by clang-query. I can imagine LLDB becoming another
      client of this library, so I think LLVM is a sensible place for it to live.
      It wraps libedit, and adds tab completion support.
      
      The code is loosely based on the line editor bits in LLDB, with a few
      improvements:
      
       - Polymorphism for retrieving the list of tab completions, based on
         the concept pattern from the new pass manager.
      
       - Tab completion doesn't corrupt terminal output if the input covers
         multiple lines. Unfortunately this can only be done in a truly horrible
         way, as far as I can tell. But since the alternative is to implement our
         own line editor (which I don't think LLVM should be in the business of
         doing, at least for now) I think it may be acceptable.
      
       - Includes a fallback for the case where the user doesn't have libedit
         installed.
      
      Note that this uses C stdio, mainly because libedit also uses C stdio.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2200
      
      llvm-svn: 200595
      c7d437c1
    • Peter Collingbourne's avatar
      Introduce llvm::sys::path::home_directory. · f7d41011
      Peter Collingbourne authored
      This will be used by the line editor library to derive a default path to
      the history file.
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D2199
      
      llvm-svn: 200594
      f7d41011
  4. Jan 31, 2014
  5. Jan 29, 2014
  6. Jan 28, 2014
  7. Jan 27, 2014
    • Alp Toker's avatar
      Roll back the ConstStringRef change for now · 17d4e98e
      Alp Toker authored
      There are a couple of interesting things here that we want to check over
      (particularly the expecting asserts in StringRef) and get right for general use
      in ADT so hold back on this one. For clang we have a workable templated
      solution to use in the meanwhile.
      
      This reverts commit r200187.
      
      llvm-svn: 200194
      17d4e98e
    • Alp Toker's avatar
      StringRef: Extend constexpr capabilities and introduce ConstStringRef · 042f41b0
      Alp Toker authored
      (1) Add llvm_expect(), an asserting macro that can be evaluated as a constexpr
          expression as well as a runtime assert or compiler hint in release builds. This
          technique can be used to construct functions that are both unevaluated and
          compiled depending on usage.
      
      (2) Update StringRef using llvm_expect() to preserve runtime assertions while
          extending the same checks to static asserts in C++11 builds that support the
          feature.
      
      (3) Introduce ConstStringRef, a strong subclass of StringRef that references
          compile-time constant strings. It's convertible to, but not from, ordinary
          StringRef and thus can be used to add compile-time safety to various interfaces
          in LLVM and clang that only accept fixed inputs such as diagnostic format
          strings that tend to get misused.
      
      llvm-svn: 200187
      042f41b0
  8. Jan 24, 2014
    • Alp Toker's avatar
      Fix known typos · cb402911
      Alp Toker authored
      Sweep the codebase for common typos. Includes some changes to visible function
      names that were misspelt.
      
      llvm-svn: 200018
      cb402911
  9. Jan 22, 2014
    • Matt Arsenault's avatar
      Bug 18228 - Fix accepting bitcasts between vectors of pointers with a · fc3c91d0
      Matt Arsenault authored
      different number of elements.
      
      Bitcasts were passing with vectors of pointers with different number of
      elements since the number of elements was checking
      SrcTy->getVectorNumElements() == SrcTy->getVectorNumElements() which
      isn't helpful. The addrspacecast was also wrong, but that case at least
      is caught by the verifier. Refactor bitcast and addrspacecast handling
      in castIsValid to be more readable and fix this problem.
      
      llvm-svn: 199821
      fc3c91d0
  10. Jan 19, 2014
    • Michael Gottesman's avatar
      [APInt] Fix nearestLogBase2 to return correct answers for very large APInt and... · 84fcbdea
      Michael Gottesman authored
      [APInt] Fix nearestLogBase2 to return correct answers for very large APInt and APInt with a bitwidth of 1.
      
      I also improved the comments, added some more tests, etc.
      
      llvm-svn: 199610
      84fcbdea
    • Michael Gottesman's avatar
      [APInt] Fixed bug where APInt(UINT32_MAX, 0) would blow up when being constructed. · 073af74e
      Michael Gottesman authored
      This was due to arithmetic overflow in the getNumBits() computation. Now we
      cast BitWidth to a uint64_t so that does not occur during the computation. After
      the computation is complete, the uint64_t is truncated when the function
      returns.
      
      I know that this is not something that is likely to happen, but it *IS* a valid
      input and we should not blow up.
      
      llvm-svn: 199609
      073af74e
    • Chandler Carruth's avatar
      [PM] Make the verifier work independently of any pass manager. · 043949d4
      Chandler Carruth authored
      This makes the 'verifyFunction' and 'verifyModule' functions totally
      independent operations on the LLVM IR. It also cleans up their API a bit
      by lifting the abort behavior into their clients and just using an
      optional raw_ostream parameter to control printing.
      
      The implementation of the verifier is now just an InstVisitor with no
      multiple inheritance. It also is significantly more const-correct, and
      hides the const violations internally. The two layers that force us to
      break const correctness are building a DomTree and dispatching through
      the InstVisitor.
      
      A new VerifierPass is used to implement the legacy pass manager
      interface in terms of the other pieces.
      
      The error messages produced may be slightly different now, and we may
      have slightly different short circuiting behavior with different usage
      models of the verifier, but generally everything works equivalently and
      this unblocks wiring the verifier up to the new pass manager.
      
      llvm-svn: 199569
      043949d4
  11. Jan 17, 2014
  12. Jan 16, 2014
    • Bill Wendling's avatar
      Reapply r194218 with fix: · 91686d6d
      Bill Wendling authored
      Move copying of global initializers below the cloning of functions.
      
      The BlockAddress doesn't have access to the correct basic blocks until the
      functions have been cloned. This causes the BlockAddress to point to the old
      values. Just wait until the functions have been cloned before copying the
      initializers.
      PR13163
      
      llvm-svn: 199354
      91686d6d
  13. Jan 13, 2014
    • Rafael Espindola's avatar
      Update getLazyBitcodeModule to use ErrorOr for error handling. · 5b6c1e8e
      Rafael Espindola authored
      llvm-svn: 199125
      5b6c1e8e
    • Chandler Carruth's avatar
      [PM] Split DominatorTree into a concrete analysis result object which · 73523021
      Chandler Carruth authored
      can be used by both the new pass manager and the old.
      
      This removes it from any of the virtual mess of the pass interfaces and
      lets it derive cleanly from the DominatorTreeBase<> template. In turn,
      tons of boilerplate interface can be nuked and it turns into a very
      straightforward extension of the base DominatorTree interface.
      
      The old analysis pass is now a simple wrapper. The names and style of
      this split should match the split between CallGraph and
      CallGraphWrapperPass. All of the users of DominatorTree have been
      updated to match using many of the same tricks as with CallGraph. The
      goal is that the common type remains the resulting DominatorTree rather
      than the pass. This will make subsequent work toward the new pass
      manager significantly easier.
      
      Also in numerous places things became cleaner because I switched from
      re-running the pass (!!! mid way through some other passes run!!!) to
      directly recomputing the domtree.
      
      llvm-svn: 199104
      73523021
    • Chandler Carruth's avatar
      [cleanup] Move the Dominators.h and Verifier.h headers into the IR · 5ad5f15c
      Chandler Carruth authored
      directory. These passes are already defined in the IR library, and it
      doesn't make any sense to have the headers in Analysis.
      
      Long term, I think there is going to be a much better way to divide
      these matters. The dominators code should be fully separated into the
      abstract graph algorithm and have that put in Support where it becomes
      obvious that evn Clang's CFGBlock's can use it. Then the verifier can
      manually construct dominance information from the Support-driven
      interface while the Analysis library can provide a pass which both
      caches, reconstructs, and supports a nice update API.
      
      But those are very long term, and so I don't want to leave the really
      confusing structure until that day arrives.
      
      llvm-svn: 199082
      5ad5f15c
  14. Jan 12, 2014
  15. Jan 11, 2014
  16. Jan 10, 2014
  17. Jan 09, 2014
    • Rafael Espindola's avatar
      Add a unit test for the copy constructor. · cd56deb6
      Rafael Espindola authored
      I would not normally add tests like these, but the copy constructor is not
      used at all in our codebase with c++11, so having this tests might prevent
      breaking the c++03 build again.
      
      llvm-svn: 198886
      cd56deb6
  18. Jan 08, 2014
  19. Jan 07, 2014
    • Chandler Carruth's avatar
      Move the LLVM IR asm writer header files into the IR directory, as they · 9aca918d
      Chandler Carruth authored
      are part of the core IR library in order to support dumping and other
      basic functionality.
      
      Rename the 'Assembly' include directory to 'AsmParser' to match the
      library name and the only functionality left their -- printing has been
      in the core IR library for quite some time.
      
      Update all of the #includes to match.
      
      All of this started because I wanted to have the layering in good shape
      before I started adding support for printing LLVM IR using the new pass
      infrastructure, and commandline support for the new pass infrastructure.
      
      llvm-svn: 198688
      9aca918d
    • Chandler Carruth's avatar
      Re-sort all of the includes with ./utils/sort_includes.py so that · 8a8cd2ba
      Chandler Carruth authored
      subsequent changes are easier to review. About to fix some layering
      issues, and wanted to separate out the necessary churn.
      
      Also comment and sink the include of "Windows.h" in three .inc files to
      match the usage in Memory.inc.
      
      llvm-svn: 198685
      8a8cd2ba
  20. Jan 05, 2014
  21. Jan 03, 2014
  22. Jan 02, 2014
Loading