summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the build with MSVC 2013 after r283856Reid Kleckner2016-10-111-4/+8
| | | | llvm-svn: 283906
* [OpenCL] Allow partial initializer for array and structYaxun Liu2016-10-111-2/+3
| | | | | | | | | | | | | | Currently Clang allows partial initializer for C99 but not for OpenCL, e.g. float a[16][16] = {1.0f, 2.0f}; is allowed in C99 but not allowed in OpenCL. This patch fixes that. Differential Revision: https://reviews.llvm.org/D25335 llvm-svn: 283891
* Revert r283887 and r283882, until the issue is understood and fixed.Vassil Vassilev2016-10-117-159/+35
| | | | llvm-svn: 283890
* r283882 followup. Don't demote ParmVarDecls. This should fix our module builds.Vassil Vassilev2016-10-111-14/+16
| | | | llvm-svn: 283887
* [modules] PR28752: Do not instantiate variable declarations which are not ↵Vassil Vassilev2016-10-117-35/+157
| | | | | | | | | | visible. https://reviews.llvm.org/D24508 Patch developed in collaboration with Richard Smith! llvm-svn: 283882
* Revert "[Driver][Diagnostics] Make 'show option names' default for driver ↵Renato Golin2016-10-111-7/+4
| | | | | | | | warnings" This reverts commit r283827, as it's breaking all ARM/AARch64 bots. llvm-svn: 283868
* Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC)Mehdi Amini2016-10-115-18/+21
| | | | llvm-svn: 283856
* Add an option to save the backend-produced YAML optimization record to a fileHal Finkel2016-10-113-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | The backend now has the capability to save information from optimizations, the same information that can be used to generate optimization diagnostics but in machine-consumable form, into an output file. This can be enabled when using opt (see r282539), and this change enables it when using clang. The idea is that other tools will be able to consume these files, and perhaps in combination with the original source code, produce various kinds of optimization reports for users (and for compiler developers). We now have at-least two tools that can consume these files: * tools/llvm-opt-report * utils/opt-viewer Using the flag -fsave-optimization-record will cause the YAML file to be generated; the file name will be based on the output file name (if we're using -c or -S and have an output name), or the input file name. When we're using CUDA, or some other offloading mechanism, separate files are generated for each backend target. The output file name can be specified by the user using -foptimization-record-file=filename. Differential Revision: https://reviews.llvm.org/D25225 llvm-svn: 283834
* Aligned allocation versus CUDA: make deallocation function preference orderRichard Smith2016-10-112-88/+45
| | | | | | | | | | | | | match other CUDA preference orders, per discussion with jlebar. We now model this in an attempt to match overload resolution as closely as possible: - First, we throw out all non-callable (due to CUDA host/device mismatch) operator delete functions. - Then we apply sizedness / alignedness preferences based on whether the type is overaligned and whether the deallocation function is a member. - Finally, we use the CUDA callability preference as a tiebreaker. llvm-svn: 283830
* [Driver][Diagnostics] Make 'show option names' default for driver warningsBruno Cardoso Lopes2016-10-111-4/+7
| | | | | | | | | | | | | | Currently, driver level warnings do not show option names (e.g. warning: complain about foo [-Woption-name]) in a diagnostic unless -fdiagnostics-show-option is explictly specified. OTOH, the driver by default turn this option on for CC1. Change the logic to show option names by default in the driver as well. Differential Revision: https://reviews.llvm.org/D24516 rdar://problem/27300909 llvm-svn: 283827
* Store FileEntry::Filename as a StringRef instead of raw pointer (NFC)Mehdi Amini2016-10-107-22/+23
| | | | llvm-svn: 283815
* [Driver] Let -gline-tables-only win when it comes after -gmodules.Adrian Prantl2016-10-101-1/+3
| | | | | | | | | | | | The -gmodules option is all about putting debug type info into clang modules and for line tables the type information is irrelevant, so combining these two options makes no sense. This commmit fixes the behavior to match the one documented on the clang man page: the last -g... option wins. <rdar://problem/27059770> llvm-svn: 283810
* Change Builtins name to be stored as StringRef instead of raw pointers (NFC)Mehdi Amini2016-10-102-5/+5
| | | | llvm-svn: 283802
* Add -fno-sanitize-address-use-after-scope flagVitaly Buka2016-10-102-9/+11
| | | | | | | | Reviewers: eugenis Differential Revision: https://reviews.llvm.org/D25453 llvm-svn: 283801
* Make the LValue created in EmitValueForIvarAtOffset have the same Qualifiers ↵Nick Lewycky2016-10-101-5/+2
| | | | | | in the LValue as the QualType in the LValue. No functionality change intended. llvm-svn: 283795
* Implement MS read/write barriers and __faststorefence intrinsicAlbert Gutowski2016-10-102-30/+20
| | | | | | | | | | Reviewers: hans, rnk, majnemer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25442 llvm-svn: 283793
* [AST] Don't use make_pointee_iterator in VTableBuilder.Justin Lebar2016-10-101-3/+4
| | | | | | | Our implementation of make_pointee_iterator seems to be causing MSVC 2015 to crash, so I'm going to remove it. llvm-svn: 283790
* Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use ofRichard Smith2016-10-1015-514/+816
| | | | | | | | | | | past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code generation for C++17 overaligned allocation. llvm-svn: 283789
* Implement __emul, __emulu, _mul128 and _umul128 MS intrinsicsAlbert Gutowski2016-10-102-36/+31
| | | | | | | | | | Reviewers: rnk, thakis, majnemer, hans Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25353 llvm-svn: 283785
* Use StringRef in LangOptions::isNoBuiltinFunc API (NFC)Mehdi Amini2016-10-101-2/+1
| | | | llvm-svn: 283776
* [Analysis] Use unique_ptr for CallGraph::FunctionMap.Justin Lebar2016-10-101-9/+7
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25427 llvm-svn: 283775
* [Analysis] Use unique_ptr in AnalyaisDeclContextManager's ContextMap.Justin Lebar2016-10-101-9/+5
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25426 llvm-svn: 283774
* [AST] Convert Marshallers to use unique_ptr.Justin Lebar2016-10-102-60/+62
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D25425 llvm-svn: 283773
* Use unique_ptr for VTableBuilder::VBaseInfo map.Justin Lebar2016-10-101-15/+14
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25424 llvm-svn: 283772
* Use unique_ptr for VTableBuilder::VFTableLayouts map.Justin Lebar2016-10-101-2/+1
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25423 llvm-svn: 283771
* Use unique_ptr for VPtrLocationsMap and VPtrInfoVector.Justin Lebar2016-10-102-58/+61
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25422 llvm-svn: 283770
* [AST] Use unique_ptr for VTableLayout.Justin Lebar2016-10-101-12/+10
| | | | | | | | | | Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25421 llvm-svn: 283769
* [AST] Convert MangleNumberingContext to a unique_ptr.Justin Lebar2016-10-104-9/+11
| | | | | | | | | | | | Summary: It doesn't need to be refcounted anymore, either. Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25420 llvm-svn: 283768
* [Sema] Use unique_ptr instead of raw pointers in the late-parsed templates map.Justin Lebar2016-10-106-15/+17
| | | | | | | | | | | | | | | Summary: This is possible now that MapVector supports move-only values. Depends on D25404. Reviewers: timshen Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25405 llvm-svn: 283766
* [Sema] Prevent using member declaration diagnostic if the base class is invalid.Eric Fiselier2016-10-101-5/+7
| | | | | | | | | | | | | | | Summary: Once a base class has been made invalid (by a static_assert for example) all using-member declarations in the derived classes will result in a "not a base class" diagnostic. This diagnostic is very misleading and should not be emitted. This change is needed to help libc++ produce reasonable diagnostics in `std::optional` and `std::variant`. Reviewers: rsmith, majnemer, aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25430 llvm-svn: 283755
* Revert r283683 because r283680 got reverted.Nico Weber2016-10-101-12/+1
| | | | llvm-svn: 283753
* Revert "P0035R4: Semantic analysis and code generation for C++17 overaligned ↵Daniel Jasper2016-10-1015-816/+514
| | | | | | | | | | | | allocation." This reverts commit r283722. Breaks: Clang.SemaCUDA.device-var-init.cu Clang.CodeGenCUDA.device-var-init.cu http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-expensive/884/ llvm-svn: 283750
* Revert r283680.Nico Weber2016-10-106-389/+0
| | | | | | | | | | | | | Breaks bootstrap builds on (at least) Windows: In file included from D:\buildslave\clang-x64-ninja-win7\llvm\lib\Support\Allocator.cpp:14: In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/Allocator.h:24: In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/ADT/SmallVector.h:20: In file included from D:\buildslave\clang-x64-ninja-win7\llvm\include\llvm/Support/MathExtras.h:19: D:\buildslave\clang-x64-ninja-win7\stage1.install\bin\..\lib\clang\4.0.0\include\algorithm(63,8) : error: unknown type name '__device__' inline __device__ const __T & llvm-svn: 283747
* [Driver] Make -print-libgcc-file-name print compiler-rt lib when usedMichal Gorny2016-10-101-1/+9
| | | | | | | | | | | | | | | | | | | | Make the -print-libgcc-file-name option print an appropriate compiler runtime library, that is libgcc.a if gcc runtime is used and an appropriate compiler-rt library if that runtime is used. The main use for this is to allow linking executables built with -nodefaultlibs (e.g. to avoid linking to the standard C++ library) to the compiler runtime library, e.g. using: clang++ ... -nodefaultlibs $(clang++ ... -print-libgcc-file-name) in which case currently a program built like this linked to the gcc runtime unconditionally. The patch fixes it to use compiler-rt libraries instead when compiler-rt is the active runtime. Differential Revision: https://reviews.llvm.org/D25338 llvm-svn: 283746
* Revert "[x86][inline-asm][clang] accept 'v' constraint"Daniel Jasper2016-10-101-2/+0
| | | | | | | | | This reverts commit r283716. Breaks buildbot: http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/9155/testReport/junit/Clang/CodeGen/x86_inline_asm_v_constraint_c/ llvm-svn: 283743
* Mark aligned allocation as done.Richard Smith2016-10-101-1/+2
| | | | llvm-svn: 283724
* P0035R4: Semantic analysis and code generation for C++17 overalignedRichard Smith2016-10-1015-514/+816
| | | | | | allocation. llvm-svn: 283722
* [x86][inline-asm][clang] accept 'v' constraintMichael Zuckerman2016-10-101-0/+2
| | | | | | | | | | | | | | Commit in the name of: Coby Tayree 1.'v' constraint for (x86) non-avx arch imitates the already implemented 'x' constraint, i.e. allows XMM{0-15} & YMM{0-15} depending on the apparent arch & mode (32/64). 2.for the avx512 arch it allows [X,Y,Z]MM{0-31} (mode dependent) This patch applies the needed changes to clang LLVM patch: https://reviews.llvm.org/D25005 Differential Revision: D25004 llvm-svn: 283716
* When optimizing for size, enable loop rerolling by defaultHal Finkel2016-10-091-1/+10
| | | | | | | | | | We have a loop-rerolling optimization which can be enabled by using -freroll-loops. While sometimes loops are hand-unrolled for performance reasons, when optimizing for size, we should always undo this manual optimization to produce smaller code (our optimizer's unroller will still unroll the rerolled loops if it thinks that is a good idea). llvm-svn: 283685
* [CUDA] Don't install cuda_wrappers/{algorithm,complex} into the main include ↵Justin Lebar2016-10-091-3/+12
| | | | | | | | | dir. This is obviously wrong -- if we do this, then all compiles will pick up these wrappers, which is not what we want. llvm-svn: 283683
* [CUDA] Support <complex> and std::min/max on the device.Justin Lebar2016-10-086-0/+391
| | | | | | | | | | | | | | | Summary: We do this by wrapping <complex> and <algorithm>. Tests are in the test-suite. Reviewers: tra Subscribers: jhen, beanz, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D24979 llvm-svn: 283680
* [CUDA] Rename cuda_builtin_vars.h to __clang_cuda_builtin_vars.h.Justin Lebar2016-10-084-12/+13
| | | | | | | | | | | | Summary: This matches the idiom we use for our other CUDA wrapper headers. Reviewers: tra Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24978 llvm-svn: 283679
* [CUDA] Declare our __device__ math functions in the same inline namespace as ↵Justin Lebar2016-10-082-1/+41
| | | | | | | | | | | | | | | | | | | our standard library. Summary: Currently we declare our inline __device__ math functions in namespace std. But libstdc++ and libc++ declare these functions in an inline namespace inside namespace std. We need to match this because, in a later patch, we want to get e.g. <complex> to use our device overloads, and it only will if those overloads are in the right inline namespace. Reviewers: tra Subscribers: cfe-commits, jhen Differential Revision: https://reviews.llvm.org/D24977 llvm-svn: 283678
* [CUDA] Add #pragma clang force_cuda_host_device_{begin,end} pragmas.Justin Lebar2016-10-084-0/+89
| | | | | | | | | | | | | | | | | Summary: These cause us to consider all functions in-between to be __host__ __device__. You can nest these pragmas; you just can't have more 'end's than 'begin's. Reviewers: rsmith Subscribers: tra, jhen, cfe-commits Differential Revision: https://reviews.llvm.org/D24975 llvm-svn: 283677
* [analyzer] Fix build error after r283660 - remove constexpr strings.Artem Dergachev2016-10-081-2/+8
| | | | llvm-svn: 283662
* [analyzer] Re-apply r283094 "Improve CloneChecker diagnostics"Artem Dergachev2016-10-082-61/+71
| | | | | | The parent commit (r283092) was reverted before and now finally landed. llvm-svn: 283661
* [analyzer] Re-apply r283093 "Add extra notes to ObjCDeallocChecker"Artem Dergachev2016-10-081-3/+29
| | | | | | The parent commit (r283092) was reverted before and now finally landed. llvm-svn: 283660
* Un-tabify source files, NFC.Yaron Keren2016-10-084-8/+7
| | | | llvm-svn: 283657
* Use StringRef in Command::printArg() instead of raw pointer (NFC)Mehdi Amini2016-10-081-3/+3
| | | | llvm-svn: 283645
* [CUDA] Do a better job at detecting wrong-side calls.Justin Lebar2016-10-083-72/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Move CheckCUDACall from ActOnCallExpr and BuildDeclRefExpr to DiagnoseUseOfDecl. This lets us catch some edge cases we were missing, specifically around class operators. This necessitates a few other changes: - Avoid emitting duplicate deferred diags in CheckCUDACall. Previously we'd carefully placed our call to CheckCUDACall such that it would only ever run once for a particular callsite. But now this isn't the case. - Emit deferred diagnostics from a template specialization/instantiation's primary template, in addition to from the specialization/instantiation itself. DiagnoseUseOfDecl ends up putting the deferred diagnostics on the template, rather than the specialization, so we need to check both. Reviewers: rsmith Subscribers: cfe-commits, tra Differential Revision: https://reviews.llvm.org/D24573 llvm-svn: 283637
OpenPOWER on IntegriCloud