summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* Refactor: put these function declarations somewhere more appropriate.Richard Smith2015-04-271-7/+7
| | | | llvm-svn: 235946
* [modules] Incrementally compute the list of overridden module macros based onRichard Smith2015-04-275-73/+176
| | | | | | | the active module macros at the point of definition, rather than reconstructing it from the macro history. No functionality change intended. llvm-svn: 235941
* Remove stale FIXMEs from test caseReid Kleckner2015-04-271-7/+5
| | | | llvm-svn: 235937
* Always add the target-cpu and target-features sets if they're non-null.Eric Christopher2015-04-272-15/+15
| | | | | | | | This makes sure that the front end is specific about what they're expecting the backend to produce. Update a FIXME with the idea that the target-features could be more precise using backend knowledge. llvm-svn: 235936
* Check whether the operand to a noexcept expression is valid or not. Fixes ↵Aaron Ballman2015-04-272-0/+29
| | | | | | PR15842. llvm-svn: 235931
* Introduce tsan_cxx and msan_cxx libraries (Clang part).Alexey Samsonov2015-04-274-4/+12
| | | | | | | | For now tsan_cxx and msan_cxx contain only operator new/delete replacements. In the future, when we add support for running UBSan+TSan and UBSan+MSan, they will also contain bits ubsan_cxx runtime. llvm-svn: 235924
* PR23334: Perform semantic checking of lambda capture initialization in the ↵Richard Smith2015-04-2712-265/+255
| | | | | | | | | | | | | | | | | | right context. Previously we'd try to perform checks on the captures from the middle of parsing the lambda's body, at the point where we detected that a variable needed to be captured. This was wrong in a number of subtle ways. In PR23334, we couldn't correctly handle the list of potential odr-uses resulting from the capture, and our attempt to recover from that resulted in a use-after-free. We now defer building the initialization expression until we leave the lambda body and return to the enclosing context, where the initialization does the right thing. This patch only covers lambda-expressions, but we should apply the same change to blocks and captured statements too. llvm-svn: 235921
* Revert "PR21000: pass -I options to assembler" as the test was failing on ↵Artem Belevich2015-04-272-16/+0
| | | | | | hexagon. llvm-svn: 235919
* PR21000: pass -I options to assemblerArtem Belevich2015-04-272-0/+16
| | | | | | | | | Pass -I options to assembly so it can find files included with .include. Differential Revision: http://reviews.llvm.org/D7472 llvm-svn: 235915
* Simplify depfile quoting test.Paul Robinson2015-04-271-15/+8
| | | | | | | With -MG we don't actually need to create the files with funky names. Also use a more sensible check-prefix for the NMAKE case. llvm-svn: 235908
* [cuda] Ignore "TLS unsupported by target" errors for host variables during ↵Artem Belevich2015-04-274-15/+45
| | | | | | | | | | | | | | | | device compilation. During device-side CUDA compilation clang currently complains about all TLS variables, regardless of whether they are __host__ or __device__. This patch suppresses "TLS unsupported" errors for host variables during device compilation and for device variables during host compilation. Differential Revision: http://reviews.llvm.org/D9269 llvm-svn: 235907
* [cuda] treat file scope __asm as __host__ and ignore it during device-side ↵Artem Belevich2015-04-272-0/+9
| | | | | | | | | | | | | | | | compilation. Currently clang emits file-scope asm during *both* host and device compilation modes which is usually a wrong thing to do. There's no way to attach any attribute to an __asm statement, so there's no way to differentiate between host-side and device-side file-scope asm. This patch makes clang to match nvcc behavior and emit file-scope-asm only during host-side compilation. Differential Revision: http://reviews.llvm.org/D9270 llvm-svn: 235905
* Support generating NMake/Jom-style depfiles.Paul Robinson2015-04-277-6/+64
| | | | | | | | | | | | | | | NMake is a Make-like builder that comes with Microsoft Visual Studio. Jom (https://wiki.qt.io/Jom) is an NMake-compatible build tool. Dependency files for NMake/Jom need to use double-quotes to wrap filespecs containing special characters, instead of the backslash escapes that GNU Make wants. Adds the -MV option, which specifies to use double-quotes as needed instead of backslash escapes when writing the dependency file. Differential Revision: http://reviews.llvm.org/D9260 llvm-svn: 235903
* [MS ABI] Use 'continue' instead of 'return false' where intendedReid Kleckner2015-04-272-4/+51
| | | | | | | | | | | | This was a bug in r218285 that prevented us from seeing subsequent virtual bases in the class hierarchy, leading to crashes later. Also add some comments to this function, now that we better understand what it's trying to do. Fixes PR21062 and PR21064. llvm-svn: 235899
* [OPENMP] Simplified iteration over clauses, NFC.Alexey Bataev2015-04-274-91/+38
| | | | llvm-svn: 235838
* [OPENMP] Codegen for 'taskwait' directive.Alexey Bataev2015-04-274-2/+56
| | | | | | | | Emit the following code for 'taskwait' directive within tied task: call i32 @__kmpc_omp_taskwait(<loc>, i32 <thread_id>); Differential Revision: http://reviews.llvm.org/D9245 llvm-svn: 235836
* [OPENMP] Codegen for 'reduction' clause in 'sections' directive.Alexey Bataev2015-04-272-6/+489
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Emit a code for reduction clause. Next code should be emitted for reductions: static kmp_critical_name lock = { 0 }; void reduce_func(void *lhs[<n>], void *rhs[<n>]) { *(Type0*)lhs[0] = ReductionOperation0(*(Type0*)lhs[0], *(Type0*)rhs[0]); ... *(Type<n>-1*)lhs[<n>-1] = ReductionOperation<n>-1(*(Type<n>-1*)lhs[<n>-1], *(Type<n>-1*)rhs[<n>-1]); } ... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n>-1]}; switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) { case 1: <LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0]); ... <LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1]); __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>); break; case 2: Atomic(<LHSExprs>[0] = ReductionOperation0(*<LHSExprs>[0], *<RHSExprs>[0])); ... Atomic(<LHSExprs>[<n>-1] = ReductionOperation<n>-1(*<LHSExprs>[<n>-1], *<RHSExprs>[<n>-1])); break; default:; } Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation. If sections directive has only single section, then original shared variables are used instead with barrier at the end of the directive. Differential Revision: http://reviews.llvm.org/D9242 llvm-svn: 235835
* [OPENMP] Codegen for 'lastprivate' clause in 'sections' directive.Alexey Bataev2015-04-272-5/+363
| | | | | | | | | | | | | | | | | | | | | | | | | #pragma omp sections lastprivate(<var>) <BODY>; This construct is translated into something like: <last_iter> = alloca i32 <init for lastprivates>; <last_iter> = 0 ; No initializer for simple variables or a default constructor is called for objects. ; For arrays perform element by element initialization by the call of the default constructor. ... OMP_FOR_START(...,<last_iter>, ..); sets <last_iter> to 1 if this is the last iteration. <BODY> ... OMP_FOR_END if (<last_iter> != 0) { <final copy for lastprivate>; Update original variable with the lastprivate value. } call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race. If there is only one section, there is no special code generation, original shared variables are used + barrier is emitted at the end of the directive. Differential Revision: http://reviews.llvm.org/D9240 llvm-svn: 235834
* [OPENMP] Codegen for 'private' clause in 'sections' directive.Alexey Bataev2015-04-272-0/+194
| | | | | | | | | | | | | | | | | | If there are 2 or more sections in a 'section' directive the following code is generated: <default init for privates> @__kmpc_for_static_init_4(); <BODY for sections directive> @__kmpc_for_static_fini() If there is only one section, the following code is generated: if (@__kmpc_single()) { <default init for privates> @__kmpc_end_single(); } Differential Revision: http://reviews.llvm.org/D9239 llvm-svn: 235833
* [OPENMP] Codegen for 'private' clause in 'single' directive.Alexey Bataev2015-04-272-0/+183
| | | | | | | | | | | | Emit the following code for 'single' directive with 'private' clause: if (@__kmpc_single()) { <default init for privates> @__kmpc_end_single(); } Differential Revision: http://reviews.llvm.org/D9238 llvm-svn: 235832
* [MS ABI] Rephrase the mangling of array types in parametersDavid Majnemer2015-04-271-6/+5
| | | | | | Make the canonicalization of array types more consistent. llvm-svn: 235831
* [Sema] Do not permit binding a reference to a compound literalDavid Majnemer2015-04-262-0/+9
| | | | | | | | | We could probably make this work if we cared enough. However, we are far outside any language rules at this point. This fixes PR21834. llvm-svn: 235818
* [Sema] Don't allow unverified bitfields in FieldDeclsDavid Majnemer2015-04-262-1/+7
| | | | | | | | VerifyBitField must be called if we are to form a bitfield FieldDecl. We will not verify the bitfield if the decl is known to be malformed in other ways; pretend that we don't have a bitfield if this happens. llvm-svn: 235816
* Correctly handle zero-sized but non-empty base classes in IRGen.John McCall2015-04-262-1/+21
| | | | | | | | | | | | | | | | Fixes rdar://20621065. A more elegant fix would preclude this case by defining the rules such that zero-size classes are always formally empty. I believe the only extensions which create zero-size classes right now are flexible arrays and zero-length arrays; it's not abstractly unreasonable to say that those don't count as members for the purposes of emptiness, just as zero-width bitfields don't count. But that's an ABI-affecting change and requires further discussion; in the meantime, let's not assert / miscompile. llvm-svn: 235815
* [Sema] Check if a builtin is FunctionPrototype().Davide Italiano2015-04-252-1/+5
| | | | | | | | | | | Don't assume it's always is. This prevents a crash in Sema while trying to merge return type for a builtin w/out function prototype. PR: 23086 Differential Revision: http://reviews.llvm.org/D9235 Reviewed by: rsmith llvm-svn: 235806
* InstrProf: Fix coverage maps for conditional operatorsJustin Bogner2015-04-242-2/+22
| | | | | | | | | This fixes a crash when we're emitting coverage and a macro appears between two binary conditional operators, ie, "foo ?: MACRO ?: bar", and fixes the interaction of macros and conditional operators in general. llvm-svn: 235793
* clang-cl: Don't look up absolute paths in %LIB%.Nico Weber2015-04-242-1/+7
| | | | | | | | | Before this patch, passing a non-existent absolute path to clang-cl would cause stat'ing of impossible paths. For example, `clang-cl -c d:\adsfasdf.txt` would cause a stat of C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\LIBd:\asdfadsf.cc llvm-svn: 235787
* [opaque pointer type] Update test cases now that the type for an invoke is ↵David Blaikie2015-04-241-1/+1
| | | | | | just a function type, not a pointer-to-function type llvm-svn: 235756
* Revert r235749 - Accidentally commited cruft from the wrong path.Lang Hames2015-04-241-1/+0
| | | | llvm-svn: 235750
* [CodeGen] Make AsmPrinter's OutStreamer member a unique_ptr.Lang Hames2015-04-241-0/+1
| | | | | | | AsmPrinter owns the OutStreamer, so an owning pointer makes sense here. Using a reference for this is crufty. llvm-svn: 235749
* clang-format: Don't wrap after short first segments of builder calls.Daniel Jasper2015-04-242-1/+14
| | | | | | | | | | | | | | | Before: a() .aaaaa() .aaaaa() .aaaaa(); After: a().aaaaa() .aaaaa() .aaaaa(); llvm-svn: 235707
* clang-format: More selectively detect QT's "signals".Daniel Jasper2015-04-242-1/+9
| | | | llvm-svn: 235702
* [TableGen] Clang changes for r235697 to stop leaking Expanders and Operators ↵Craig Topper2015-04-241-8/+7
| | | | | | in SetTheory. llvm-svn: 235698
* [OPENMP] Codegen for 'firstprivate' clause in 'single' directive.Alexey Bataev2015-04-242-5/+264
| | | | | | | | | | | | | Emit the following code for 'single' directive with 'firtstprivate' clause: if (@__kmpc_single()) { <init for firstprivates> @__kmpc_end_single(); } @__kmpc_cancel_barrier(); // To avoid data race in firstprivate init Differential Revision: http://reviews.llvm.org/D9223 llvm-svn: 235694
* Remove unused variable to silence GCC warningDavid Majnemer2015-04-241-3/+2
| | | | llvm-svn: 235693
* [OPENMP] Do not emit implicit barrier for single directive with ↵Alexey Bataev2015-04-242-4/+16
| | | | | | | | | 'copyprivate' clause(s). Runtime function for 'copyprivate' directive generates implicit barriers, so no need to emit it. Differential Revision: http://reviews.llvm.org/D9215 llvm-svn: 235692
* [OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.Alexey Bataev2015-04-242-1/+302
| | | | | | | | | | | | | | | | | | | | If there are 2 or more sections in a 'section' directive the following code is generated: <init for firstprivates> @__kmpc_cancel_barrier();// To avoid data race in firstprivate init @__kmpc_for_static_init_4(); <BODY for sections directive> @__kmpc_for_static_fini() If there is only one section, the following code is generated: if (@__kmpc_single()) { <init for firstprivates> @__kmpc_end_single(); } @__kmpc_cancel_barrier(); // To avoid data race in firstprivate init Differential Revision: http://reviews.llvm.org/D9214 llvm-svn: 235691
* Replace getPointeeType()->isFunctionType with isMemberDataPointerTypeDavid Majnemer2015-04-245-7/+6
| | | | llvm-svn: 235682
* [MS ABI] Fix the preferred alignment of member pointersDavid Majnemer2015-04-244-39/+43
| | | | | | | Member pointers in the MS ABI have different alignment depending on whether they were created on the stack or live in a record. llvm-svn: 235681
* Cleanup some MS-ABI specific codeDavid Majnemer2015-04-242-11/+12
| | | | | | No functional change intended. llvm-svn: 235680
* [modules] Partial revert of r235669: don't create ModuleMacros for imported ↵Richard Smith2015-04-241-6/+0
| | | | | | | | local macros. The surrounding infrastructure isn't quite ready for this yet. llvm-svn: 235677
* [modules] Refactor creation of ModuleMacros and create them when importing ↵Richard Smith2015-04-234-30/+44
| | | | | | from local submodules. llvm-svn: 235669
* InstrProf: Stop using RegionCounter outside of CodeGenPGO (NFC)Justin Bogner2015-04-2314-169/+145
| | | | | | | | | The RegionCounter type does a lot of legwork, but most of it is only meaningful within the implementation of CodeGenPGO. The uses elsewhere in CodeGen generally just want to increment or read counters, so do that directly. llvm-svn: 235664
* [modules] Properly attribute macros to modules if they're in a file ↵Richard Smith2015-04-237-9/+25
| | | | | | textually included into a file in the module. llvm-svn: 235661
* Fix clang docs build.Sergey Matveev2015-04-231-2/+2
| | | | llvm-svn: 235650
* [modules] Remove the now-redundant import of all pending macros at the end ↵Richard Smith2015-04-233-31/+10
| | | | | | | | | of building a module. Since we now track module macros separately from their visibility state, this is no longer necessary. llvm-svn: 235648
* [modules] Store a ModuleMacro* on an imported macro directive rather than ↵Richard Smith2015-04-239-175/+142
| | | | | | duplicating the info within it. llvm-svn: 235644
* Add clang/docs/SanitizerCoverage.rstSergey Matveev2015-04-232-0/+349
| | | | | | Moved from https://code.google.com/p/address-sanitizer/wiki/AsanCoverage llvm-svn: 235643
* [modules] Determine the set of macros exported by a submodule at the end of ↵Richard Smith2015-04-2312-148/+263
| | | | | | | | | | | that submodule. Previously we'd defer this determination until writing the AST, which doesn't allow us to use this information when building other submodules of the same module. This change also allows us to use a uniform mechanism for writing module macro records, independent of whether they are local or imported. llvm-svn: 235614
* Don't emit lifetime markers when msan is enabledReid Kleckner2015-04-232-3/+12
| | | | | | | | | | In r235553, Clang started emitting lifetime markers more often. This caused false negative in MSan, because MSan only poisons all allocas once at function entry. Eventually, MSan should poison allocas at lifetime start and probably also lifetime end, but until then, let's not emit markers that aren't going to be useful. llvm-svn: 235613
OpenPOWER on IntegriCloud