summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [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-312-1/+4
| | | | | | | | | | | | | | | | | | | 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-304-12/+58
| | | | | | | | | | 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-303-5/+25
| | | | | | | | 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
* clang/CMakeLists.txt: s/LLVM_INSTALL_PACKAGE_DIR/CLANG_INSTALL_PACKAGE_DIR/ ↵NAKAMURA Takumi2015-05-291-1/+1
| | | | | | for the standalone configuration. llvm-svn: 238628
* [Sema] Promote compound assignment exprs. with fp16 LHS and int. RHS.Ahmed Bougacha2015-05-292-1/+145
| | | | | | | | | | | | | | | | | | | | | | | | 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-292-0/+2
| | | | | | 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-2930-111/+99
| | | | | | | | | | | | | | | | | | | | 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
* [CMake] Bug 19462 - Use the INSTALL(EXPORT ...) to export CMake definitionsChris Bieneman2015-05-291-1/+3
| | | | | | | | | | | | | | Summary: This patch moves all the clang library targets into a ClangTargets export list, and installs it using the CMake install(EXPORT...) command. Reviewers: rnk Reviewed By: rnk Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7623 llvm-svn: 238593
* [ARM] Adjust -march checkingJohn Brawn2015-05-292-4/+9
| | | | | | | | | | 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-292-8/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-293-9/+7
| | | | | | | | | | loops. No functional change intended. Patch by Sebastian Edman! llvm-svn: 238547
* Run clang-format on MacroInfo.hDaniel Marjamaki2015-05-291-53/+38
| | | | llvm-svn: 238546
* clang-format: [JS] Support ES6 computed property names.Daniel Jasper2015-05-293-0/+9
| | | | | | | | | | | | | | | | 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-282-2/+16
| | | | | | | | | | | | 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
* Improve user documentation on profiling.Diego Novillo2015-05-281-14/+57
| | | | | | | | This clarifies the relationship between instrumentation and sampling based PGO, code coverage analysis and the different formats supported by sample profiling. llvm-svn: 238504
* [omp] Loosen the driver test enough so that overriding the defaultsChandler Carruth2015-05-281-2/+11
| | | | | | | | | | works well for folks. This isn't terribly clean (sadly) but after chatting with both Eric and Richard, nothing cleaner really emerged. The clean way of doing this is a *lot* of work for extremely little benefit here. llvm-svn: 238500
* [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
* [Format] Skip creating temporary std::strings when filling another string.Benjamin Kramer2015-05-281-6/+6
| | | | | | No functional change intended. llvm-svn: 238466
* [CodeGen] Update a test-case affected by folding IntToPtr/PtrToInt into LoadsDavid Majnemer2015-05-281-7/+10
| | | | | | | | | | | Folding IntToPtr or PtrToInt into Loads, due to r238452, perturbs the mips-varargs test-case. Patch by Philip Pfaffe! Differential Revision: http://reviews.llvm.org/D9153 llvm-svn: 238455
* Get the dll storage class right for structors of classes exported/imported ↵Hans Wennborg2015-05-285-16/+33
| | | | | | | | | via explicit instantiation (PR23667) This is a follow-up to r238266. It turned out structors are codegened through a different path, and didn't get the storage class set in EmitGlobalFunctionDefinition. llvm-svn: 238443
* [ARM] Be less specific about the error message expected.Ranjeet Singh2015-05-281-3/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D10087 llvm-svn: 238436
* [ARMTargetParser] FIXME MachO arch names. NFCRenato Golin2015-05-281-21/+26
| | | | llvm-svn: 238435
* [ARMTargetParser] FIXME on getLLVMArchSuffixForARM. NFCRenato Golin2015-05-281-33/+7
| | | | llvm-svn: 238430
* [ARMTargetParser] Removing string parsing from getCPUDefineSuffix. NFC.Renato Golin2015-05-281-30/+26
| | | | | | Yet another FIXME from ARMTargetParser. llvm-svn: 238416
* Fix PPC failure. Adjust CHECK pattern.Diego Novillo2015-05-281-2/+2
| | | | llvm-svn: 238413
* clang-format: Lower binding strengths created by the [] created by ObjCDaniel Jasper2015-05-283-16/+27
| | | | | | | | | | | | | | | | | | method expressions and array literals. They should not bind stronger than regular parentheses or the braces of braced lists. Specific test case in JavaScript: Before: var aaaaa: List< SomeThing> = [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()]; After: var aaaaa: List<SomeThing> = [ new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB() ]; llvm-svn: 238400
* [Basic] Define __declspec for cygwinDavid Majnemer2015-05-282-5/+19
| | | | | | | | Cygwin (and MinGW) targets define __declspec to __attribute__ unless -fms-extensions is specified. It turns out that cygwin headers rely on the existence of this macro. llvm-svn: 238394
* [omp] Re-work Clang's handling of -fopenmp and undo r237769.Chandler Carruth2015-05-286-58/+128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This isn't an actual revert of r237769, it just restores the behavior of the Clang driver prior to it while completely re-implementing how that behavior works. This also re-does the work of making the default OpenMP runtime selectable at CMake (or configure) time to work in the way all of our other such hooks do (config.h, configure and cmake hooks, etc.). I've re-implemented how we manage the '-fopenmp' flagset in an important way. Now, the "default" hook just makes '-fopenmp' equivalent to '-fopenmp=<default>' rather than a separate special beast. Also, there is an '-fno-openmp' flag which does the obvious thing. Also, the code is shared between all the places to select a known OpenMP runtime and act on it. Finally, and most significantly, I've taught the driver to inspect the selected runtime when choosing whether to propagate the '-fopenmp' flag to the frontend in the CC1 commandline. Without this, it isn't possible to use Clang with libgomp, even if you were happy with the serial, boring way in which it worked previously (ignoring all #pragmas but linking in the library to satisfy direct calls into the runtime). While I'm here, I've gone ahead and sketched out a path for the future name of LLVM's OpenMP runtime (libomp) and the legacy support for its current name (libiomp5) in what seems a more reasonable way. To re-enable LLVM's OpenMP runtime (which I think should wait until the normal getting started instructions are a reasonable way for falks to check out, build, and install Clang with the runtime) all that needs to change is the default string in the CMakeLists.txt and configure.ac file. No code changes necessary. I also added a test for the driver's behavior around OpenMP since it was *completely missing* previously. Makes it unsurprising that we got it wrong. llvm-svn: 238389
* Added doxygen comments for the intrinsics.Ekaterina Romanova2015-05-281-0/+142
| | | | llvm-svn: 238386
* Update -Winvalid-noreturn to handle destructors better.Richard Trieu2015-05-284-3/+176
| | | | | | | | | | When checking if a function is noreturn, consider a codepath to be noreturn if the path destroys a class and the class destructor, base class destructors, or member field destructors are marked noreturn. Differential Revision: http://reviews.llvm.org/D9454 llvm-svn: 238382
* Set function entry counts with -fprofile-instr-use.Diego Novillo2015-05-273-0/+31
| | | | | | This generates function entry counts from instrumentation profiles. llvm-svn: 238360
* It appears these exports are needed, as wmmintrin.h includes them.John Thompson2015-05-271-0/+2
| | | | llvm-svn: 238345
* ARMTargetParser FIXME getCPUProfile A/R/MRenato Golin2015-05-271-10/+15
| | | | | | This is the last of the easy ones. llvm-svn: 238324
* ARMTargetParser FIXME: ARMv8 detection for hdivRenato Golin2015-05-271-11/+9
| | | | | | | | Avoiding ugly combination of string parsing in the front-end. We still need to move away from CPU parsing at all, but that's for a different commit. llvm-svn: 238318
* clang-format: [JS] Fix incorrect detection of ternary expressions.Daniel Jasper2015-05-272-4/+10
| | | | | | | | | | | | | A definintion like this could not be formatted at all: constructor({aa}: { aa?: string, aaaaaaaa?: string, aaaaaaaaaaaaaaa?: boolean, aaaaaa?: List<string> }) { } llvm-svn: 238291
* clang-format: Fix false positive in function annotation detection.Daniel Jasper2015-05-272-1/+3
| | | | llvm-svn: 238285
* clang-cl: Handle dll attributes in explicit class template specialization ↵Hans Wennborg2015-05-275-19/+46
| | | | | | | | | | definitions (PR23667) Previously, we wouldn't call checkDLLAttribute() after the class template specialization definition if the class template was already instantiated by an explicit class template specialization declaration. llvm-svn: 238266
* [MS ABI, DebugInfo] Omit the size for model-less pointers-to-membersDavid Majnemer2015-05-262-5/+17
| | | | | | | | | | | | | | The representation of a pointer-to-member in the MS ABI is governed by the layout of the relevant class or if a model has been explicitly specified. If no model is specified, then an appropriate "worst-case-scenario" model is implicitly chosen if, and only, if the pointer-to-member type's representation was needed. Debug info cannot force a pointer-to-member type to have a representation so do not try to query the size of such a type unless we know it is safe to do so. llvm-svn: 238259
* [CodeGen] Handle flexible array members containing pointers to membersDavid Majnemer2015-05-265-16/+22
| | | | | | | | | | Types can be classified as being zero-initializable or non-zero-initializable. We used to classify array types by giving them the classification of their base element type. However, incomplete array types are never initialized directly and thus are always zero-initializable. llvm-svn: 238256
* [MIPS] Re-land the change r238200 to fix extension of integer typesPetar Jovanovic2015-05-267-8/+66
| | | | | | | | Re-land the change r238200, but with modifications in the tests that should prevent new failures in some environments as reported with the original change on the mailing list. llvm-svn: 238253
* Remove the code in clang that is using TargetOptions::NoFramePointerElim.Akira Hatanaka2015-05-261-9/+0
| | | | | | This is the clang side change following r238244. llvm-svn: 238245
* Fixing an RST issue to silence a sphinx warning.Aaron Ballman2015-05-261-4/+3
| | | | llvm-svn: 238241
* __declspec is not a core Clang language extension. Instead, require ↵Aaron Ballman2015-05-2637-88/+98
| | | | | | | -fms-extensions or -fborland to enable the language extension. Note: __declspec is also temporarily enabled when compiling for a CUDA target because there are implementation details relying on __declspec(property) support currently. When those details change, __declspec should be disabled for CUDA targets. llvm-svn: 238238
OpenPOWER on IntegriCloud