summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [C++11] Use 'nullptr'. Tools edition.Craig Topper2014-06-0831-265/+271
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210422 91177308-0d34-0410-b5e6-96231b3b80d8
* Split out inline asm parsing into ParseStmtAsm.cppAlp Toker2014-06-083-728/+733
| | | | | | | | | This change isolates various llvm/MC headers from the rest of the parser and better aligns with the existing SemaStmtAsm.cpp. No change in functionality, code move only. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210420 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't include llvm/MC/MCParser throughout all of SemaAlp Toker2014-06-083-7/+5
| | | | | | Requires LLVM r210417. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210418 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Simplify microsoft mangling of template instantiationsDavid Majnemer2014-06-081-28/+18
| | | | | | | | | | | Use mangled template instantiation name as key for back references. Templates have their own context for back references, so their mangling is always the same regardless of context. This avoids mangling template instantiations twice. Patch by Agustín Bergé! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210416 91177308-0d34-0410-b5e6-96231b3b80d8
* DeclObjC: Fix comments about bad APIAlp Toker2014-06-071-6/+6
| | | | | | | What's going on here isn't overriding but rather the sketchy practice of member hiding (shadowing of base members). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210404 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid dubious IdentifierInfo::getNameStart() usesAlp Toker2014-06-076-42/+34
| | | | | | | | These cases in particular were incurring an extra strlen() when we already knew the length. They appear to be leftovers from when the interfaces worked with C strings that have continued to compile due to the implicit StringRef ctor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210403 91177308-0d34-0410-b5e6-96231b3b80d8
* StringRefize TargetInfo::getABI()Alp Toker2014-06-073-10/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210402 91177308-0d34-0410-b5e6-96231b3b80d8
* Driver: add -m{,no-}long-calls supportSaleem Abdulrasool2014-06-073-0/+30
| | | | | | | | | | | | | This mirrors the GCC option for the ARM backend. This option enables the backend option "-enable-arm-long-calls". The default behaviour is that this is disabled due to the slight overhead of the generated calls. If the target of jumps are greater than 64M range of offset-based jumps, then the target address must be loaded into a register to make an indirect jump. The backend support for this has been present, but was not previously controllable by the proper flag. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210398 91177308-0d34-0410-b5e6-96231b3b80d8
* Unbreak release builds.Arnold Schwaighofer2014-06-071-0/+1
| | | | | | This test case relies on basic block labels. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210392 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Implement little-endian semantics for vec_unpack[hl]Bill Schmidt2014-06-072-28/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PowerPC vector-unpack-high and vector-unpack-low instructions are defined architecturally with a big-endian bias, in that the vector element numbering is assumed to be "left to right" regardless of whether the processor is in big-endian or little-endian mode. This effectively reverses the meaning of "high" and "low." Such a definition is unnatural for little-endian code generation. To facilitate ease of porting, the vec_unpackh and vec_unpackl interfaces are designed to use natural element ordering, so that elements are numbered according to little-endian design principles when code is generated for a little-endian target. The desired semantics can be achieved by using the opposite instruction for little-endian mode. That is, when a call to vec_unpackh appears in the code, a vector-unpack-low is generated, and when a call to vec_unpackl appears in the code, a vector-unpack-high is generated. The correctness of this code is tested by the new unpack.c test added in a previous patch, as well as the modifications to builtins-ppc-altivec.c in the present patch. Note that these interfaces were originally incorrectly implemented when they take a vector pixel argument. This patch corrects this implementation for both big- and little-endian code generation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210391 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Update test for vec_sum2s interfaceBill Schmidt2014-06-071-0/+4
| | | | | | | | | Commit r210384 prematurely included changes to the little-endian implementation of the vec_sum2s interface. This patch modifies test/CodeGen/builtins-ppc-altivec.c to test those changes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210389 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix crash declaring global allocation function with zero parameters. Fixes ↵Nick Lewycky2014-06-072-1/+4
| | | | | | PR19968! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210388 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix my poor grammar from r210372Richard Trieu2014-06-062-8/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210387 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Update builtins-ppc-altivec.c for PPC64 and PPC64LEBill Schmidt2014-06-062-2704/+8307
| | | | | | | | | | | | | | | | | | | The Altivec builtin test case test/CodeGen/builtins-ppc-altivec.c has always been executed only for 32-bit PowerPC. These tests are equally valid for 64-bit PowerPC. This patch updates the test to be run for three targets: powerpc-unknown-unknown, powerpc64-unknown-unknown, and powerpc64le-unknown-unknown. The expected code generation changes for some of the Altivec builtins for little endian, so this patch adds new CHECK-LE variants to the test for the powerpc64le target. These tests satisfy the testing requirements for some previous patches committed over the last couple of days for lib/Headers/altivec.h: r210279 for vec_perm, r210337 for vec_mul[eo], and r210340 for vec_pack. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210384 91177308-0d34-0410-b5e6-96231b3b80d8
* Delay lookup of simple default template arguments under -fms-compatibilityReid Kleckner2014-06-068-8/+170
| | | | | | | | | | | | | | | | | | MSVC delays parsing of default arguments until instantiation. If the default argument is never used, it is never parsed. We don't model this. Instead, if lookup of a type name fails in a template argument context, we form a DependentNameType, which will be looked up at instantiation time. This fixes errors about 'CControlWinTraits' in atlwin.h. Reviewers: rsmith Differential Revision: http://reviews.llvm.org/D3995 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210382 91177308-0d34-0410-b5e6-96231b3b80d8
* [MS-ABI] Implement dynamic_castWarren Hunt2014-06-062-4/+292
| | | | | | | | | | | | This patch implements call lower from dynamic_cast to __RTDynamicCast and __RTCastToVoid. Test cases are included. A feature of note is that helper function getPolymorphicOffset is placed in such a way that it can be used by EmitTypeid (to be implemented in a later patch) without being moved. Details are included as comments directly in the code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210377 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -Wtautological-undefined-compare and -Wundefined-bool-conversion warningsRichard Trieu2014-06-069-10/+114
| | | | | | | to detect underfined behavior involving pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210372 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix DOS-style newlines.Eli Bendersky2014-06-066-448/+448
| | | | | | | | | | | A previous patch r210330 (and possibly another) introduced DOS-style newlines into a UNIX newline formatted file. Patch by Mark Heffernan (http://reviews.llvm.org/D4046) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210369 91177308-0d34-0410-b5e6-96231b3b80d8
* MS ABI: Update the thunk linkage computationHans Wennborg2014-06-069-17/+41
| | | | | | | | | | | | | | | | | | | | | | | As suggested by Reid: - class has GVA_Internal linkage -> internal - thunk has return adjustment -> weak_odr, to handle evil corner case [1] - all other normal methods -> linkonce_odr 1. Evil corner case: struct Incomplete; struct A { int a; virtual A *bar(); }; struct B { int b; virtual B *foo(Incomplete); }; struct C : A, B { int c; virtual C *foo(Incomplete); }; C c; Here, the thunk for C::foo() will be emitted when C::foo() is defined, which might be in a different translation unit, so it needs to be weak_odr. Differential Revision: http://reviews.llvm.org/D3992 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210368 91177308-0d34-0410-b5e6-96231b3b80d8
* test/SemaCXX/undefined-internal.cpp: Remove target triple.Hans Wennborg2014-06-061-4/+1
| | | | | | This test seems to run fine in both MS and Itanium C++ ABI mode these days. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210357 91177308-0d34-0410-b5e6-96231b3b80d8
* Defer codegen of inline method definitions to the end of current top level ↵Hans Wennborg2014-06-064-7/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | declaration We would previously fail to emit a definition of bar() for the following code: struct __declspec(dllexport) S { void foo() { t->bar(); } struct T { void bar() {} }; T *t; }; Note that foo() is an exported method, but bar() is not. However, foo() refers to bar() so we need to emit its definition. We would previously fail to realise that bar() is used. By deferring the method definitions until the end of the top level declaration, we can simply call EmitTopLevelDecl on them and rely on the usual mechanisms to decide whether the method should be emitted or not. Differential Revision: http://reviews.llvm.org/D4038 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210356 91177308-0d34-0410-b5e6-96231b3b80d8
* Retain an expression pack expansion when the parameter pack expansion code asksRichard Smith2014-06-062-2/+34
| | | | | | | us to. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210355 91177308-0d34-0410-b5e6-96231b3b80d8
* PR14841: If partial substitution of explicitly-specified template argumentsRichard Smith2014-06-062-0/+23
| | | | | | | | | results in a template having too many arguments, but all the trailing arguments are packs, that's OK if we have a partial pack substitution: the trailing pack expansions may end up empty. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210350 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Implement little-endian semantics for vec_pack familyBill Schmidt2014-06-061-0/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | The PowerPC vector-pack instructions are defined architecturally with a big-endian bias, in that the vector element numbering is assumed to be "left to right" regardless of whether the processor is in big-endian or little-endian mode. This definition is unnatural for little-endian code generation. To facilitate ease of porting, the vec_pack and related interfaces are designed to use natural element ordering, so that elements are numbered according to little-endian design principles when code is generated for a little-endian target. The vec_pack calls are implemented as calls to vec_perm, specifying selection of the odd-numbered vector elements. For little endian, this means the odd-numbered elements counting from the right end of the register. Since the underlying instructions count from the left end, we must instead select the even-numbered vector elements for little endian to achieve the desired semantics. The correctness of this code is tested by the new pack.c test added in a previous patch. I plan to later make the existing ppc32 Altivec compile-time tests work for ppc64 and ppc64le as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210340 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix RecursiveASTVisitor to visit types in ObjCPropertyDeclAlp Toker2014-06-064-5/+25
| | | | | | Patch by Mathieu Baudet! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210339 91177308-0d34-0410-b5e6-96231b3b80d8
* Replacing r210333 with an improved solution; we should never reach this code ↵Aaron Ballman2014-06-061-2/+3
| | | | | | with any other loop hint options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210338 91177308-0d34-0410-b5e6-96231b3b80d8
* [PPC64LE] Implement little-endian semantics for vec_mul[eo]Bill Schmidt2014-06-061-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | The PowerPC vector-multiply-even and vector-multiply-odd instructions are defined architecturally with a big-endian bias, in that the vector element numbering is assumed to be "left to right" regardless of whether the processor is in big-endian or little-endian mode. This definition is unnatural for little-endian code generation. To facilitate ease of porting, the vec_mule and vec_mulo interfacs are designed to use natural element ordering, so that elements are numbered according to little-endian design principles when code is generated for a little-endian target. The desired semantics can be achieved by using the opposite instruction for little-endian mode. That is, when a call to vec_mule appears in the code, a vector-multiply-odd is generated, and when a call to vec_mulo appears in the code, a vector-multiply-even is generated. The correctness of this code is tested by the new mult-even-odd.c test added in a previous patch. I plan to later make the existing ppc32 Altivec compile-time tests work for ppc64 and ppc64le as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210337 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-format: Fix incorrect indentation.Daniel Jasper2014-06-062-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | Before (JavaScript example, but can extend to other languages): return { a: 'E', b: function() { return function() { f(); // This is wrong. }; } }; After: return { a: 'E', b: function() { return function() { f(); // This is better. }; } }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210334 91177308-0d34-0410-b5e6-96231b3b80d8
* Quieting a false-positive which was causing the sanitizer bots to go red.Aaron Ballman2014-06-061-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210333 91177308-0d34-0410-b5e6-96231b3b80d8
* Adding a new #pragma for the vectorize and interleave optimization hints.Aaron Ballman2014-06-0615-93/+986
| | | | | | Patch thanks to Tyler Nowicki! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210330 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typosAlp Toker2014-06-066-12/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210328 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't generate assembly in backend diagnostic testsAlp Toker2014-06-062-3/+3
| | | | | | | | | | | A leftover -S was generating unwanted output in the source tree overriding -only flags that normally disable output. This reverts commit r210323 and implements the proper fix. Reported by Timur Iskhodzhanov! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210326 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix C++ style // comments in a couple of C filesTimur Iskhodzhanov2014-06-062-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210325 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove an unused variableTimur Iskhodzhanov2014-06-061-2/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210324 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -o /dev/null to one of the tests as it fails when run from a read-only ↵Timur Iskhodzhanov2014-06-061-2/+2
| | | | | | checkout git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210323 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Devise a package-private means to determine the LLVM version ↵Alp Toker2014-06-065-5/+15
| | | | | | | | | | | string"" We probably just need to touch LLVM's configure this time to work around the totally inadequate Makefile build server integration. This reverts commit r210314. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210320 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Devise a package-private means to determine the LLVM version string"Alp Toker2014-06-065-15/+5
| | | | | | | | This didn't work out on the build servers. Investigating This reverts commit r210313. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210314 91177308-0d34-0410-b5e6-96231b3b80d8
* Devise a package-private means to determine the LLVM version stringAlp Toker2014-06-065-5/+15
| | | | | | | | | | This will unbreak clang vendor builds as a follow-up to r210238, now that we can't poke into LLVM's private config.h (nor should the string be exposed by llvm-config.h). This hopefully removes for good the last include of LLVM's config.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210313 91177308-0d34-0410-b5e6-96231b3b80d8
* Always check for libxml2 in CMakeAlp Toker2014-06-061-4/+4
| | | | | | | This is clang's business and LLVM will soon be updated not to perform the check for us. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210308 91177308-0d34-0410-b5e6-96231b3b80d8
* Add first set of tests for FriendDecl source range and location.Nikola Smiljanic2014-06-061-0/+78
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210306 91177308-0d34-0410-b5e6-96231b3b80d8
* Rnamed Class to TestClassAlexey Bataev2014-06-061-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210305 91177308-0d34-0410-b5e6-96231b3b80d8
* PR11306 - Variadic template fix-it suggestion. Recover from misplaced or ↵Nikola Smiljanic2014-06-066-22/+74
| | | | | | redundant ellipsis in parameter pack. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210304 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm api change.Rafael Espindola2014-06-062-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210303 91177308-0d34-0410-b5e6-96231b3b80d8
* PR19936: Fix a really dumb bug where we would profile dependent operator* ↵Richard Smith2014-06-052-6/+21
| | | | | | expressions incorrectly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210296 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove old proposal noticesAlp Toker2014-06-052-4/+1
| | | | | | Let's just go ahead and assume the answer was 'I do' git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210295 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide fallback locations for backend remarksAlp Toker2014-06-053-28/+34
| | | | | | | | | | | | Instead of disembodied diagnostics when debug info is disabled it's now possible to identify the associated function's location in order to provide some amount of of context. We use the definition's body right brace location to differentiate the fallback from diagnostics that genuinely relate to the function declaration itself (a convention also used by gcc). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210294 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement -Wframe-larger-than backend diagnosticAlp Toker2014-06-0514-66/+173
| | | | | | | | | | | | | | | | | | Add driver and frontend support for the GCC -Wframe-larger-than=bytes warning. This is the first GCC-compatible backend diagnostic built around LLVM's reporting feature. This commit adds infrastructure to perform reverse lookup from mangled names emitted after LLVM IR generation. We use that to resolve precise locations and originating AST functions, lambdas or block declarations to produce seamless codegen-guided diagnostics. An associated change, StringMap now maintains unique mangled name strings instead of allocating copies. This is a net memory saving in C++ and a small hit for C where we no longer reuse IdentifierInfo storage, pending further optimisation. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210293 91177308-0d34-0410-b5e6-96231b3b80d8
* When an inline-asm diagnostic is reported by the backend, report it with theJoey Gouly2014-06-053-6/+32
| | | | | | | | | correct severity. Previously all inline-asm diagnostics were reported as errors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210286 91177308-0d34-0410-b5e6-96231b3b80d8
* Mangle predefined string constants names to merge them at link-timeAlexey Samsonov2014-06-052-31/+7
| | | | | | | | | | | | | | | | | | | | | Summary: This change generalizes the code used to create global LLVM variables referencing predefined strings (e.g. __FUNCTION__): now it just calls GetAddrOfConstantStringFromLiteral method. As a result, global variables for these predefined strings may get mangled names and linkonce_odr linkage. Fix the test accordingly. Test Plan: clang regression tests Reviewers: majnemer Reviewed By: majnemer Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4023 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210284 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup, and always create a DecltypeType for a decltype expression, ratherRichard Smith2014-06-051-21/+16
| | | | | | | | than omitting it the first time we see a decltype type with a particular expression. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210283 91177308-0d34-0410-b5e6-96231b3b80d8