Skip to content
  1. Jul 03, 2013
    • Jordan Rose's avatar
      [scan-build] Log compiler invocation to stderr, not stdout. · 1187b95b
      Jordan Rose authored
      This is important for preprocessing steps, which may output to stdout.
      
      Also, change ENV accesses using barewords to use string keys instead.
      
      PR16414
      
      llvm-svn: 185555
      1187b95b
    • Jordan Rose's avatar
      With CLANG_ENABLE_STATIC_ANALYZER=0, link clang properly and skip clang-check. · b8859f67
      Jordan Rose authored
      Previously, the CMake build still tried to link clang against the static
      analyzer libraries, even if CLANG_ENABLE_STATIC_ANALYZER was off.
      Furthermore, clang-check depends on the analyzer, so it should be disabled
      (in both CMake and configure builds).
      
      In theory, clang-check could be made to conditionally include analyzer
      support (like clang itself), but for now this at least gets a CMake ALL_BUILD
      working.
      
      Patch by Stephen Kelly, modified by me.
      
      llvm-svn: 185548
      b8859f67
    • Bill Schmidt's avatar
      Fix PR16454: Don't #include altivec.h when preprocessing assembly. · b3b804e4
      Bill Schmidt authored
      When the -maltivec flag is present, altivec.h is auto-included for the
      compilation.  This is not appropriate when the job action is to
      preprocess a file containing assembly code.  So don't do that.
      
      I was unable to convert the test in the bug report into a regression
      test.  The original symptom was exposed with:
      
        % touch x.S
        % ./bin/clang -target powerpc64-unknown-linux-gnu -maltivec -S -o - x.S
      
      I tried this test (and numerous variants) on a PPC64 system:
      
      ----------------------------------------------------------------------------
      // RUN: touch %t
      // RUN: %clang -maltivec -S %t -o - | FileCheck %s
      
      // Verify that assembling an empty file does not auto-include altivec.h.
      
      // CHECK-NOT: static vector
      ----------------------------------------------------------------------------
      
      However, this test passes for some reason even on a clang built
      without the fix.  I'd be happy to add a test case but at this point
      I'm not able to figure one out, and I don't want to hold up the patch
      unnecessarily.  Please let me know if you have ideas.
      
      Thanks,
      Bill
      
      llvm-svn: 185544
      b3b804e4
    • Serge Pavlov's avatar
      Test case for PR7887 - failed with asm("") · f432f857
      Serge Pavlov authored
      llvm-svn: 185543
      f432f857
    • Rafael Espindola's avatar
      We don't need to know the OpenSUSE version, so don't parse it. · 10a63c2f
      Rafael Espindola authored
      Patch by Johannes Obermayr.
      
      llvm-svn: 185537
      10a63c2f
    • Daniel Jasper's avatar
      Prevent error message when formatting an empty file. · 09573741
      Daniel Jasper authored
      This fixes llvm.org/PR16514.
      
      llvm-svn: 185531
      09573741
    • Daniel Jasper's avatar
      Don't insert confusing line breaks in comparisons. · 7ae41cdd
      Daniel Jasper authored
      In general, clang-format breaks after an operator if the LHS spans
      multiple lines. Otherwise, this can lead to confusing effects and
      effectively hide the operator precendence, e.g. in
      
      if (aaaaaaaaaaaaaa ==
              bbbbbbbbbbbbbb && c) { ...
      
      This patch removes this rule for comparisons, if the LHS is not a binary
      expression itself as many users were wondering why clang-format inserts
      an unnecessary linebreak.
      
      Before:
      if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
              aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) >
          5) { ...
      
      After:
      if (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
              aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) > 5) { ...
      
      In the long run, we might:
      - Want to do this for other binary expressions as well.
      - Do this only if the RHS is short or even only if it is a literal.
      
      llvm-svn: 185530
      7ae41cdd
    • Pavel Labath's avatar
      [analyzer] Improve handling of noreturn destructors · f77e7368
      Pavel Labath authored
      Summary:
      The analyzer incorrectly handled noreturn destructors which were hidden inside
      function calls. This happened because NoReturnFunctionChecker only listened for
      PostStmt events, which are not executed for destructor calls. I've changed it to
      listen to PostCall events, which should catch both cases.
      
      Reviewers: jordan_rose
      
      CC: cfe-commits
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1056
      
      llvm-svn: 185522
      f77e7368
    • Serge Pavlov's avatar
      Fixed test options. · b4bbae07
      Serge Pavlov authored
      llvm-svn: 185493
      b4bbae07
    • Kaelyn Uhrain's avatar
      Allow typo correction to try removing nested name specifiers. · 10413a46
      Kaelyn Uhrain authored
      The removal is tried by retrying the failed lookup of a correction
      candidate with either the MemberContext or SS (CXXScopeSpecifier) or
      both set to NULL if they weren't already. If the candidate identifier
      is then looked up successfully, make a note in the candidate that the
      SourceRange should include any existing nested name specifier even if
      the candidate isn't adding a different one (i.e. the candidate has a
      NULL NestedNameSpecifier).
      
      Also tweak the diagnostic messages to differentiate between a suggestion
      that just replaces the identifer but leaves the existing nested name
      specifier intact and one that replaces the entire qualified identifier,
      in cases where the suggested replacement is unqualified.
      
      llvm-svn: 185487
      10413a46
    • Kaelyn Uhrain's avatar
      Look for corrections in enclosing namespaces that require a global NestedNameSpecifier. · b18b0c0f
      Kaelyn Uhrain authored
      CorrectTypo will now see and consider those corrections that are effectively
      shadowed by other declarations in a closer context when resolved via an
      unqualified lookup. This involves adding any parent namespaces to the set of
      namespaces as fully-qualified name specifiers, and also adding potential
      corrections that passed name lookup but were rejected by the given
      CorrectionCandidateCallback into the set of failed corrections that should be
      tried with the set of namespace specifiers.
      
      llvm-svn: 185486
      b18b0c0f
    • Manman Ren's avatar
      Debug Info: set default to gdwarf-2 for Darwin. · 38db0920
      Manman Ren authored
      Darwin systems currently do not support dwarf version 3 or above. When we are
      ready, we can bump the default to gdwarf-4 for Darwin.
      
      For other systems, the default is dwarf version 3, if everything goes smoothly,
      we can bump the version to 4.
      
      rdar://13591116
      
      llvm-svn: 185483
      38db0920
  2. Jul 02, 2013
  3. Jul 01, 2013
    • Eli Friedman's avatar
      Simplify code in mangler. · d02bbeb4
      Eli Friedman authored
      llvm-svn: 185384
      d02bbeb4
    • Eli Friedman's avatar
      Simplify linkage code for static local vars. · c48d31c3
      Eli Friedman authored
      The key insight here is that weak linkage for a static local variable
      should always mean linkonce_odr, because every file that needs it will
      generate a definition.  We don't actually care about the precise linkage
      of the parent context.  I feel a bit silly that I didn't realize this before.
      
      llvm-svn: 185381
      c48d31c3
    • Eli Friedman's avatar
      Fix CMakeLists.txt. · 4747c714
      Eli Friedman authored
      Sorry about that.
      
      llvm-svn: 185374
      4747c714
    • Eli Friedman's avatar
      Fix mangling for block literals. · 7e346a81
      Eli Friedman authored
      Blocks, like lambdas, can be written in contexts which are required to be
      treated as the same under ODR.  Unlike lambdas, it isn't possible to actually
      take the address of a block, so the mangling of the block itself doesn't
      matter. However, objects like static variables inside a block do need to
      be mangled in a consistent way.
      
      There are basically three components here. One, block literals need a
      consistent numbering.  Two, objects/types inside a block literal need
      to be mangled using it.  Three, objects/types inside a block literal need
      to have their linkage computed correctly.
      
      llvm-svn: 185372
      7e346a81
    • Anton Korobeynikov's avatar
      Fix MSP430 builtin types. · ef412908
      Anton Korobeynikov authored
      Patch by Job Noorman!
      
      llvm-svn: 185362
      ef412908
    • Daniel Jasper's avatar
      Fix incorrect token counting introduced by r185319. · ca7bd720
      Daniel Jasper authored
      This lead to weird formatting.
      Before:
      DoSomethingWithVector({ {} /* No data */ }, {
        { 1, 2 }
      });
      After:
      DoSomethingWithVector({ {} /* No data */ }, { { 1, 2 } });
      
      llvm-svn: 185346
      ca7bd720
    • Alexander Kornienko's avatar
      Avoid column limit violation in block comments in certain cases. · aa620e18
      Alexander Kornienko authored
      Summary:
      Add penalty when an excessively long line in a block comment can not be
      broken on a leading whitespace. Lack of this addition can lead to severe column
      width violations when they can be easily avoided.
      
      Reviewers: djasper
      
      Reviewed By: djasper
      
      CC: cfe-commits, klimek
      
      Differential Revision: http://llvm-reviews.chandlerc.com/D1071
      
      llvm-svn: 185337
      aa620e18
    • Daniel Jasper's avatar
      Don't align "} // namespace" comments. · 251b3c9e
      Daniel Jasper authored
      This is not all bad, but people are often surprised by it.
      
      Before:
      namespace {
      int SomeVariable = 0; // comment
      }                     // namespace
      
      After:
      namespace {
      int SomeVariable = 0; // comment
      } // namespace
      
      llvm-svn: 185327
      251b3c9e
    • NAKAMURA Takumi's avatar
      clang/test/lit.cfg: Improve is_filesystem_case_insensitive() to work properly on cygwin. · 77fcfe70
      NAKAMURA Takumi authored
      Cygwin does not accept the form /CYGDRIVE/X/PATH/TO/FILE against /cygdrive/X/PATH/TO/FILE.
      "cygdrive" must be lower-cased.
      
      llvm-svn: 185323
      77fcfe70
    • Daniel Jasper's avatar
      Don't add an extra space before ellipsis after pointers. · bafa6b71
      Daniel Jasper authored
      Before (for styles where the pointer binds to the type):
      template <class... Ts> void Foo(Ts... ts) {}
      template <class... Ts> void Foo(Ts* ... ts) {}
      After:
      template <class... Ts> void Foo(Ts... ts) {}
      template <class... Ts> void Foo(Ts*... ts) {}
      
      llvm-svn: 185321
      bafa6b71
    • Daniel Jasper's avatar
      Keep space between pointer and block comment. · 022612db
      Daniel Jasper authored
      Before: void f(int */* unused */) {}
      After:  void f(int * /* unused */) {}
      
      The previous version seems to be valid C++ code but confuses many syntax
      highlighters.
      
      llvm-svn: 185320
      022612db
    • Daniel Jasper's avatar
      Fix braced-list detection in lieu of trailing comments. · 7f5d53e5
      Daniel Jasper authored
      Before:
      DoSomethingWithVector({
      } /* No data */);
      After:
      DoSomethingWithVector({} /* No data */);
      
      llvm-svn: 185319
      7f5d53e5
    • Sylvestre Ledru's avatar
      Following the modification introduced in llvm by commit 185311 · 103b51c7
      Sylvestre Ledru authored
      The build system is currently miss-identifying GNU/kFreeBSD as FreeBSD.
      This kind of simplification is sometimes useful, but in general it's not correct. 
      
      As GNU/kFreeBSD is an hybrid system, for kernel-related issues we want to match the
      build definitions used for FreeBSD, whereas for userland-related issues we want to
      match the definitions used for other systems with Glibc.
      
      The current modification adjusts the build system so that they can be distinguished,
      and explicitly adds GNU/kFreeBSD to the build checks in which it belongs.
      
      Fixes bug #16445.
      
      Patch by Robert Millan in the context of Debian.
      
      llvm-svn: 185312
      103b51c7
Loading