summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [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
* clang-format: Lower binding strengths created by the [] created by ObjCDaniel Jasper2015-05-281-13/+17
| | | | | | | | | | | | | | | | | | 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-281-5/+9
| | | | | | | | 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-281-53/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-282-3/+24
| | | | | | | | | | 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-271-0/+2
| | | | | | 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-271-4/+3
| | | | | | | | | | | | | 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-271-1/+1
| | | | llvm-svn: 238285
* clang-cl: Handle dll attributes in explicit class template specialization ↵Hans Wennborg2015-05-272-19/+28
| | | | | | | | | | 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-261-3/+5
| | | | | | | | | | | | | | 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-264-16/+14
| | | | | | | | | | 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-263-2/+23
| | | | | | | | 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
* __declspec is not a core Clang language extension. Instead, require ↵Aaron Ballman2015-05-262-0/+9
| | | | | | | -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
* Revert r238200: "[MIPS] fix extension of integer types (function calls)"Hans Wennborg2015-05-263-23/+2
| | | | | | mips-unsigned-ext-var.c and mips-unsigned-extend.c fail in some builds. llvm-svn: 238237
* Change final case of Driver::getToolChain to "if/else/else/else..."Douglas Katzman2015-05-261-20/+11
| | | | | | Differential Revision: http://reviews.llvm.org/D9939 llvm-svn: 238225
* [MIPS] fix extension of integer types (function calls)Petar Jovanovic2015-05-263-2/+23
| | | | | | | | | | On MIPS unsigned int type should not be zero extended but sign-extended. Patch by Strahinja Petrovic. Differential Revision: http://reviews.llvm.org/D9198 llvm-svn: 238200
* clang-format: Guard the bin-packing in braced lists on BinPackArgumentsDaniel Jasper2015-05-262-4/+4
| | | | | | | | instead of BinPackParameters. Braced lists are used as constructor calls in many places and so the bin-packing should follow what is done for other calls and not what is done for function declarations. llvm-svn: 238184
* clang-format: [JS] Support ES6 spread operator.Daniel Jasper2015-05-261-0/+2
| | | | | | | | | | | | | | Specifically, don't add a space before it. Before: someFunction(... a); var x = [1, 2, ... a]; After: someFunction(...a); var x = [1, 2, ...a]; llvm-svn: 238183
* clang-format: Fix child-formatting in macros.Daniel Jasper2015-05-261-4/+8
| | | | | | | | | | | | | | | This fixes a case where the column limit was incorrectly calculated leading to a macro like this: #define A \ [] { \ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx( \ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx); \ } exceeding the column limit. llvm-svn: 238182
* [MS ABI] Implement restrict qualified referencesDavid Majnemer2015-05-261-65/+74
| | | | | | MSVC 2015 supports '__restrict' qualified reference types. llvm-svn: 238166
* This patch adds support for the vector quadword add/sub instructions introducedKit Barton2015-05-251-2/+176
| | | | | | | | | | | | | | | | | | | | | | | in POWER8. These are the Clang-related changes for http://reviews.llvm.org/D9081 vadduqm vaddeuqm vaddcuq vaddecuq vsubuqm vsubeuqm vsubcuq vsubecuq All builtins are added in altivec.h, and guarded with the POWER8_VECTOR and powerpc64 macros. http://reviews.llvm.org/D9903 llvm-svn: 238145
* Bug fix for PR23577 (https://llvm.org/bugs/show_bug.cgi?id=23577#c0).Alexander Musman2015-05-251-14/+28
| | | | | | | | | | | | "1-4" specifiers are returned as numeric constants, not identifiers, and should be treated as such. Currently pragma handler incorrectly assumes that they are returned as identifiers. Patch by Andrey Bokhanko. Differential Revision: http://reviews.llvm.org/D9856 llvm-svn: 238129
* [Driver] Unbreak hexagon build botsDavid Majnemer2015-05-231-1/+1
| | | | | | | | AddHexagonTargetArgs didn't respect the driver flags by unconditionally pushing -fno-signed-char. Instead, add Hexagon handling to isSignedCharDefault. llvm-svn: 238106
* [Driver] Handle -fno-signed-char and -fno-unsigned-charDavid Majnemer2015-05-231-2/+9
| | | | | | | GCC maps -fno-unsigned-char to -fsigned-char and -fno-signed-char to -funsigned-char. llvm-svn: 238105
* [Sema] Don't use dyn_cast to detect an AtomicTypeDavid Majnemer2015-05-231-1/+1
| | | | | | | | | | An AtomicType might be hidden behind arbitrary levels of typedefs. getAs<> will reliably walk through the sugar to get the underlying AtomicType. This fixes PR23638. llvm-svn: 238083
* This reverts commit r238064 and r238055.Rafael Espindola2015-05-233-139/+1
| | | | | | They depend on a reverted llvm commit. llvm-svn: 238076
* add missing include for TargetRecipSanjay Patel2015-05-221-0/+1
| | | | llvm-svn: 238064
* CodeGen: Avoid a reserved name and fix the naming style of some arguments. NFCJustin Bogner2015-05-221-8/+8
| | | | | | | It's undefined to use reserved names like _Diags. Fix up the other parameter names to consistently use a modern style while I'm here. llvm-svn: 238058
* add the -mrecip driver flag and process its optionsSanjay Patel2015-05-223-1/+138
| | | | | | | | | | | | | | | This is the front-end counterpart to D8982 (LLVM r238051). 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: 238055
* Make unique section names the default again.Rafael Espindola2015-05-221-6/+3
| | | | | | | | | | Using non unique names found a bug in the ICF inplementation in gold: https://sourceware.org/bugzilla/show_bug.cgi?id=18440 This reverts commit r234143. llvm-svn: 238048
* Use profile and version parsers from ARMTargetParserRenato Golin2015-05-221-32/+5
| | | | | | | Now that ARMTargetParser can parse profile and version numbers, use them instead of the local implementation. llvm-svn: 238037
* [OPENMP] Prepare codegen for privates in tasks for non-capturing of privates ↵Alexey Bataev2015-05-223-62/+211
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in CapturedStmt. Reworked codegen for privates in tasks: call @kmpc_omp_task_alloc(); ... call @kmpc_omp_task(task_proxy); void map_privates(.privates_rec. *privs, type1 ** priv1_ref, ..., typen **privn_ref) { *priv1_ref = &privs->private1; ... *privn_ref = &privs->privaten; ret void } i32 task_entry(i32 ThreadId, i32 PartId, void* privs, void (void*, ...) map_privates, shareds* captures) { type1 **priv1; ... typen **privn; call map_privates(privs, priv1, ..., privn); <Task body with priv1, .., privn instead of the captured variables>. ret i32 } i32 task_proxy(i32 ThreadId, kmp_task_t_with_privates *tt) { call task_entry(ThreadId, tt->task_data.PartId, &tt->privates, map_privates, tt->task_data.shareds); } llvm-svn: 238010
* Modernize some doc comments. NFCJustin Bogner2015-05-221-13/+12
| | | | llvm-svn: 238006
* [ItaniumMangle] Fix a typo.David Majnemer2015-05-221-1/+1
| | | | llvm-svn: 238002
* [Sema] Don't crash on out-of-line virtual constexpr functionsDavid Majnemer2015-05-221-1/+2
| | | | | | | | | | The method wasn't an overrider but didn't have 'virtual' textually written because our CXXMethodDecl was an out-of-line definition. Make sure we use the canonical decl instead. This fixes PR23629. llvm-svn: 237999
* [CodeGen] Use TargetInfo::getABI() throughout X86*TargetCodeGenInfo.Ahmed Bougacha2015-05-221-22/+21
| | | | | | | | | We already have the ABI, we don't need a "HasAVX" flag. This will also makes it easier to add an AVX512 ABI. No functional change intended. llvm-svn: 237989
* Fix assertion when assigning to object in OpenCL constant address space.Richard Smith2015-05-222-1/+5
| | | | | | Patch by John Garvin! llvm-svn: 237983
* "This adds -fconcepts-ts as a cc1 option for enabling theFaisal Vali2015-05-222-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | in-progress implementation of the Concepts TS. The recommended feature test macro __cpp_experimental_concepts is set to 1 (as opposed to 201501) to indicate that the feature is enabled, but the implementation is incomplete. The link to the Concepts TS in cxx_status is updated to refer to the PDTS (N4377). Additional changes related to __has_feature and __has_extension are to follow in a later change. Relevant tests include: test/Lexer/cxx-features.cpp The test file is updated with testing of the C++14 + Concepts TS mode. The expected behaviour is the same as that of the C++14 modes except for the case of __cpp_experimental_concepts." - Hubert Tong. Being committed for Hubert (as per his understanding with Richard Smith) as we start work on the concepts-ts following our preliminary strategy session earlier today. The patch is tiny and seems quite standard. Thanks Hubert! llvm-svn: 237982
* Debug info: Adapt to new DIBuilder interface.Adrian Prantl2015-05-211-0/+1
| | | | llvm-svn: 237948
* Itanium mangler: don't trip an assertion when unresolved members have ↵Douglas Gregor2015-05-211-5/+6
| | | | | | | | | | | | implicit bases. When we find a member of the current instantation, the base of the unresolved member expression is implicit; use nullptr for such bases. This is not a change in behavior: the AST already contains null in such cases, so non-asserts builds do the right thing already. Fixes rdar://problem/21020559. llvm-svn: 237929
* clang-format: [JS] Better support for fat arrows.Manuel Klimek2015-05-214-18/+70
| | | | | | | | | | | | Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to more easily recognize and format fat arrow functions. Improves function parsing to better recognize formal parameter lists and return type declarations. Recognizes arrow functions and parse function bodies as child blocks. Patch by Martin Probst. llvm-svn: 237895
* [ARM] Restructure cpu handling in the driver to mostly use the tripleJohn Brawn2015-05-211-44/+92
| | | | | | | | | | | | | | | | | | Using the target cpu to determine some behaviour is sprinkled in several places in the driver, but in almost all the information that is needed can be found in the triple. Restructure things so that the triple is used, and the cpu is only used if the exact cpu name is needed. Also add a check that the -mcpu argument is valid, and correct the -march argument checking so that it handles -march=native correctly. I would have liked to move these checks into the computation of the triple, but the triple is calculated several times in several places and that would lead to multiple error messages for the same thing. Differential Revision: http://reviews.llvm.org/D9879 llvm-svn: 237894
* [OPENMP] Fixed codegen for parameters privatization.Alexey Bataev2015-05-213-54/+3
| | | | | | For parameters we shall take a derived type of parameters, not the original one. llvm-svn: 237882
OpenPOWER on IntegriCloud