summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Sort ObjCProtocolDecls with array_pod_sort.Benjamin Kramer2015-03-141-5/+5
| | | | | | The predicate is essentially a string comparison. NFC. llvm-svn: 232264
* [analyzer] Sort path diagnostics with array_pod_sort.Benjamin Kramer2015-03-141-5/+9
| | | | | | | | | | | | | | | They're expensive to compare and we won't sort many of them so std::sort doesn't give any benefits and causes code bloat. Func fact: clang -O3 didn't even bother to inline libc++'s std::sort here. While there validate the predicate a bit harder, the sort is unstable and we don't want to introduce any non-determinism. I had to spell out the function pointer type because GCC 4.7 still fails to convert the lambda to a function pointer :( No intended functionality change. llvm-svn: 232263
* MS ABI: Mangle virtual member pointer thunks with the correct CCDavid Majnemer2015-03-143-4/+23
| | | | | | | | | | Virtual member pointers are implemented using a thunk. We assumed that the calling convention for this thunk was always __thiscall for 32-bit targets and __cdecl for 64-bit targets. However, this is not the case. Mangle in whichever calling convention is appropriate for this member function thunk. llvm-svn: 232254
* [modules] Teach the AST reader to handle the case of importing a moduleChandler Carruth2015-03-147-61/+141
| | | | | | | | | | | | | | | | | | | with a subset of the existing target CPU features or mismatched CPU names. While we can't check that the CPU name used to build the module will end up being able to codegen correctly for the translation unit, we actually check that the imported features are a subset of the existing features. While here, rewrite the code to use std::set_difference and have it diagnose all of the differences found. Test case added which walks the set relationships and ensures we diagnose all the right cases and accept the others. No functional change for implicit modules here, just better diagnostics. llvm-svn: 232248
* Implement bad cast checks using control flow integrity information.Peter Collingbourne2015-03-1410-6/+300
| | | | | | | | | | | This scheme checks that pointer and lvalue casts are made to an object of the correct dynamic type; that is, the dynamic type of the object must be a derived class of the pointee type of the cast. The checks are currently only introduced where the class being casted to is a polymorphic class. Differential Revision: http://reviews.llvm.org/D8312 llvm-svn: 232241
* Add a bunch of missing "CHECK" colons in tests. NFC.Ahmed Bougacha2015-03-148-14/+16
| | | | llvm-svn: 232237
* MS ABI: Generate default constructor closuresDavid Majnemer2015-03-136-27/+103
| | | | | | | | | | | | | | | | | | | | The MS ABI utilizes a compiler generated function called the "vector constructor iterator" to construct arrays of objects with non-trivial constructors/destructors. For this to work, the constructor must follow a specific calling convention. A thunk must be created if the default constructor has default arguments, is variadic or is otherwise incompatible. This thunk is called the default constructor closure. N.B. Default constructor closures are only generated if the default constructor is exported because clang itself does not utilize vector constructor iterators. Failing to export the default constructor closure will result in link/load failure if a translation unit compiled with MSVC is on the import side. Differential Revision: http://reviews.llvm.org/D8331 llvm-svn: 232229
* Make tests more robust. No functional change.Robert Lougher2015-03-132-10/+10
| | | | | | | In preparation for recommit of revision 232190, change tests so that they are resilient to operands being commuted by the reassociate pass. llvm-svn: 232206
* MS ABI: Implement __GetExceptionInfo for std::make_exception_ptrDavid Majnemer2015-03-1310-50/+92
| | | | | | | | | std::make_exception_ptr calls std::__GetExceptionInfo in order to figure out how to properly copy the exception object. Differential Revision: http://reviews.llvm.org/D8280 llvm-svn: 232188
* Test case updates for explicit type parameter to the gep operatorDavid Blaikie2015-03-1384-581/+581
| | | | llvm-svn: 232187
* Update test case to make it easier to automatically port to typeless pointer ↵David Blaikie2015-03-131-2/+2
| | | | | | gep operator changes coming soon llvm-svn: 232185
* Sema: Replace the SetVector/DenseMap/std::sort combination with a simple ↵Benjamin Kramer2015-03-132-33/+36
| | | | | | | | | | | | std::map This guarantees the order and doesn't increase malloc counts a lot as there are typically very few elements int the map. Provide a little iterator adapter to keep the same interface as we had with the flat sorted list. No functional change intended. llvm-svn: 232173
* When building a module, all headers of submodules can be used.Daniel Jasper2015-03-132-1/+11
| | | | | | This extends r232159. llvm-svn: 232168
* clang-format: Don't corrupt macros with open braces.Daniel Jasper2015-03-132-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | Formatting: #define A { { #define B } } Before: #define A \ { \ { #define B } \ } After: #define A \ { \ { #define B \ } \ } This fixes llvm.org/PR22884. llvm-svn: 232166
* [OPENMP] Additional sema analysis for 'omp atomic[ update]'.Alexey Bataev2015-03-139-74/+616
| | | | | | Adds additional semantic analysis + generation of helper expressions for proper codegen. llvm-svn: 232164
* Make a module "use" also count as use of all its submodulesDaniel Jasper2015-03-134-4/+18
| | | | llvm-svn: 232159
* [OPENMP] Re-factor __kmpc_for_static_init_* routine generation.Alexander Musman2015-03-132-93/+32
| | | | llvm-svn: 232154
* [Modules] Teach Clang to survive ambiguous macros which come from systemChandler Carruth2015-03-1313-7/+247
| | | | | | | | | | | | | | | | | | | | | headers even if they arrived when merging non-system modules. The idea of this code is that we don't want to warn the user about macros defined multiple times by their system headers with slightly different definitions. We should have this behavior if either the macro comes from a system module, or the definition within the module comes from a system header. Previously, we would warn on ambiguous macros being merged when they came from a users modules even though they only showed up via system headers. By surviving this we can handle common system header macro differences like differing 'const' qualification of pointers due to some headers predating 'const' being valid in C code, even when those systems headers are pre-built into a system module. Differential Revision: http://reviews.llvm.org/D8310 llvm-svn: 232149
* [libclang] Fix crash when code-completing inside constructor initializer for ↵Argyrios Kyrtzidis2015-03-132-1/+21
| | | | | | | | a builtin type. rdar://20149746 llvm-svn: 232145
* [libclang] During member ref expression visitation, ignore base anonymous ↵Argyrios Kyrtzidis2015-03-133-3/+44
| | | | | | | | | | struct/union fields. Otherwise they will shadow the real field that that we are interested in. rdar://19783938 llvm-svn: 232141
* Deduplicate #undef directives imported from multiple modules.Richard Smith2015-03-133-5/+20
| | | | | | | No functionality change, but deeply-importing module files are smaller and faster now. llvm-svn: 232140
* Simplify.Joerg Sonnenberger2015-03-131-9/+1
| | | | llvm-svn: 232130
* [CMake] Add clangBasic in ASTMatchersTests, according to r232051.NAKAMURA Takumi2015-03-121-0/+1
| | | | | | Jan Vesely noticed it. See also r232055. llvm-svn: 232123
* Disambiguate call for GCC.Benjamin Kramer2015-03-122-2/+2
| | | | llvm-svn: 232122
* CodeGen: Base the conditional cleanup machinery on variadic templatesBenjamin Kramer2015-03-122-139/+34
| | | | | | | | | | | This is complicated by the fact that we can't simply use side-effecting calls in an argument list without losing all guarantees about the order they're emitted. To keep things deterministic we use tuples and brace initialization, which thankfully guarantees evaluation order. No functionality change intended. llvm-svn: 232121
* clang-format: [OBJC] Don't indent 8 spaces in method declarations.Daniel Jasper2015-03-122-7/+5
| | | | | | | | | | | | Before: - (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: (SoooooooooooooooooooooomeType *)bbbbbbbbbb; After: - (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa: (SoooooooooooooooooooooomeType *)bbbbbbbbbb; llvm-svn: 232112
* [X86, AVX2] Replace inserti128 and extracti128 intrinsics with generic shufflesSanjay Patel2015-03-124-16/+47
| | | | | | | | | | | | This is nearly identical to the v*f128_si256 parts of r231792 and r232052. AVX2 introduced proper integer variants of the hacked integer insert/extract C intrinsics that were created for this same functionality with AVX1. This should complete the front end fixes for insert/extract128 intrinsics. Corresponding LLVM patch to follow. llvm-svn: 232109
* Sema: Make BoundTypeDiagnoser a variadic templateBenjamin Kramer2015-03-121-128/+31
| | | | llvm-svn: 232101
* Fix grammar in a comment, wrap to 80 columns. No behavior change.Nico Weber2015-03-121-2/+3
| | | | llvm-svn: 232087
* Remove duplicate "the". N+1 redundancy is not useful here.Nico Weber2015-03-121-1/+1
| | | | llvm-svn: 232086
* MS ABI: Allow a nullptr_t exception to be caught by void * catch handlerDavid Majnemer2015-03-122-0/+16
| | | | | | | | | A nullptr exception object can be caught by any pointer type catch handler. However, it is not possible to express this in the exception info for the MS ABI. As a middle ground, allow such exception objects to be caught with pointer-to-void catch handlers. llvm-svn: 232069
* [docs] Update the doxygen configuration file.Logan Chien2015-03-125-1217/+1790
| | | | | | | | | | Update the doxygen configuration file and the Makefile build rules to provide better output (simply use the default stylesheet and template from the Doxygen distribution.) This CL has upgrade doxygen.cfg.in to Doxygen 1.8.6. llvm-svn: 232066
* [docs] Replace the doxygen qch option properly.Logan Chien2015-03-121-4/+11
| | | | llvm-svn: 232065
* Replace second (hopefully unused) access of macro input argument with zero ↵Sanjay Patel2015-03-121-3/+3
| | | | | | | | | | vector to be safer. Suggested by Craig Topper in D8275. This is a follow-on to r232052. llvm-svn: 232061
* ASTMatchers: Add an explicit dependency on libclangBasic.Benjamin Kramer2015-03-121-0/+1
| | | | | | | In a static build the dependency is picked up implictly, but not in a shared library build. This is needed for the new ObjC matchers that reference Selector. llvm-svn: 232055
* [X86, AVX] replace vextractf128 intrinsics with generic shufflesSanjay Patel2015-03-125-26/+70
| | | | | | | | | | | This is very much like D8088 (checked in at r231792). Now that we've replaced the vinsertf128 intrinsics, do the same for their extract twins. Differential Revision: http://reviews.llvm.org/D8275 llvm-svn: 232052
* Add support for a few Objective-C matchers.Manuel Klimek2015-03-125-4/+193
| | | | | | | | | | | Add some matchers for Objective-C selectors and messages to ASTMatchers.h. Minor mods to ASTMatchersTest.h to allow test files with ".m" extension in addition to ".cpp". New tests added to ASTMatchersTest.c. Patch by Dean Sutherland. llvm-svn: 232051
* clang-format: When putting */& next to types, also wrap before them.Daniel Jasper2015-03-123-12/+23
| | | | | | | | | | | | Before: LoooooooooooongType * loooooooooooongVariable; After: LoooooooooooongType *loooooooooooongVariable; llvm-svn: 232044
* clang-format: [Java] Support anonymous classes after = and return.Daniel Jasper2015-03-123-0/+42
| | | | | | | | | | | | | | | | | | | Before: A a = new A(){public String toString(){return "NotReallyA"; } } ; After: A a = return new A() { public String toString() { return "NotReallyA"; } }; This fixes llvm.org/PR22878. llvm-svn: 232042
* Sema: Don't emit a missing prototype warning for deleted functions.Benjamin Kramer2015-03-123-28/+35
| | | | | | | | | | | | | This is a bit more involved than I anticipated, so here's a breakdown of the changes: 1. Call ActOnFinishFunctionBody _after_ we parsed =default and =delete specifiers. Saying that we finished the body before parsing =default is just wrong. Changing this allows us to use isDefaulted and isDeleted on a decl in ActOnFinishFunctionBody. 2. Check for -Wmissing-prototypes after we parsed the function body. 3. Disable -Wmissing-prototypes when the Decl isDeleted. llvm-svn: 232040
* Use Sema's PrintingPolicy when diagnosing DeclSpecs.Benjamin Kramer2015-03-122-2/+3
| | | | | | | | | | | | | Sema overrides ASTContext's policy on the first emitted diagnostic (doesn't matter if it's ignored or not). This means changing the order of diagnostic emission in Sema suddenly changes the text of diagnostic emitted from the parser. In the test case -Wmissing-prototypes (ignored) was the culprit, use 'int main' to suppress that warning so we see when this regresses. Also move it into Sema/ as it's not testing any C++. llvm-svn: 232039
* Reverting r232034, as it broke one of the bots with link errors. Details at: ↵Aaron Ballman2015-03-125-193/+4
| | | | | | http://bb.pgr.jp/builders/ninja-clang-x64-mingw64-RA/builds/6352/steps/build/logs/stdio llvm-svn: 232038
* Instead of dereferencing std::vector::end() (which is UB and causes failed ↵Aaron Ballman2015-03-121-1/+2
| | | | | | assertions in debug builds with Visual Studio), use data() + size() to calculate the end iterator. Amends r231952. llvm-svn: 232037
* [OPENMP] CodeGen - 'omp for' with dynamic schedule kinds.Alexander Musman2015-03-124-47/+385
| | | | | | Differential Revision: http://reviews.llvm.org/D7138 llvm-svn: 232036
* Added some matchers for objective c selectors and messages to ASTMatchers.h. ↵Aaron Ballman2015-03-125-4/+193
| | | | | | | | Minor mods to ASTMatchersTest.h to allow test files with ".m" extension in addition to ".cpp". New tests added to ASTMatchersTest.c. Patch by Dean Sutherland, reviewed by Manuel Klimek. From http://reviews.llvm.org/D7710 llvm-svn: 232034
* [OPENMP] Initial codegen for 'omp sections' and 'omp section' directives.Alexey Bataev2015-03-123-23/+231
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If only one section is found in the sections region, it is emitted just like single region. Otherwise it is emitted as a static non-chunked loop. #pragma omp sections { #pragma omp section {1} ... #pragma omp section {n} } is translated to something like i32 <iter_var> i32 <last_iter> = 0 i32 <lower_bound> = 0 i32 <upper_bound> = n-1 i32 <stride> = 1 call void @__kmpc_for_static_init_4(<loc>, i32 <gtid>, i32 34/*static non-chunked*/, i32* <last_iter>, i32* <lower_bound>, i32* <upper_bound>, i32* <stride>, i32 1/*increment always 1*/, i32 1/*chunk always 1*/) <upper_bound> = min(<upper_bound>, n-1) <iter_var> = <lb> check: br <iter_var> <= <upper_bound>, label cont, label exit continue: switch (IV) { case 0: {1}; break; ... case <NumSection> - 1: {n}; break; } ++<iter_var> br label check exit: call void @__kmpc_for_static_fini(<loc>, i32 <gtid>) Differential Revision: http://reviews.llvm.org/D8244 llvm-svn: 232021
* Update copyright year to 2015.Tanya Lattner2015-03-121-1/+1
| | | | llvm-svn: 231999
* Driver: Keep -isysroot flags in crash scripts if we're dumping a VFSJustin Bogner2015-03-122-5/+9
| | | | | | | | | | | | | For crashes with a VFS (ie, with modules), the -isysroot flag is often necessary to reproduce the crash. This is especially true if some modules need to be rebuilt, since without the sysroot they'll try to read headers that are outside of the VFS. I find it likely that we should keep some of the other -i flags in this case as well, but I haven't seen that come up in practice yet so it seems better to be conservative. llvm-svn: 231997
* docs: Document byte arrays.Peter Collingbourne2015-03-121-16/+26
| | | | llvm-svn: 231994
* Driver: Print the clang version and original command in crash scriptsJustin Bogner2015-03-123-2/+9
| | | | | | | | | | When a crash report script doesn't work for a reproduction on your machine for one reason or another, it can be really tricky to figure out why not. The compiler version that crashed and the original command line before stripping flags are very helpful when this comes up. llvm-svn: 231989
OpenPOWER on IntegriCloud