- Sep 07, 2014
-
-
Hal Finkel authored
InstCombine just got a bit smarter about checking known bits of returned values, and because this test runs the optimizer, it requires an update. We should really rewrite this test to directly check the IR output from CodeGen. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217347 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217339 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217337 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217327 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217326 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 06, 2014
-
-
Nico Weber authored
That way, most of the test can run everywhere. Also give the new file an x86 triple in addition to a REQUIRES line. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217314 91177308-0d34-0410-b5e6-96231b3b80d8
-
Nico Weber authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217313 91177308-0d34-0410-b5e6-96231b3b80d8
-
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
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217302 91177308-0d34-0410-b5e6-96231b3b80d8
-
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
-
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
-
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
-
- Sep 05, 2014
-
-
Ben Langmuir authored
This innocuous statement to get the identifier info for __va_list_tag was causing an assertion failure: NextIsPrevious() && "decl became non-canonical unexpectedly" if the __va_list_tag identifier was found in a PCH in some circumstances, because it was looked up before the ASTReader had a Sema object to use to find existing decls to merge with. We could possibly move getting the identifier info even later, or make it lazy if we wanted to, but this seemed like the minimal change. Now why a PCH would have this identifier in the first place is a bit mysterious. This seems to be related to the global module index in some way, because when the test case is built without the global module index it will not emit an identifier for __va_list_tag into the PCH, but with the global module index it does. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217275 91177308-0d34-0410-b5e6-96231b3b80d8
-
Samuel Benzaquen authored
Summary: Separate the matchers by type and statically dispatch to the right list. For any node type that we support, it reduces the number of matchers we run it through. For node types we do not support, it makes match() a noop. This change improves our clang-tidy related benchmark by ~30%. Reviewers: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D5197 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217274 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217272 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
It is very common to include headers with DOS-style line endings, such as windows.h, from source files with Unix-style line endings. Previously, we would end up with mixed line endings and #endifs that appeared to be on the same line: #if 0 /* expanded by -frewrite-includes */ #include <windows.h>^M#endif /* expanded by -frewrite-includes */ Clang treats either of \r or \n as a line ending character, so this is purely a cosmetic issue. This has no automated test because most Unix tools on Windows will implictly convert CRLF to LF when reading files, making it very hard to detect line ending mismatches. FileCheck doesn't understand {{\r}} either. Fixes PR20552. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217259 91177308-0d34-0410-b5e6-96231b3b80d8
-
Jordan Rose authored
Patch by Daniel Fahlgren! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217258 91177308-0d34-0410-b5e6-96231b3b80d8
-
James Molloy authored
This patch adds support for the 32bit numeric max/min and directed round-to-integral NEON intrinsics that were added as part of v8, along with unit tests. Patch by Graham Hunter! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217242 91177308-0d34-0410-b5e6-96231b3b80d8
-
Renato Golin authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217241 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: return { a: a, link: function() { f(); // }, link: function() { f(); // } }; After: return { a: a, link: function() { f(); // }, link: function() { f(); // } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217238 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: e&& e.SomeFunction(); After: e && e.SomeFunction(); Yeah, this might be useful for C++, too, but it is not such a frequent pattern there (plus the fix is much harder). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217237 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: SomeFunction(function(){}); After: SomeFunction(function() {}); git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217236 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Before: return { 'finish': // a }; After: return { 'finish': // a }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217235 91177308-0d34-0410-b5e6-96231b3b80d8
-
NAKAMURA Takumi authored
Note, i686-cygwin doesn't use thiscall. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217234 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
use __thiscall. (This doesn't actually work for MSVC; they don't allow the __thiscall qualifier here, but it's sufficient to demonstrate that we do implement the intent of the DR.) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217213 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217212 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
(just cleaning up unique_ptr stuff by finding interesting 'reset' calls at the moment) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217210 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217209 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217208 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217206 91177308-0d34-0410-b5e6-96231b3b80d8
-
David Blaikie authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217205 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
This is a follow-up to r216841. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217204 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Trieu authored
Originally, self reference checking made a double pass over some expressions to handle reference type checking. Now, allow HandleValue to also check reference types, and fallback to Visit for unhandled expressions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217203 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
Differential Revision: http://reviews.llvm.org/D5183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217200 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
Naked functions don't have prologues or epilogues, so doing codegen for anything other than inline assembly would be completely hit or miss. Differential Revision: http://reviews.llvm.org/D5183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217199 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
For naked functions with parameters, Clang would still emit stores in the prologue that would clobber the stack, because LLVM doesn't set up a stack frame. (This shows up in -O0 compiles, because the stores are optimized away otherwise.) For example: __attribute__((naked)) int f(int x) { asm("movl $42, %eax"); asm("retl"); } Would result in: _Z1fi: movl 12(%esp), %eax movl %eax, (%esp) <--- Oops. movl $42, %eax retl Differential Revision: http://reviews.llvm.org/D5183 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217198 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
before retrying the initialization to produce diagnostics. Otherwise, we may fail to produce any diagnostics, and silently produce invalid AST in a -Asserts build. Also add a note to this codepath to make it more clear why we were trying to create a temporary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217197 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 04, 2014
-
-
Hans Wennborg authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217196 91177308-0d34-0410-b5e6-96231b3b80d8
-
Hans Wennborg authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217195 91177308-0d34-0410-b5e6-96231b3b80d8
-
Reid Kleckner authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@217192 91177308-0d34-0410-b5e6-96231b3b80d8
-