summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Apply clang-tidy's misc-move-constructor-init throughout Clang.Benjamin Kramer2016-05-2718-38/+59
| | | | | | No functionality change intended, maybe a tiny performance improvement. llvm-svn: 270996
* Turn copies into references as suggested by clang-tidy's ↵Benjamin Kramer2016-05-275-6/+6
| | | | | | performance-unnecessary-copy-initialization. llvm-svn: 270994
* [Frontend] StringRefize and fix bad indentation.Benjamin Kramer2016-05-271-22/+22
| | | | | | NFC intended. llvm-svn: 270991
* [mips] Fold MipsTargetInfoBase subclasses into MipsTargetInfoBase and rename ↵Daniel Sanders2016-05-271-317/+209
| | | | | | | | | | | | | | | | | to MipsTargetInfo. NFC Summary: This unifies mips/mipsel and mips64/mips64el into a single class so that we can later support O32 on mips64/mips64el and N32/N64 on mips/mipsel (when an appropriate CPU selected). Reviewers: atanasyan Subscribers: atanasyan, jfb, cfe-commits, dschuff Differential Revision: http://reviews.llvm.org/D20678 llvm-svn: 270984
* clang-format: Allow splitting the line after /**/-comments.Daniel Jasper2016-05-271-1/+3
| | | | | | | While it might change the meaning of the comment in rare circumstances, it is better than violating the column limit. llvm-svn: 270975
* [MSVC2015] Fix mangling for static variables initialization guardsDmitry Polukhin2016-05-271-0/+1
| | | | | | | | | It seems that suffix '@4HA' was omitted for unknown reason. It is non-cont non-volatile 'int' type of normal variable TSS. Differential revision: http://reviews.llvm.org/D20683 llvm-svn: 270974
* [AVX512][Builtin] Fix palignr intrinsic for avx512vlbw. The immediate should ↵Craig Topper2016-05-271-4/+4
| | | | | | | | not be multiplied by 8. The 512-bit version was fixed recently but this was missed. llvm-svn: 270970
* [OPENMP] Fixed processing of '-fopenmp-version=' option and test.Alexey Bataev2016-05-273-22/+23
| | | | llvm-svn: 270962
* [CodeGen] Don't crash when sizeof(long) != 4 for some intrinsDavid Majnemer2016-05-271-6/+9
| | | | | | | | | | _InterlockedIncrement and _InterlockedDecrement have 'long' in their prototypes. We assumed 'long' was the same size as an i32 which is incorrect for other targets. This fixes PR27892. llvm-svn: 270953
* [Intrin.h] Sort the __read[fg]s intrinsicsDavid Majnemer2016-05-271-8/+8
| | | | | | No functional change is intended. llvm-svn: 270952
* Produce better pretty stack traces from crashes in template instantiation: addRichard Smith2016-05-263-6/+17
| | | | | | | | pretty stack trace entries for all cases where we instantiate the definition of something, and include the fully-qualified name with template arguments in the name of the instantiated entity. llvm-svn: 270904
* Re-commit r270748 "clang-cl: Treat dllimport explicit template instantiation ↵Hans Wennborg2016-05-262-2/+38
| | | | | | | | | | definitions as declarations (PR27810, PR27811)" Also make explicit instantiation decls not apply to nested classes when targeting MSVC. That dll attributes are not inherited by inner classes might be the explanation for MSVC's behaviour here. llvm-svn: 270897
* [AMDGPU] Remove individual debugger options + update featuresKonstantin Zhuravlyov2016-05-261-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D20336 llvm-svn: 270895
* [OpenMP] Codegen for target update directive.Samuel Antao2016-05-263-27/+86
| | | | | | | | | | | | Summary: This patch implements the code generation for the `target update` directive. The implemntation relies on the logic already in place for target data standalone directives, i.e. target enter/exit data. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D20650 llvm-svn: 270886
* [OpenMP] Parsing and sema support for the from clauseSamuel Antao2016-05-2610-7/+196
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `from` clause. Patch based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18488 llvm-svn: 270882
* [OpenMP] Parsing and sema support for the to clauseSamuel Antao2016-05-2610-98/+339
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `to` clause. Patch based on the original post by Kelvin Li. Reviewers: carlo.bertolli, hfinkel, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18597 llvm-svn: 270880
* [OpenMP] Parsing and sema support for target update directiveSamuel Antao2016-05-2613-4/+114
| | | | | | | | | | | | | | | Summary: This patch is to add parsing and sema support for `target update` directive. Support for the `to` and `from` clauses will be added by a different patch. This patch also adds support for other clauses that are already implemented upstream and apply to `target update`, e.g. `device` and `if`. This patch is based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D15944 llvm-svn: 270878
* [OpenMP] Add support for the 'private pointer' flag to signal variables ↵Samuel Antao2016-05-261-71/+117
| | | | | | | | | | | | | | captured in target regions and used in first-private clauses. Summary: If a variable is implicitly mapped (doesn't show in a map clause), the runtime library has to be informed if the corresponding capture shows up in first-private clause, so that the storage previously allocated in the device is used. This patch adds the support for that. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D20112 llvm-svn: 270870
* [OpenMP] Adjust map type bits according to latest spec and use zero size ↵Samuel Antao2016-05-261-31/+40
| | | | | | | | | | | | | | array sections for pointers. Summary: This patch changes the bits used to specify the map types according to the latest version of the libomptarget document and add the support for zero size array section when pointers are being implicitly mapped. This completes the missing new 4.5 map semantics. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D20111 llvm-svn: 270868
* Adding missing _mm512_castsi512_si256 intrinsic. Michael Zuckerman2016-05-261-0/+6
| | | | llvm-svn: 270851
* [Analyzer] Correct stack address escape diagnosticSean Eveson2016-05-261-1/+6
| | | | | | | | | | | | | | | | | | Summary: Leaking a stack address via a static variable refers to it in the diagnostic as a 'global'. This patch corrects the diagnostic for static variables. Patch by Phil Camp, SN Systems Reviewers: dcoughlin, zaks.anna Subscribers: xazax.hun, cfe-commits Differential Revision: http://reviews.llvm.org/D19866 Patch by Phil Camp llvm-svn: 270849
* Fix crash while parsing variable template with variadic template argumentsOlivier Goffart2016-05-261-1/+1
| | | | | | | | | | It is only a crash if the compiler optimize for this!=nullptr because LocalInstantiationScope::getPartiallySubstitutedPack checks if 'this' is null (This is crashing when clang is compiled with GCC6) Differential Revision: http://reviews.llvm.org/D20511 llvm-svn: 270845
* [OPENMP] Add option '-fopenmp-version=[31|40|45]' allowing choosingAlexey Bataev2016-05-263-14/+32
| | | | | | | | | | OpenMP version. If '-fopenmp' option is provided '-fopenmp-version=' allows to control, which version of OpenMP must be supported. Currently it affects only the value of _OPENMP define. llvm-svn: 270838
* [MSVC] Support for __unaligned qualifier in functionsAndrey Bokhanko2016-05-265-6/+9
| | | | | | | | | | | | | | | This implements support for MS-specific __unaligned qualifier in functions and makes the following test case both compile and mangle correctly: struct S { void f() __unaligned; }; void S::f() __unaligned { } Differential Revision: http://reviews.llvm.org/D20437 llvm-svn: 270834
* Fix instrinsics names: Michael Zuckerman2016-05-261-4/+4
| | | | | | | | | _mm128_cmp_ps_mask-->_mm_cmp_ps_mask _mm128_mask_cmp_ps_mask-->_mm_mask_cmp_ps_mask _mm128_cmp_pd_mask-->_mm_cmp_pd_mask _mm128_mask_cmp_pd_mask-->_mm_mask_cmp_pd_mask llvm-svn: 270830
* [Clang][AVX512][BUILTIN] Adding intrinsics for set1Michael Zuckerman2016-05-261-0/+24
| | | | | | Differential Revision: http://reviews.llvm.org/D20562 llvm-svn: 270825
* [OPENMP] Set '_OPENMP' macro to '201511' value to reflect support forAlexey Bataev2016-05-261-1/+1
| | | | | | | | OpenMP 4.5. According to OpenMP 4.5 the _OPENMP macro name is defined to have the decimal value yyyymm where yyyy and mm are the year and month designations of the version of the OpenMP API that the implementation supports. Clang supports OpenMP 4.5 so updated value of _OPENMP macro to 201511. llvm-svn: 270822
* [ObjC] Remove _Atomic from return type and parameter type ofAkira Hatanaka2016-05-263-13/+34
| | | | | | | | | | | | | | objective-c properties. This fixes an assert in CodeGen that fires when the getter and setter functions for an objective-c property of type _Atomic(_Bool) are synthesized. rdar://problem/26322972 Differential Revision: http://reviews.llvm.org/D20407 llvm-svn: 270808
* [Sema] Use the failure bits introduced by r270781.George Burgess IV2016-05-251-17/+17
| | | | | | | | | | r270781 introduced the ability to track whether or not we might have had unmodeled side-effects during constant expression evaluation. This patch makes the constexpr evaluator use that tracking. Reviewed as a part of D18540. llvm-svn: 270784
* [Sema] Note when we encounter a problem in ExprConstant.George Burgess IV2016-05-251-33/+106
| | | | | | | | | | | | | | | | | | | | Currently, the constexpr evaluator is very conservative about unmodeled side-effects when we're evaluating an expression in a mode that allows such side-effects. This patch makes us note when we might have actually encountered an unmodeled side-effect, which allows us to be more accurate when we know an unmodeled side-effect couldn't have occurred. This patch has been split into two commits; this one primarily introduces the bits necessary to track whether we might have potentially hit such a side-effect. The one that actually does the tracking (which boils down to more or less a rename of keepEvaluatingAfterFailure to noteFailure) is coming soon. Differential Revision: http://reviews.llvm.org/D18540 llvm-svn: 270781
* Fix rejects-valid on constexpr function that accesses a not-yet-defined 'externRichard Smith2016-05-251-3/+8
| | | | | | | const' variable. That variable might be defined as 'constexpr', so we cannot prove that a use of it could never be a constant expression. llvm-svn: 270774
* Add a loop's debug location to its llvm.loop metadataHal Finkel2016-05-254-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Getting accurate locations for loops is important, because those locations are used by the frontend to generate optimization remarks. Currently, optimization remarks for loops often appear on the wrong line, often the first line of the loop body instead of the loop itself. This is confusing because that line might itself be another loop, or might be somewhere else completely if the body was an inlined function call. This happens because of the way we find the loop's starting location. First, we look for a preheader, and if we find one, and its terminator has a debug location, then we use that. Otherwise, we look for a location on an instruction in the loop header. The fallback heuristic is not bad, but will almost always find the beginning of the body, and not the loop statement itself. The preheader location search often fails because there's often not a preheader, and even when there is a preheader, depending on how it was formed, it sometimes carries the location of some preceeding code. I don't see any good theoretical way to fix this problem. On the other hand, this seems like a straightforward solution: Put the debug location in the loop's llvm.loop metadata. When emitting debug information, this commit causes us to add the debug location as an operand to each loop's llvm.loop metadata. Thus, we now generate this metadata for all loops (not just loops with optimization hints) when we're otherwise generating debug information. The remark test case changes depend on the companion LLVM commit r270771. llvm-svn: 270772
* Revert r270748 "clang-cl: Treat dllimport explicit template instantiation ↵Hans Wennborg2016-05-251-31/+2
| | | | | | | | | definitions as declarations (PR27810, PR27811)" It seems to have broken the sanitizer-windows bot. Reverting while investigating. llvm-svn: 270754
* clang-cl: Treat dllimport explicit template instantiation definitions as ↵Hans Wennborg2016-05-251-2/+31
| | | | | | | | | | | declarations (PR27810, PR27811) This matches what MSVC does, and should make compiles faster by avoiding to unnecessarily emit a lot of code. Differential Revision: http://reviews.llvm.org/D20608 llvm-svn: 270748
* Use new triple API to check comdat /NFCXinliang David Li2016-05-251-1/+1
| | | | llvm-svn: 270728
* [Clang][AVX512][Builtin] Fix palignr intrinsics headerMichael Zuckerman2016-05-251-3/+3
| | | | | | Differential Revision: http://reviews.llvm.org/D20620 llvm-svn: 270707
* Fix mangled name of method with ns_consumed parameters.Nico Weber2016-05-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | When a function/method use a parameter with "ns_consumed" attribute, ensure that the mangled name is the same whether -fobjc-arc is used or not. Since "ns_consumed" attribute is generally used to inform ARC that a function/method does sink the reference, it mean it is usually implemented in a compilation unit compiled without -fobjc-arc but used form a compilation unit compiled with it. Originally found while trying to use "ns_consumed" attribute in an Objective-C++ file in Chromium (http://crbug.com/599980) where it caused a linker error. Regression introduced by revision 262278 (previously the attribute was incorrectly not part of the mangled name). Patch from Sylvain Defresne <sdefresne@chromium.org>! http://reviews.llvm.org/D20113 llvm-svn: 270702
* [Clang][AVX512][BUILTIN] Add missing intrinsics for castMichael Zuckerman2016-05-251-0/+53
| | | | | | Differential Revision: http://reviews.llvm.org/D20523 llvm-svn: 270699
* Fix build problem in MSVCAlexey Bataev2016-05-251-4/+1
| | | | llvm-svn: 270693
* Revert "[AArch64] Using new TargetParser in Clang"Renato Golin2016-05-252-19/+47
| | | | | | | | This reverts commit r270688 and r270689. The issue is not a random order, but a different order for some targets and others (prob. Linux vs Darwin). Reverting until we have a better fix. llvm-svn: 270691
* [OPENMP 4.5] Codegen for dacross loop synchronization constructs.Alexey Bataev2016-05-259-72/+372
| | | | | | | OpenMP 4.5 adds support for doacross loop synchronization. Patch implements codegen for this construct. llvm-svn: 270690
* [AArch64] Using new TargetParser in ClangRenato Golin2016-05-252-47/+19
| | | | | | | | | | Using AArch64TargetParser in clang to avoid repetitive string parsing. Use TargetParser to do ARCH/CPU/ArchExt parsing instead of local implementation. Patch by Jojo Ma. llvm-svn: 270688
* [ms][dll] #26935 Defining a dllimport function should cause it to be exportedDenis Zobnin2016-05-251-17/+35
| | | | | | | | | | | | | | | | | | | If we have some function with dllimport attribute and then we have the function definition in the same module but without dllimport attribute we should add dllexport attribute to this function definition. The same should be done for variables. Example: struct __declspec(dllimport) C3 { ~C3(); }; C3::~C3() {;} // we should export this definition. Patch by Andrew V. Tischenko Differential revision: http://reviews.llvm.org/D18953 llvm-svn: 270686
* Rename a variable to avoid shadowing function parameter. NFC.Bob Wilson2016-05-251-7/+7
| | | | llvm-svn: 270666
* arc-repeated-use-of-weak should not warn about IBOutlet propertiesBob Wilson2016-05-252-1/+7
| | | | | | | | | | | | | | Revision r211132 was supposed to disable -Warc-repeated-use-of-weak for Objective-C properties marked with the IBOutlet attribute. Those properties are supposed to be weak but they are only accessed from the main thread so there is no risk of asynchronous updates setting them to nil. That combination makes -Warc-repeated-use-of-weak very noisy. The previous change only handled one kind of access to weak IBOutlet properties. Instead of trying to add checks for all the different kinds of property accesses, this patch removes the previous special case check and adds a check at the point where the diagnostic is reported. rdar://21366461 llvm-svn: 270665
* clang-cl: Fix unused argument warning when combining /O2 and /Ob2Hans Wennborg2016-05-251-1/+6
| | | | llvm-svn: 270642
* [esan|wset] Add working set tool driver flagsDerek Bruening2016-05-251-0/+2
| | | | | | | | | | | | | | Summary: Adds a new -fsanitize=efficiency-working-set flag to enable esan's working set tool. Adds appropriate tests for the new flag. Reviewers: aizatsky Subscribers: vitalybuka, zhaoqin, kcc, eugenis, llvm-commits Differential Revision: http://reviews.llvm.org/D20484 llvm-svn: 270641
* Make the altivec intrinsics that require immediate constant propagationEric Christopher2016-05-241-20/+12
| | | | | | | | | macros rather than functions. Unfortunately couldn't come up with a simple testcase that didn't need code generation to verify what was going on. llvm-svn: 270625
* [ms] Allow more unqualified lookup of types in dependent base classesReid Kleckner2016-05-242-21/+65
| | | | | | | | | | | | | | | | | | | Summary: In dependent contexts where we know a type name is required, such as a new expression, we can recover by forming a DependentNameType. This generalizes our existing compatibility hack for default arguments for template type parameters. Works towards parsing atlctrlw.h, which is PR26748. Reviewers: avt77, rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20500 llvm-svn: 270615
* clang-cl: Bake /Ob0 and /Ob2 into the general /O option handlingHans Wennborg2016-05-241-1/+13
| | | | | | | This is a follow-up to r270609, wherein I forgot that /O options can be combined, and e.g. /Odb2 is a valid combination. llvm-svn: 270614
OpenPOWER on IntegriCloud