Skip to content
Snippets Groups Projects
  1. Sep 06, 2014
    • Nico Weber's avatar
      Attempt to fix ARM bot. (The test references a typedef from x86 asm.) · 4b8073f6
      Nico Weber authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217313 91177308-0d34-0410-b5e6-96231b3b80d8
      4b8073f6
    • Chandler Carruth's avatar
      [x86] Clean up the x86 builtin specs to reflect r217310 in LLVM which · a48d2cd0
      Chandler Carruth authored
      made the 8-bit masks actually 8-bit arguments to these intrinsics.
      
      These builtins are a mess. Many were missing the I qualifier which
      I added where obviously correct. Most aren't tested, but I've updated
      the relevant tests. I've tried to catch all the things that should
      become 'c' in this round.
      
      It's also frustrating because the set of these is really ad-hoc and
      doesn't really map that cleanly to the set supported by either GCC or
      LLVM. Oh well...
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217311 91177308-0d34-0410-b5e6-96231b3b80d8
      a48d2cd0
    • Richard Smith's avatar
      Add error, recovery and fixit for "~A::A() {...}". · 7d14568f
      Richard Smith authored
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217302 91177308-0d34-0410-b5e6-96231b3b80d8
      7d14568f
    • Nico Weber's avatar
      Add -Wunused-local-typedef, a warning that finds unused local typedefs. · 4f2a6d6d
      Nico Weber authored
      The warning warns on TypedefNameDecls -- typedefs and C++11 using aliases --
      that are !isReferenced(). Since the isReferenced() bit on TypedefNameDecls
      wasn't used for anything before this warning it wasn't always set correctly,
      so this patch also adds a few missing MarkAnyDeclReferenced() calls in
      various places for TypedefNameDecls.
      
      This is made a bit complicated due to local typedefs possibly being used only
      after their local scope has closed. Consider:
      
          template <class T>
          void template_fun(T t) {
            typename T::Foo s3foo;  // YYY
            (void)s3foo;
          }
          void template_fun_user() {
            struct Local {
              typedef int Foo;  // XXX
            } p;
            template_fun(p);
          }
      
      Here the typedef in XXX is only used at end-of-translation unit, when YYY in
      template_fun() gets instantiated. To handle this, typedefs that are unused when
      their scope exits are added to a set of potentially unused typedefs, and that
      set gets checked at end-of-TU. Typedefs that are still unused at that point then
      get warned on. There's also serialization code for this set, so that the
      warning works with precompiled headers and modules. For modules, the warning
      is emitted when the module is built, for precompiled headers each time the
      header gets used.
      
      Finally, consider a function using C++14 auto return types to return a local
      type defined in a header:
      
          auto f() {
            struct S { typedef int a; };
            return S();
          }
      
      Here, the typedef escapes its local scope and could be used by only some
      translation units including the header. To not warn on this, add a
      RecursiveASTVisitor that marks all delcs on local types returned from auto
      functions as referenced. (Except if it's a function with internal linkage, or
      the decls are private and the local type has no friends -- in these cases, it
      _is_ safe to warn.)
      
      Several of the included testcases (most of the interesting ones) were provided
      by Richard Smith.
      
      (gcc's spelling -Wunused-local-typedefs is supported as an alias for this
      warning.)
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217298 91177308-0d34-0410-b5e6-96231b3b80d8
      4f2a6d6d
    • Richard Smith's avatar
      Reword switch/goto diagnostics "protected scope" diagnostics. Making up a term · 06260b83
      Richard Smith authored
      "protected scope" is very unhelpful here and actively confuses users. Instead,
      simply state the nature of the problem in the diagnostic: we cannot jump from
      here to there. The notes explain nicely why not.
      
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217293 91177308-0d34-0410-b5e6-96231b3b80d8
      06260b83
    • David Blaikie's avatar
      Fix r217275 to work without the need for standard headers being included · 1e2542d3
      David Blaikie authored
      It seems (I guess) in ObjC that va_list is provided without the need for
      inclusions. I verified that with this change the test still crashes in
      the absence of the fix committed in r217275.
      
      git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217290 91177308-0d34-0410-b5e6-96231b3b80d8
      1e2542d3
  2. Sep 05, 2014
  3. Sep 04, 2014
Loading