summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Lex: Check whether the header map buffer has space for the bucketsDuncan P. N. Exon Smith2016-02-201-10/+10
| | | | | | | | | | | | | Check up front whether the header map buffer has space for all of its declared buckets. There was already a check in `getBucket()`, but it had UB (comparing pointers that were outside of objects in the error path) and was insufficient (only checking for a single byte of the relevant bucket). I fixed the check, moved it to `checkHeader()`, and left a fixed version behind as an assertion. llvm-svn: 261449
* Lex: Check buckets on header map constructionDuncan P. N. Exon Smith2016-02-201-4/+12
| | | | | | | | If the number of buckets is not a power of two, immediately recognize the header map as corrupt, rather than waiting for the first lookup. I converted the later check to an assert. llvm-svn: 261448
* Lex: Add some unit tests for corrupt header mapsDuncan P. N. Exon Smith2016-02-201-48/+28
| | | | | | | | | | | | Split the implementation of `HeaderMap` into `HeaderMapImpl` so that we can write unit tests that don't depend on the `FileManager`, and then write a few tests that cover the types of corrupt header maps already detected. This also moves type and constant definitions from HeaderMap.cpp to HeaderMapTypes.h so that the test can access them. llvm-svn: 261446
* [MSVC Compat] Implement -EHc semanticsDavid Majnemer2016-02-203-3/+11
| | | | | | | The -EHc flag implicitly adds a nothrow attribute to any extern "C" function when exceptions are enabled. llvm-svn: 261425
* [MSVC Compat] Add support for /GX, /GX-David Majnemer2016-02-201-5/+12
| | | | | | These are legacy flags which map to /EHsc and /EHs-c- respectively. llvm-svn: 261424
* Fix handling of vaargs on PPC32 when going from regsave to overflow.Roman Divacky2016-02-201-1/+4
| | | | | | | | | | | | It can happen that when we only have 1 more register left in the regsave area we need to store a value bigger than 1 register and therefore we go to the overflow area. In this case we have to leave the last slot in the regsave area unused and keep using overflow area. Do this by storing a limit value to the used register counter in the overflow block. Issue diagnosed by and solution tested by Mark Millard! llvm-svn: 261422
* [OPENMP 4.5] Initial support for data members in 'lastprivate' clause.Alexey Bataev2016-02-201-61/+46
| | | | | | | | OpenMP 4.5 allows to privatize non-static data members of current class in non-static member functions. Patch adds initial support for data members. llvm-svn: 261412
* Remove a duplicate declaration specifier from _ReadBarrierDavid Majnemer2016-02-201-1/+0
| | | | | | This fixes PR26675. llvm-svn: 261388
* [modules] Do less scanning of macro definition chains when computing the set ofRichard Smith2016-02-191-5/+20
| | | | | | | exported module macros outside local submodule visibility mode. Related to PR24667. llvm-svn: 261373
* [modules] Flatten -fmodule-name= and -fmodule-implementation-of= into a singleRichard Smith2016-02-1912-71/+50
| | | | | | | | | | | | option. Previously these options could both be used to specify that you were compiling the implementation file of a module, with a different set of minor bugs in each case. This change removes -fmodule-implementation-of, and instead tracks a flag to determine whether we're currently building a module. -fmodule-name now behaves the same way that -fmodule-implementation-of previously did. llvm-svn: 261372
* [OpenCL] Generate metadata for opencl_unroll_hint attributeAnastasia Stulova2016-02-194-10/+97
| | | | | | | | | | | | | | | Add support for opencl_unroll_hint attribute from OpenCL v2.0 s6.11.5. Reusing most of metadata generation from CGLoopInfo helper class. The code is based on Khronos OpenCL compiler: https://github.com/KhronosGroup/SPIR/tree/spirv-1.0 Patch by Liu Yaxun (Sam)! Differential Revision: http://reviews.llvm.org/D16686 llvm-svn: 261350
* Removed unused local variableSerge Pavlov2016-02-191-3/+0
| | | | llvm-svn: 261323
* pr26544: Bitfield layout with pragma pack and attributes "packed" andAlexey Bataev2016-02-191-2/+9
| | | | | | | | | | "aligned", by Vladimir Yakovlev Fix clang/gcc incompatibility of bitfields layout in the presence of pragma packed and attributes aligned and packed. Differential Revision: http://reviews.llvm.org/D17023 llvm-svn: 261321
* [OPENMP] Improved layout of CGOpenMPRuntime class, NFC.Alexey Bataev2016-02-192-258/+252
| | | | llvm-svn: 261315
* Correct typos after acting on invalid subscript expressionsDavid Majnemer2016-02-191-2/+8
| | | | llvm-svn: 261312
* ARM: fix VFP asm constraintsJF Bastien2016-02-191-2/+2
| | | | | | | | | | | | | | | Summary: Rich Felker was sad that clang used 'w' and 'P' for VFP constraints when GCC documents them as 't' and 'w': https://gcc.gnu.org/onlinedocs/gcc/Machine-Constraints.html This was added way back in 2008: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20080421/005393.html Subscribers: aemerson, rengolin, cfe-commits Differential Revision: http://reviews.llvm.org/D17349 llvm-svn: 261309
* Fix SemaTemplate/instantiate-field.cpp after r261297.Nico Weber2016-02-191-1/+1
| | | | | | | | | | | | | | For templates, fields can have incomplete types: template <class T> struct A2 { struct B; B b; }; Don't try to touch the DefinitionData of those fields. llvm-svn: 261301
* Implement the likely resolution of core issue 253.Nico Weber2016-02-195-34/+52
| | | | | | | | | | | | | | | | | | C++11 requires const objects to have a user-provided constructor, even for classes without any fields. DR 253 relaxes this to say "If the implicit default constructor initializes all subobjects, no initializer should be required." clang is currently the only compiler that implements this C++11 rule, and e.g. libstdc++ relies on something like DR 253 to compile in newer versions. This change makes it possible to build code that says `const vector<int> v;' again when using libstdc++5.2 and _GLIBCXX_DEBUG (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60284). Fixes PR23381. http://reviews.llvm.org/D16552 llvm-svn: 261297
* [analyzer] Add checker callback for beginning of function.Devin Coughlin2016-02-196-14/+90
| | | | | | | | | | Add a checker callback that is called when the analyzer starts analyzing a function either at the top level or when inlined. This will be used by a follow-on patch making the DeallocChecker path sensitive. Differential Revision: http://reviews.llvm.org/D17418 llvm-svn: 261293
* [Sema] PR25181 Fix crash when method declaration with throw spec fails to ↵Reid Kleckner2016-02-191-1/+2
| | | | | | | | | | | | | | | parse correctly Fixes crash referenced in PR25181 where dyn_cast is called on a null instance of LM.Method. Reviewers: majnemer, rnk Patch by Don Hinton Differential Revision: http://reviews.llvm.org/D17072 llvm-svn: 261292
* Fix my typo from r261278Richard Trieu2016-02-191-1/+1
| | | | llvm-svn: 261285
* Add -Wcomma warning to Clang.Richard Trieu2016-02-182-0/+92
| | | | | | | | | | | -Wcomma will detect and warn on most uses of the builtin comma operator. It currently whitelists the first and third statements of the for-loop. For other cases, the warning can be silenced by casting the first operand of the comma operator to void. Differential Revision: http://reviews.llvm.org/D3976 llvm-svn: 261278
* [ASTImporter] Implement missing VisitAccessSpecDecl function in ASTImporter ↵Argyrios Kyrtzidis2016-02-181-0/+26
| | | | | | | | class. Patch by Elisavet Sakellari! llvm-svn: 261274
* Remove use of builtin comma operator.Richard Trieu2016-02-1813-40/+114
| | | | | | Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261271
* [Sema] Fix bug in TypeLocBuilder::pushImplAkira Hatanaka2016-02-181-4/+32
| | | | | | | | | | | | | | The code in TypeLocBuilder::pushImpl wasn't correctly handling the case where an element that has an 8-byte alignment was being pushed. I plan to follow up with a patch to remove redundancies and simplify the function. rdar://problem/23838912 Differential Revision: http://reviews.llvm.org/D16843 llvm-svn: 261260
* [analyzer] Include comment mistakenly left out of r261243. NFC.Devin Coughlin2016-02-181-0/+8
| | | | | | It explains why we can't just synthesize bodies of setters in BodyFarm. llvm-svn: 261248
* Make deprecation message for -fsanitize-coverage= with numeric argument ↵Nico Weber2016-02-181-3/+11
| | | | | | | | friendlier. http://reviews.llvm.org/D17397 llvm-svn: 261247
* [analyzer] Improve modeling of ObjC synthesized property setters.Devin Coughlin2016-02-181-9/+54
| | | | | | | | | | | | | When modeling a call to a setter for a property that is synthesized to be backed by an instance variable, don't invalidate the entire instance but rather only the storage for the updated instance variable itself. This still doesn't model the effect of the setter completely. It doesn't bind the set value to the ivar storage location because doing so would cause the set value to escape, removing valuable diagnostics about potential leaks of the value from the retain count checker. llvm-svn: 261243
* Avoid double deletion in Clang driver.Serge Pavlov2016-02-181-21/+8
| | | | | | | | | | | | | | | | Llvm module object is shared between CodeGenerator and BackendConsumer, in both classes it is stored as std::unique_ptr, which is not a good design solution and can cause double deletion error. Usually it does not occur because in BackendConsumer::HandleTranslationUnit the ownership of CodeGenerator over the module is taken away. If however this method is not called, the module is deleted twice and compiler crashes. As the module owned by BackendConsumer is always the same as CodeGenerator has, pointer to llvm module can be removed from BackendGenerator. Differential Revision: http://reviews.llvm.org/D15450 llvm-svn: 261222
* Add an AST matcher for real floating-point types. e.g., float, double, long ↵Aaron Ballman2016-02-181-0/+1
| | | | | | double, but not complex. llvm-svn: 261221
* [Parse] Code complete expressions in bracket declarators.Benjamin Kramer2016-02-182-0/+7
| | | | | | | | | | Currently we return no results when completing inside of the brackets in a 'char foo[]' declaration. Let the generic expression completion code handle it instead. We could get fancier here (e.g. filter non-constant expressions in contexts where VLAs are not allowed), but it's a strict improvement over the existing version. llvm-svn: 261217
* [OPENMP] Fix codegen for lastprivate loop counters.Alexey Bataev2016-02-181-60/+33
| | | | | | | Patch fixes bug with codegen for lastprivate loop counters. Also it may improve performance for lastprivates calculations in some cases. llvm-svn: 261209
* [CLANG] [AVX512] [BUILTIN] Adding pmovsx{b|d|w}{w|d|q}{128|256|512} builtin ↵Michael Zuckerman2016-02-184-0/+362
| | | | | | | | to clang Differential Revision: http://reviews.llvm.org/D16955 llvm-svn: 261196
* [MSVC] Turn C++ EH on my defaultDavid Majnemer2016-02-181-5/+3
| | | | | | | | | Our support for C++ EH is sufficiently good that it makes sense to enable support for it out of the box. While we are here, update the MSVCCompatibility doc. llvm-svn: 261195
* Sema: provide an extension warning for enable_ifSaleem Abdulrasool2016-02-181-0/+2
| | | | | | | Clang implements an enable_if attribute as an extension. Hook up `-Wpedantic` to issue an extension usage warning when __enable_if__ is used. llvm-svn: 261192
* [Parse] Make sure we don't forget to diagnose typos in exprsDavid Majnemer2016-02-181-3/+7
| | | | | | | If ActOn*Op fails, we will forget to diagnose typos in the LHS of expressions. llvm-svn: 261191
* [sanitizer-coverage] allow -fsanitize-coverage=trace-pc w/o any other ↵Kostya Serebryany2016-02-181-51/+55
| | | | | | sanitizer and w/o ...=[func,bb,edge]. This makes this syntax a superset of the GCC's syntax llvm-svn: 261182
* [sanitizer-coverage] add a deprecation warning for -fsanitize-coverage=[1234]Kostya Serebryany2016-02-171-0/+2
| | | | llvm-svn: 261178
* Don't crash w/ a diagnostic range containing a null byteDavid Majnemer2016-02-171-3/+11
| | | | | | | | We prematurely ended the line at the null byte which caused us to crash down stream because we tried to reason about columns beyond the end of the line. llvm-svn: 261171
* Add 'nopartial' qualifier for availability attributes.Manman Ren2016-02-176-13/+66
| | | | | | | | | | | | | | | | | | | | | | An optional nopartial can be placed after the platform name. int bar() __attribute__((availability(macosx,nopartial,introduced=10.12)) When deploying back to a platform version prior to when the declaration was introduced, with 'nopartial', Clang emits an error specifying that the function is not introduced yet; without 'nopartial', the behavior stays the same: the declaration is `weakly linked`. A member is added to the end of AttributeList to save the location of the 'nopartial' keyword. A bool member is added to AvailabilityAttr. The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as we handle unavailable cases. Reviewed by Doug Gregor and Jordan Rose. rdar://23791325 llvm-svn: 261163
* [modules] Cache 'acceptable decl' lookups for namespaces. In projects withRichard Smith2016-02-172-0/+24
| | | | | | | | | | | | | | | | thousands of modules, each of which declares the same namespace, linearly scanning the redecl chain looking for a visible declaration (once for each leaf module, for each use) performs very poorly. Namespace visibility can only decrease when we leave a module during a module build step, and we never care *which* visible declaration of a namespace we find, so we can cache this very effectively. This results in a 35x speedup on one of our internal build steps (2m -> 3.5s), but is hard to unit test because it requires a very large number of modules. Ideas for a test appreciated! No functionality change intended other than the speedup. llvm-svn: 261161
* [sanitizer-coverage] implement -fsanitize-coverage=trace-pc. This is similar ↵Kostya Serebryany2016-02-173-1/+11
| | | | | | to trace-bb, but has a different API. We already use the equivalent flag in GCC for Linux kernel fuzzing. We may be able to use this flag with AFL too llvm-svn: 261159
* [CodeGen] Fix an assert in CodeGenFunction::EmitFunctionEpilogAkira Hatanaka2016-02-171-1/+19
| | | | | | | | | | | | | | The assert is triggered because isObjCRetainableType() is called on the canonicalized return type that has been stripped of the typedefs and attributes attached to it. To fix this assert, this commit gets the original return type from CurCodeDecl or BlockInfo and uses it instead of the canoicalized type. rdar://problem/24470031 Differential Revision: http://reviews.llvm.org/D16914 llvm-svn: 261151
* Enable SafeStack for CloudABI.Ed Schouten2016-02-172-0/+8
| | | | | | | | | | | | | | | | | Summary: I've got a patchset in my home directory to integrate support for SafeStack into CloudABI's C library. All of the CloudABI unit tests still seem to pass. Pretty sweet! This change adds the necessary changes to Clang to make -fsanitize=safe-stack work on CloudABI. Without it, passing this command line flag throws an error. Reviewers: eugenis, samsonov Differential Revision: http://reviews.llvm.org/D17243 llvm-svn: 261135
* Correct more typos in conditional expressionsDavid Majnemer2016-02-172-3/+20
| | | | | | | We didn't correctly handle some edge cases, causing us to bail out before correcting all the typos. llvm-svn: 261109
* [OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.Alexey Bataev2016-02-176-15/+24
| | | | | | Added codegen for captured data members in non-static member functions. llvm-svn: 261089
* [OpenCL] Added half type literal with suffix h.Anastasia Stulova2016-02-172-3/+20
| | | | | | | | | | | | | OpenCL Extension v1.2 s9.5 allows half precision floating point type literals with suffices h or H when cl_khr_fp16 is enabled. Example: half x = 1.0h; Patch by Liu Yaxun (Sam)! Differential Revision: http://reviews.llvm.org/D16865 llvm-svn: 261084
* [OPENMP] Fix handling loop-based directives with arrays.Alexey Bataev2016-02-171-68/+106
| | | | | | | Patch fixes possible problems with correct handling arrays as expressions in initialization, conditions etc in loop-based constructs. llvm-svn: 261080
* Teach clang to use the ThinLTO pipelineMehdi Amini2016-02-171-1/+2
| | | | | | | | | | | | | Summary: Use the new pipeline implemented in D17115 Reviewers: tejohnson Subscribers: joker.eph, cfe-commits Differential Revision: http://reviews.llvm.org/D17272 From: Mehdi Amini <mehdi.amini@apple.com> llvm-svn: 261045
* Improve diagnostics for ill-formed literal operator declarations.Richard Smith2016-02-171-86/+144
| | | | | | Patch by Erik Pilkington! llvm-svn: 261034
OpenPOWER on IntegriCloud