summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Move private classes into anonymous namespacesBenjamin Kramer2015-03-233-88/+5
| | | | | | Also merge anonymous namespaces in Targets.cpp a bit. NFC. llvm-svn: 232945
* handle armeb/thumb/thumbeb consistently in gnutools::Assemble::ConstructJobScott Douglass2015-03-231-5/+10
| | | | | | Differential Revision: http://reviews.llvm.org/D8196 llvm-svn: 232940
* Convert cascading if-else-if to switch. NFCScott Douglass2015-03-231-14/+32
| | | | | | Differential Revision: http://reviews.llvm.org/D8485 llvm-svn: 232939
* [OPENMP] Codegen for 'copyprivate' clause ('single' directive).Alexey Bataev2015-03-239-44/+278
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is at least one 'copyprivate' clause is associated with the single directive, the following code is generated: ``` i32 did_it = 0; \\ for 'copyprivate' clause if(__kmpc_single(ident_t *, gtid)) { SingleOpGen(); __kmpc_end_single(ident_t *, gtid); did_it = 1; \\ for 'copyprivate' clause } <copyprivate_list>[0] = &var0; ... <copyprivate_list>[n] = &varn; call __kmpc_copyprivate(ident_t *, gtid, <copyprivate_list_size>, <copyprivate_list>, <copy_func>, did_it); ... void<copy_func>(void *LHSArg, void *RHSArg) { Dst = (void * [n])(LHSArg); Src = (void * [n])(RHSArg); Dst[0] = Src[0]; ... Dst[n] = Src[n]; } ``` All list items from all 'copyprivate' clauses are gathered into single <copyprivate list> (<copyprivate_list_size> is a size in bytes of this list) and <copy_func> is used to propagate values of private or threadprivate variables from the 'single' region to other implicit threads from outer 'parallel' region. Differential Revision: http://reviews.llvm.org/D8410 llvm-svn: 232932
* Revert "Add CodeGen support for adding cpu attributes on functions based on"Daniel Jasper2015-03-231-21/+0
| | | | | | | This breaks CodeGen for an internal target. I'll get repro instructions to you. llvm-svn: 232930
* [modules] Remove redundant import of lexical decls when building a lookup tableRichard Smith2015-03-238-138/+176
| | | | | | | | | | | | | | | for a DeclContext, and fix propagation of exception specifications along redeclaration chains. This reverts r232905, r232907, and r232907, which reverted r232793, r232853, and r232853. One additional change is present here to resolve issues with LLDB: distinguish between whether lexical decls missing from the lookup table are local or are provided by the external AST source, and still look in the external source if that's where they came from. llvm-svn: 232928
* [Analyzer] Don't inherit from FoldingSet.Benjamin Kramer2015-03-221-4/+4
| | | | | | That's not really necessary here. NFCI. llvm-svn: 232921
* [multilib] Turn virtual functor into functin_refBenjamin Kramer2015-03-222-86/+48
| | | | | | And update code to use lambdas where possible, plus random cleanup. NFCI. llvm-svn: 232916
* Add a dump function to Stmt that takes only an output stream. No ↵Faisal Vali2015-03-221-0/+5
| | | | | | | | | | functionality change. This allows dumping to any given output stream but without requiring a SourceManager, similar to the interface provided by Decl. It's useful when writing certain generic debug functions, external to the clang code base (for e.g.). llvm-svn: 232912
* Reverting 232853 and 232870 because they depend on 232793,Vince Harron2015-03-224-79/+67
| | | | | | which was reverted because it was causing LLDB test failures llvm-svn: 232907
* MS ABI: Implement driver-level support for thread-safe staticsDavid Majnemer2015-03-223-67/+55
| | | | | | | | | | | Decide whether or not to use thread-safe statics depending on whether or not we have an explicit request from the driver. If we don't have an explicit request, infer which behavior to use depending on the compatibility version we are targeting. N.B. CodeGen support is still ongoing. llvm-svn: 232906
* Reverting r232793 until some new LLDB failures are discussedVince Harron2015-03-225-51/+49
| | | | llvm-svn: 232905
* -Wdynamic-class-memaccess: Also warn about array types.Nico Weber2015-03-211-0/+2
| | | | | | | It looks like not warning on this was an oversight in the original implementation of this warning. llvm-svn: 232900
* Dedent code for -Wdynamic-class-memaccess warning. No behavior change.Nico Weber2015-03-211-39/+44
| | | | | | | | | | | | The diff looks intimidating, but this just moves the -Wdynamic-class-memaccess code out a scope, protected by a if (PointeeTy == QualType()) continue; check so that it still only runs when it should. llvm-svn: 232899
* [OPENMP] CodeGen of the 'linear' clause for the 'omp simd' directive.Alexander Musman2015-03-216-12/+227
| | | | | | | | | The linear variable is privatized (similar to 'private') and its value on current iteration is calculated, similar to the loop counter variables. Differential revision: http://reviews.llvm.org/D8375 llvm-svn: 232890
* Add CodeGen support for adding cpu attributes on functions based onEric Christopher2015-03-211-0/+21
| | | | | | | | | | | | | the target-cpu, if different from the triple's cpu, and target-features as they're written that are passed down from the driver. Together with LLVM r232885 this should allow the LTO'ing of binaries that contain modules compiled with different code generation options on a subset of architectures with full backend support (x86, powerpc, aarch64). llvm-svn: 232888
* [modules] When either redecl chain merging or an update record causes us toRichard Smith2015-03-214-63/+63
| | | | | | | | | give an exception specification to a declaration that didn't have an exception specification in any of our imported modules, emit an update record ourselves. Without this, code importing the current module would not see an exception specification that we could see and might have relied on. llvm-svn: 232870
* Only add -fno-rtti if KernelOrKext or in C++ mode.Filipe Cabecinhas2015-03-201-2/+3
| | | | llvm-svn: 232869
* Don't claim exception related arguments when looking at RTTIModeFilipe Cabecinhas2015-03-201-1/+1
| | | | | | | | | | | | | | | | | | Summary: We were claiming the -f*exceptions arguments when looking for the RTTIMode. This makes us not warn about unused arguments if compiling a C file with -fcxx-exceptions. This patch fixes it by not claiming the exception-related arguments at that point. Reviewers: rsmith, samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8507 llvm-svn: 232860
* [modules] Remove temporary IdentifierInfo lookup results when we're done ↵Richard Smith2015-03-202-4/+16
| | | | | | with them. llvm-svn: 232853
* [analyzer] RetainCountChecker: Don't assume +0 for ivars backing readonly ↵Jordan Rose2015-03-201-12/+52
| | | | | | | | | | | | properties. Similarly, don't assume +0 if the property's setter is manually implemented. In both cases, if the property's ownership is explicitly written, then we /do/ assume the ivar has the same ownership. rdar://problem/20218183 llvm-svn: 232849
* [UBSan] Don't allow to use UBSan with anything except for ASan.Alexey Samsonov2015-03-201-69/+66
| | | | | | | | | | We are not able to make a reliable solution for using UBSan together with other sanitizers with runtime support (and sanitizer_common). Instead, we want to follow the path used for LSan: have a "standalone" UBSan tool, and plug-in UBSan that would be explicitly embedded into specific sanitizers (in short term, it will be only ASan). llvm-svn: 232829
* MS ABI: Accept calls to an unprototyped declaration of _setjmpDavid Majnemer2015-03-202-4/+11
| | | | | | This fixes PR22961. llvm-svn: 232824
* [MSVC] Explicit specializations can be declared in any namespace (fix for ↵Alexey Bataev2015-03-201-5/+7
| | | | | | | | | | | | | | http://llvm.org/PR13738) MS compiler emits no errors in case of explicit specializations outside declaration enclosing namespaces, even when language extensions are disabled. The patch is to suppress errors and emit extension warnings if explicit specializations are not declared in the corresponding namespaces. This fixes PR13738. Patch by Alexey Frolov. Differential Revision: http://reviews.llvm.org/D8283 llvm-svn: 232800
* InstrProf: Make profile variables private to reduce binary size overheadJustin Bogner2015-03-201-2/+6
| | | | | | | | | | | | When we instrument a program for profiling, we copy the linkage of an instrumented function so that our datastructures merge in the same way as the function. This avoids redundant copies for things like linkonce, but ends up emitting names we never need to reference for normal and internal symbols. Promoting internal and external linkage to private for these variables reduces the size overhead of profiling drastically. llvm-svn: 232799
* [modules] Remove some redundant work when building a lookup table for a ↵Richard Smith2015-03-205-49/+51
| | | | | | | | | | | | | | | | | | | | | | | | DeclContext. When we need to build the lookup table for a DeclContext, we used to pull in all lexical declarations for the context; instead, just build a lookup table for the local lexical declarations. We previously didn't guarantee that the imported declarations would be in the returned map, but in some cases we'd happen to put them all in there regardless. Now we're even lazier about this. This unnecessary work was papering over some other bugs: - LookupVisibleDecls would use the DC for name lookups in the TU in C, and this was not guaranteed to find all imported names (generally, the DC for the TU in C is not a reliable place to perform lookups). We now use an identifier-based lookup mechanism for this. - We didn't actually load in the list of eagerly-deserialized declarations when importing a module (so external definitions in a module wouldn't be emitted by users of those modules unless they happened to be deserialized by the user of the module). llvm-svn: 232793
* DebugInfo: Check for null before using DITypeDuncan P. N. Exon Smith2015-03-201-1/+1
| | | | | | | | A WIP patch to turn on stricter `DIDescriptor` accessor checks fires here; it's obvious from the code that `T` can be null, so add an explicit check. Caught by dozens of current testcases. llvm-svn: 232791
* C++14: Disable sized deallocation by default due to ABI breakageReid Kleckner2015-03-206-81/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are no widely deployed standard libraries providing sized deallocation functions, so we have to punt and ask the user if they want us to use sized deallocation. In the future, when such libraries are deployed, we can teach the driver to detect them and enable this feature. N3536 claimed that a weak thunk from sized to unsized deallocation could be emitted to avoid breaking backwards compatibility with standard libraries not providing sized deallocation. However, this approach and other variations don't work in practice. With the weak function approach, the thunk has to have default visibility in order to ensure that it is overridden by other DSOs providing sized deallocation. Weak, default visibility symbols are particularly expensive on MachO, so John McCall was considering disabling this feature by default on Darwin. It also changes behavior ELF linking behavior, causing certain otherwise unreferenced object files from an archive to be pulled into the link. Our second approach was to use an extern_weak function declaration and do an inline conditional branch at the deletion call site. This doesn't work because extern_weak only works on MachO if you have some archive providing the default value of the extern_weak symbol. Arranging to provide such an archive has the same challenges as providing the symbol in the standard library. Not to mention that extern_weak doesn't really work on COFF. Reviewers: rsmith, rjmccall Differential Revision: http://reviews.llvm.org/D8467 llvm-svn: 232788
* Allow -fsanitize-coverage with -fsanitize=dataflowKostya Serebryany2015-03-201-1/+1
| | | | | | | | | | | | | | | | Summary: Allow -fsanitize-coverage with -fsanitize=dataflow Test Plan: check-clang Reviewers: pcc Reviewed By: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8476 llvm-svn: 232787
* Don't crash-on-valid when an inline function is friend of class templateDavid Majnemer2015-03-202-2/+3
| | | | | | | | | We assumed that the most recent declaration of an inline function would also be inline. However, a more recent declaration can come from a friend declaration in a class template that is instantiated at the definition of the function. llvm-svn: 232786
* Clang follow-up to LLVM r232772Duncan P. N. Exon Smith2015-03-191-2/+0
| | | | | | -verify-di is dead! Long live -verify! llvm-svn: 232779
* [Modules] Implement __builtin_isinf_sign in Clang.Chandler Carruth2015-03-191-20/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Somehow, we never managed to implement this fully. We could constant fold it like crazy, including constant folding complex arguments, etc. But if you actually needed to generate code for it, error. I've implemented it using the somewhat obvious lowering. Happy for suggestions on a more clever way to lower this. Now, what you might ask does this have to do with modules? Fun story. So it turns out that libstdc++ actually uses __builtin_isinf_sign to implement std::isinf when in C++98 mode, but only inside of a template. So if we're lucky, and we never instantiate that, everything is good. But once we try to instantiate that template function, we need this builtin. All of my customers at least are using C++11 and so they never hit this code path. But what does that have to do with modules? Fun story. So it turns out that with modules we actually observe a bunch of bugs in libstdc++ where their <cmath> header clobbers things exposed by <math.h>. To fix these, we have to provide global function definitions to replace the macros that C99 would have used. And it turns out that ::isinf needs to be implemented using the exact semantics used by the C++98 variant of std::isinf. And so I started to fix this bug in libstdc++ and ceased to be able to compile libstdc++ with Clang. The yaks are legion. llvm-svn: 232778
* MS ABI: Implement the MSVC 2015 scheme for scope disambiguationDavid Majnemer2015-03-193-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | consider C++ that looks like: inline int &f(bool b) { if (b) { static int i; return i; } static int i; return i; } Both 'i' variables must have distinct (and stable) names for linkage purposes. The MSVC 2013 ABI would number the variables using a count of the number of scopes that have been created. However, the final 'i' returns to a scope that has already been created leading to a mangling collision. MSVC 2015 fixes this by giving the second 'i' the name it would have if it were declared before the 'if'. However, this results in ABI breakage because the mangled name, in cases where there was no ambiguity, would now be different. We implement the new behavior and only enable it if we are targeting the MSVC 2015 ABI, otherwise the old behavior will be used. This fixes PR18131. llvm-svn: 232766
* Correct typos in C11 generic-selection expressions.Kaelyn Takata2015-03-191-2/+4
| | | | llvm-svn: 232760
* Add -Wpartial-availability.Nico Weber2015-03-193-29/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | This warns when using decls that are not available on all deployment targets. For example, a call to - (void)ppartialMethod __attribute__((availability(macosx,introduced=10.8))); will warn if -mmacosx-version-min is set to less than 10.8. To silence the warning, one has to explicitly redeclare the method like so: @interface Whatever(MountainLionAPI) - (void)ppartialMethod; @end This way, one cannot accidentally call a function that isn't available everywhere. Having to add the redeclaration will hopefully remind the user to add an explicit respondsToSelector: call as well. Some projects build against old SDKs to get this effect, but building against old SDKs suppresses some bug fixes -- see http://crbug.com/463171 for examples. The hope is that SDK headers are annotated well enough with availability attributes that new SDK + this warning offers the same amount of protection as using an old SDK. llvm-svn: 232750
* Remove .CUDAIsDevice flags from CodeGenOpts as it's alreadyArtem Belevich2015-03-193-4/+3
| | | | | | | | available in LangOpts. Differential Revision: http://reviews.llvm.org/D8385 llvm-svn: 232749
* Fix -ast-dump of dependent new and delete exprsReid Kleckner2015-03-191-8/+12
| | | | llvm-svn: 232748
* Ignore device-side asm constraint errors while compiling CUDA code for host ↵Artem Belevich2015-03-191-3/+16
| | | | | | | | and vice versa. Differential Revision: http://reviews.llvm.org/D8392 llvm-svn: 232747
* Add -ast-dump support for new and delete expressions to help figure out ↵Reid Kleckner2015-03-191-0/+24
| | | | | | which operator got selected llvm-svn: 232740
* Ensure that we still parse preprocessed CUDA files as CUDA when we useArtem Belevich2015-03-194-3/+10
| | | | | | | | | -save-temps option. Summary: Fixes PR22926. Review: http://reviews.llvm.org/D8383 llvm-svn: 232737
* Revert "Improvement on sized deallocation from r230160"Reid Kleckner2015-03-192-92/+14
| | | | | | | | | This reverts commit r230580. extern_weak functions don't appear to work on Darwin (PR22951), so we'll need to come up with a new approach. llvm-svn: 232731
* Devirtualize Attr and all subclasses.Benjamin Kramer2015-03-191-7/+1
| | | | | | | | | | | | We know all subclasses in tblgen so just generate a giant switch for the few virtual methods or turn them into a member variable using spare bits. The giant jump tables aren't pretty but still much smaller than a vtable for every attribute, shrinking Release+Asserts clang by ~400k. Also halves the size of the Attr base class. No functional change intended. llvm-svn: 232726
* Move ThreadSafetyReporter into an anonymous namespace. NFC.Benjamin Kramer2015-03-191-4/+4
| | | | llvm-svn: 232723
* Add option to switch off putting header modules into the dependency file.Manuel Klimek2015-03-191-2/+3
| | | | llvm-svn: 232721
* clang-format: Fix another bug in wrapping around "*".Daniel Jasper2015-03-191-3/+3
| | | | | | | | | | | | Before: void aaaaa( aaaaaaaaaaaa* aaaaaaaaaaaaaa) {} // even violation the column limit After: void aaaaa(aaaaaaaaaaaa* aaaaaaaaaaaaaa) {} llvm-svn: 232717
* [OPENMP] Fixed bug in codegen of 'atomic write'.Alexey Bataev2015-03-191-2/+2
| | | | | | Fixed codegen for exit/continue order after success/failed atomic cmpxchg instruction for 'atomic write' construct. llvm-svn: 232712
* Parse: Don't assume tokens have a lengthDavid Majnemer2015-03-192-8/+25
| | | | | | | Don't crash if the last token in a bad inline method body is an annotation token. llvm-svn: 232694
* MS ABI: Don't try to emit VF/VB-Tables for extern class templatesDavid Majnemer2015-03-184-99/+94
| | | | | | | | | There will be an explicit template instantiation in another translation unit which will provide the definition of the VF/VB-Tables. This fixes PR22932. llvm-svn: 232680
* clang-format: Fix bad wrapping after "*" introduced in r232044.Daniel Jasper2015-03-181-3/+1
| | | | | | | | | | | | Before: void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa* const aaaaaaaaaaaa) {} After: void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaa* const aaaaaaaaaaaa) {} llvm-svn: 232635
* OpenCL: CL2.0 atomic typesAnastasia Stulova2015-03-183-5/+60
| | | | | | | | | | | | OpenCL C Spec v2.0 Section 6.13.11 - Made c11 _Atomic being not accepted for OpenCL - Implemented CL2.0 atomics by aliasing them to the corresponding c11 atomic types using implicit typedef - Added diagnostics for atomics Khronos extension enabling llvm-svn: 232631
OpenPOWER on IntegriCloud