summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Use the appropriate PIE level for OpenBSD/sparc.Brad Smith2015-06-041-1/+1
| | | | llvm-svn: 239028
* [CodeGen][NEON] Emit constants for "immediate" intrinsic arguments.Ahmed Bougacha2015-06-041-3/+38
| | | | | | | | | | | | | | | | | On ARM/AArch64, we currently always use EmitScalarExpr for the immediate builtin arguments, instead of directly emitting the constant. When the overflow sanitizer is enabled, this generates overflow intrinsics instead of constants, breaking assumptions in various places. Instead, use the knowledge of "immediates" to directly emit a constant: - teach the tablegen backend to emit the "immediate" modifiers - use those modifiers in the NEON CodeGen, on ARM and AArch64. Fixes PR23517. Differential Revision: http://reviews.llvm.org/D10045 llvm-svn: 239002
* [analyzer]Test commit fixing 80-column violation in comment. NFC.Devin Coughlin2015-06-041-1/+2
| | | | llvm-svn: 238993
* Save getArch() in a local var instead of calling it 20 times, etc.Douglas Katzman2015-06-041-80/+74
| | | | | | Differential Revision: http://reviews.llvm.org/D10224 llvm-svn: 238992
* Change big 'if' statement into a switch. NFCDouglas Katzman2015-06-031-15/+20
| | | | | | Differential Revision: http://reviews.llvm.org/D10223 llvm-svn: 238955
* clang-format: [JS] Let fat arrows have 'Equality' precedence.Daniel Jasper2015-06-031-13/+15
| | | | | | | | | | | | | | | | | | | | | | | This fixes a regression in literal formatting: Before: aaaaaaaaaaaaa = { aaaaaaaaaaaaaaaaaaaaaaaaaaaa: (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, }; After: var aaaaaaaaaaaaaaaaaaaa = { aaaaaaaaaaaaaaaaaaaaaaaaaaaa: (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) => aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, }; Also apply no-else-after-return policy. llvm-svn: 238942
* Fix misleading comment. NFCDouglas Katzman2015-06-031-1/+1
| | | | llvm-svn: 238938
* Allow replacements created from token ranges to specify language options.Manuel Klimek2015-06-031-7/+10
| | | | | | | | The default language options will lead to incorrect replacements in C++ code, for example when trying to replace nested name specifiers ending in "::". llvm-svn: 238922
* Append CXXDefaultInitExpr's wrapped expression to the CFG when visiting a ↵Enrico Pertoso2015-06-032-0/+14
| | | | | | | | | | | | | | | | | | | constructor initializer Summary: This patch is part of http://llvm-reviews.chandlerc.com/D2181. In-class initializers are appended to the CFG when CFGBuilder::addInitializer is called. Reviewers: jordan_rose, rsmith Reviewed By: jordan_rose Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D2370 llvm-svn: 238913
* clang-format: Properly reset BreakBeforeParameter when wrappingDaniel Jasper2015-06-031-0/+2
| | | | | | | | | | | | | | | | | operators to the new line. Before: LOG_IF(aaa == // bbb) << a << b; After: LOG_IF(aaa == // bbb) << a << b; llvm-svn: 238911
* Fixes a typo in a comment.Enrico Pertoso2015-06-031-1/+1
| | | | llvm-svn: 238910
* clang-format: [JS] More aggressively keep array literals on one line.Daniel Jasper2015-06-031-1/+2
| | | | | | | | | | | | | | Before: var aaaaa: List<SomeThing> = [ new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB() ]; After: var aaaaa: List<SomeThing> = [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()]; llvm-svn: 238909
* clang-format: [JS] Fix bug in type colon detection.Daniel Jasper2015-06-031-1/+2
| | | | | | | | | | | | | Before, this couldn't be formatted at all: class X { subs = { 'b': { 'c': 1, }, }; } llvm-svn: 238907
* Revert "add the -mrecip driver flag and process its options (2nd try)"Rafael Espindola2015-06-033-139/+1
| | | | | | | | This reverts commit r238851. It depends on a llvm commit that was reverted. llvm-svn: 238904
* [Sema] Make the atomic builtins more efficient by reducing volatilityDavid Majnemer2015-06-031-0/+4
| | | | | | | | The parameter types and return type do not need to be volatile just because the pointer type's pointee type is volatile qualified. This is an unnecessary pessimization. llvm-svn: 238892
* [MSVC Compatibility] Permit static_cast from void-ptr to function-ptrDavid Majnemer2015-06-021-0/+8
| | | | | | | | | | | The MSVC 2013 and 2015 implementation of std::atomic is specialized for pointer types. The member functions are implemented using a static_cast from void-ptr to function-ptr which is not allowed in the standard. Permit this conversion if -fms-compatibility is present. This fixes PR23733. llvm-svn: 238877
* clang-format: [JS] Always add space after fat arrow.Daniel Jasper2015-06-021-3/+2
| | | | | | | | | | Before: return () =>[]; After: return () => []; llvm-svn: 238875
* clang-format: [JS] Array literal detection fix #4.Daniel Jasper2015-06-021-1/+2
| | | | llvm-svn: 238873
* [x86-64 ABI] Fix for PR23082: an assertion failure when passing/returning a ↵Andrea Di Biagio2015-06-021-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | wrapper union in a full YMM register. This patch fixes an assertion failure in method 'X86_64ABIInfo::GetByteVectorType'. Method 'GetByteVectorType' (in TargetInfo.cpp) is responsible for mapping a QualType 'Ty' (for an argument or return value) to an LLVM IR type that, according to the ABI, must be passed in a XMM/YMM vector register. When selecting the IR vector type, method 'GetByteVectorType' always tries to choose the "best" IR vector type for the 'Ty' in input. In particular, if Ty is a wrapper structure, it keeps unwrapping it until it finds a vector type VTy. That VTy is the "preferred IR type". However, function 'isSingleElementStructure' (used to unwrap structures) does not know how to look through union types. So, before this patch, if Ty was in a nest of wrapper structures with at least two union types, we would have triggered an assertion failure (added at revision 230971). With this patch, if method 'GetByteVectorType' fails to find the preferred vector type, we just return a valid (although potentially 'less friendly') vector type based on the type size. So, rather than asserting on an 'unexpected' 'Ty' in input, we conservatively return vector type <2 x double> if Ty is 16 bytes, or <4 x double> if Ty is 32 bytes. Differential Revision: http://reviews.llvm.org/D10190 llvm-svn: 238861
* add missing dependency for CodeGen libSanjay Patel2015-06-021-0/+1
| | | | | | This looks to be exposed on some bots by r238851. llvm-svn: 238855
* add the -mrecip driver flag and process its options (2nd try)Sanjay Patel2015-06-023-1/+139
| | | | | | | | | | | | | | | | | | | The first try to land this (r238055) was reverted due to bot failures caused by the LLVM part of the patch. That was hopefully fixed by r238788, and the LLVM patch was resubmitted at r238842. This is the front-end counterpart to D8982. The -mrecip option interface is based on maintaining compatibility with gcc: https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/i386-and-x86-64-Options.html#index-mrecip_003dopt-1627 https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/RS_002f6000-and-PowerPC-Options.html#index-mrecip-2289 ...while adding more functionality (allowing users to specify the number of refinement steps for each estimate type). Differential Revision: http://reviews.llvm.org/D8989 llvm-svn: 238851
* clang-format: Don't try to detect C++ lambdas in other languages.Daniel Jasper2015-06-021-0/+4
| | | | llvm-svn: 238845
* clang-format: [JS] Fix incorrect line length calculation.Daniel Jasper2015-06-021-1/+2
| | | | llvm-svn: 238841
* clang-format: [JS] Array literal detection fix #3.Daniel Jasper2015-06-021-2/+2
| | | | llvm-svn: 238839
* clang-format: [JS] Fix another regression when detecting array literals.Daniel Jasper2015-06-021-1/+2
| | | | llvm-svn: 238835
* clang-format: [JS] Fix regression of detecting array literals.Daniel Jasper2015-06-021-1/+3
| | | | llvm-svn: 238832
* Remove error message when using the fallback style.Manuel Klimek2015-06-021-2/+0
| | | | llvm-svn: 238822
* [Basic] Transition getEnvironmentVersion from getOSVersion for androidDavid Majnemer2015-06-011-1/+1
| | | | | | | 'android' occupies the environment component of the triple. Let's use getEnvironmentVersion to extract it instead of getOSVersion. llvm-svn: 238797
* Replace a few std::string& with StringRef. NFC.Rafael Espindola2015-06-013-6/+5
| | | | | | Patch by Косов Евгений! llvm-svn: 238774
* Fix PR21945: Crash in constant evaluator.Jonathan Roelofs2015-06-011-0/+5
| | | | | | Patch by Косов Евгений! llvm-svn: 238758
* clang-format: [JS] Making arrow function wrapping more consistent.Daniel Jasper2015-06-012-10/+6
| | | | | | | | | | | | | | | | | | | | | | Before: someFunction(() => { doSomething(); // break }) .doSomethingElse( // break ); After: someFunction(() => { doSomething(); // break }) .doSomethingElse( // break ); This is still bad, but at least it is consistent with what we do for other function literals. Added corresponding tests. llvm-svn: 238736
* [MS ABI] Be a little more defensive wrt vector typesDavid Majnemer2015-06-011-14/+20
| | | | | | | | | We probably shouldn't say that all appropriately sized vector types are intel vector types (i.e. __m128, etc.) as they don't exist for all architectures. While this is largely academic, it'd save some debugging if we supported such a platform. llvm-svn: 238731
* [Format] Move UnwrappedLines instead of copying.Benjamin Kramer2015-05-311-7/+4
| | | | | | No functional change intended. llvm-svn: 238673
* clang-format: NFC. Cleanup after r237895.Daniel Jasper2015-05-312-31/+8
| | | | | | | | | | | Specifically adhere to LLVM Coding Standards (no 'else' after return/break/continue) and remove yet another implementation of paren counting. We already have enough of those in the UnwrappedLineParser. No functional changes intended. llvm-svn: 238672
* clang-format: [JS] Fix line breaks in computed property names.Daniel Jasper2015-05-311-1/+1
| | | | | | | | | | | | | | | | | | | Before: let foo = { [someLongKeyHere]: 1, someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3, lastLongKey: 4 }; After: let foo = { [someLongKeyHere]: 1, someOtherLongKeyHere: 2, [keyLongEnoughToWrap]: 3, lastLongKey: 4 }; llvm-svn: 238671
* ubsan: Check for null pointers given to certain builtins, suchNuno Lopes2015-05-303-12/+30
| | | | | | | | | | as memcpy, memset, memmove, and bzero. Reviewed by: Richard Smith Differential Revision: http://reviews.llvm.org/D9673 llvm-svn: 238657
* [CodeGen] Indirect fields can initialize a unionDavid Majnemer2015-05-302-5/+15
| | | | | | | | The first named data member is the field used to default initialize the union. An IndirectFieldDecl can introduce the first named data member of a union. llvm-svn: 238649
* Fix 80-column violations.Eric Christopher2015-05-291-60/+77
| | | | llvm-svn: 238630
* [Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.Ahmed Bougacha2015-05-291-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | We catch most of the various other __fp16 implicit conversions to float, but not this one: __fp16 a; int i; ... a += i; For which we used to generate something 'fun' like: %conv = sitofp i32 %i to float %1 = tail call i16 @llvm.convert.to.fp16.f32(float %conv) %add = add i16 %0, %1 Instead, when we have an __fp16 LHS and an integer RHS, we should use float as the result type. While there, add a bunch of missing tests for mixed __fp16/integer expressions. llvm-svn: 238625
* ARM: fix ACLE predefine for iOS's "-arch armv7s".Tim Northover2015-05-291-0/+1
| | | | | | We were getting "#define __ARM_ARCH_7 -S__ 1" which is really not a good idea. llvm-svn: 238614
* Replace push_back(Constructor(foo)) with emplace_back(foo) for non-trivial typesBenjamin Kramer2015-05-2923-90/+84
| | | | | | | | | | | | | | | | | | | | If the type isn't trivially moveable emplace can skip a potentially expensive move. It also saves a couple of characters. Call sites were found with the ASTMatcher + some semi-automated cleanup. memberCallExpr( argumentCountIs(1), callee(methodDecl(hasName("push_back"))), on(hasType(recordDecl(has(namedDecl(hasName("emplace_back")))))), hasArgument(0, bindTemporaryExpr( hasType(recordDecl(hasNonTrivialDestructor())), has(constructExpr()))), unless(isInTemplateInstantiation())) No functional change intended. llvm-svn: 238601
* [ARM] Adjust -march checkingJohn Brawn2015-05-291-4/+5
| | | | | | | | | | getCanonicalArchName can return an empty string for an architecture that is well-formed but meaningless. Use parseArch to determine if it's actually valid or not. Differential Revision: http://reviews.llvm.org/D10120 llvm-svn: 238553
* Fix assertion on C++ attributes in fillAttributedTypeLocAlexander Musman2015-05-291-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this fixes http://llvm.org/PR17424 fillAttributedTypeLoc() function is only called with AttributeLists of either DeclarationChunk (which is used for each type in a declarator being parsed) or DeclSpec (which captures information about declaration specifiers). As C++11 attributes actually appertain to declarators, they are moved straight to the declarator’s attr list in distributeFunctionTypeAttrFromDeclSpec() function. 'Put them wherever you like' semantics is not supported for C++11 attributes (but is allowed for GNU attributes, for example). So when we meet an attribute while parsing the declaration, we cannot be sure if it appertains to either DeclarationChunk or DeclSpec. This investigation correlates with the history of changes of SemaType.cpp: • Asserts in fillAttributedTypeLoc() were added on 3 Mar 2011 in r126986 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon- 20110228/039638.html); • Distributing C++11 attrs to the declarator was added on 14 Jan 2013 in r172504 (http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon- 20130114/071830.html). Considering all written above I changed asserts in fillAttributedTypeLoc() to nullptr checks. This fixes PR17424 and related assertion on [[gnu::fastcall]] void __stdcall foo(); Author: Alexey Frolov Differential Revision: http://reviews.llvm.org/D9288 llvm-svn: 238550
* Refactor MacroInfo so macro arguments can be iterated with range-based for ↵Daniel Marjamaki2015-05-292-8/+3
| | | | | | | | | | loops. No functional change intended. Patch by Sebastian Edman! llvm-svn: 238547
* clang-format: [JS] Support ES6 computed property names.Daniel Jasper2015-05-292-0/+4
| | | | | | | | | | | | | | | | Before: var x = { [a]: 1, b: 2 }; After: var x = { [a]: 1, b: 2 }; llvm-svn: 238544
* NFC: tab => spacesJingyue Wu2015-05-291-8/+8
| | | | llvm-svn: 238542
* wip: Remove some unused functionsJustin Bogner2015-05-292-39/+0
| | | | llvm-svn: 238538
* Remove dead code.Richard Smith2015-05-281-2/+1
| | | | llvm-svn: 238526
* AST: Fix printing GNU old-style field designatorsJustin Bogner2015-05-281-2/+8
| | | | | | | | | | | | Allows StmtPrinter to print old style field designators in initializers, fixing an issue where we would print the following invalid code: struct A a = {b: = 3, .c = 4}; Patch by Nick Sumner. Thanks! llvm-svn: 238517
* [omp] Fix a typo in a comment and a line I forgot to clang-format thatChandler Carruth2015-05-281-2/+3
| | | | | | Justin pointed out in post-commit review. llvm-svn: 238498
OpenPOWER on IntegriCloud