summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [ASTImporter] Add support to import some AST nodes:Gabor Horvath2018-01-272-23/+200
| | | | | | | | | | | | | | | | * CXXOperatorCallExpr * SizeOfPackExpr * DependentTemplateSpecializationType * DependentSizedArray * CXXTypeidExpr * Fix importing CXXTemporaryObjectExpr Some of the changes are based on https://github.com/haoNoQ/clang/blob/summary-ipa-draft/lib/AST/ASTImporter.cpp Differential Revision: https://reviews.llvm.org/D42335 llvm-svn: 323589
* [CodeGen] Use the non-virtual alignment when emitting the baseAkira Hatanaka2018-01-272-1/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructor. Previously, clang would emit an over-aligned (16-byte) store to initialize B::x in B's base constructor when compiling the following code: struct A { __attribute__((aligned(16))) double data1; }; struct B : public virtual A { B() : x(123) {} double a; int x; }; struct C : public virtual B {}; void test() { B b; C c; } This was happening because the code in IRGen that does member initialization was using the alignment of a complete object instead of the non-virtual alignment. This commit fixes the bug. rdar://problem/36382481 Differential Revision: https://reviews.llvm.org/D42521 llvm-svn: 323578
* Always allow "#pragma region".Matt Davis2018-01-272-2/+9
| | | | | | | | | | | | | | | | | | | | | Summary: Both MS and PS4 targets are capable of recognizing the existence of: #pragma region, #pragma endregion. Since this pragma is only a hint for certain editors, and has no logic, it seems helpful to permit this pragma in all cases, not just MS compatibility mode. Reviewers: rnk, rsmith, majnemer Reviewed By: majnemer Subscribers: Quuxplusone, probinson, majnemer, cfe-commits Differential Revision: https://reviews.llvm.org/D42248 llvm-svn: 323577
* Try to unbreak 32 bit builds after r323528.Benjamin Kramer2018-01-261-3/+6
| | | | llvm-svn: 323554
* [X86] Add 'rdrnd' feature to silvermont to match recent gcc bug fix.Craig Topper2018-01-262-1/+3
| | | | | | gcc recently fixed this bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83546 llvm-svn: 323552
* [index] Fix crash when indexing a C++14 PCH/module related to ↵Argyrios Kyrtzidis2018-01-263-3/+25
| | | | | | | | | | | | | TemplateTemplateParmDecls of alias templates TemplateTemplateParmDecls of alias templates ended-up serialized as 'file-level decls' which was causing a crash while trying to index a PCH/module file that contained them. Commit makes sure TemplateTemplateParmDecls are not recorded as such kind of decls. Fixes crash of rdar://36608297 Differential Revision: https://reviews.llvm.org/D42588 llvm-svn: 323549
* AST: support protocol conformances on id/class/interfaces in MS ABISaleem Abdulrasool2018-01-262-3/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for mangling ObjC protocol conformances in MS ABI as if they are COM interfaces. By diverging from the itanium mangling of `objc_protocol` prefixed names, this approach allows for a semi-reasonable, albeit of questionable sanity, undecoration via existing tooling. There is also the possibility of adding an extension and taking part of the namespace to add the conformance via the `L` and `Z` "modifiers", but the existing tooling would not be able to properly undecorated the symbol even though incidentally `undname` currently produces something legible while wine's implementation is not able to cope with the extension. This allows for the disambiguation of overloads where the parameter differs only in the protocol conformance of the ObjC type, e.g. ``` @protocol P; void f(std::vector<id>); void f(std::vector<id<P>>); ``` which clang would previously fail due to the mangling being identical as the protocol conformance was ignored. llvm-svn: 323547
* [X86] Define __IBT__ when -mibt is specified.Craig Topper2018-01-262-2/+8
| | | | llvm-svn: 323543
* clang-format: [JS] Prevent ASI before [ and (.Martin Probst2018-01-262-3/+8
| | | | | | | | | | | | | | | Summary: JavaScript automatic semicolon insertion can trigger before [ and (, so avoid breaking before them if the previous token is likely to terminate an expression. Reviewers: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42570 llvm-svn: 323532
* [AST] Use bit packing to reduce sizeof(TypedefNameDecl) from 88 to 80.Benjamin Kramer2018-01-262-20/+21
| | | | | | | | We can stash the cached transparent tag bit in existing pointer padding. Everything coming out of ASTContext is always aligned to a multiple of 8, so we have 8 spare bits. llvm-svn: 323528
* [ASTImporter] avoid warnings: unused var, switch coveredSam McCall2018-01-262-8/+6
| | | | llvm-svn: 323524
* [OpenCL] Add "cles_khr_int64" extension.Alexey Bader2018-01-262-0/+12
| | | | | | | | | | | | | | | | | | | Summary: For OpenCL 1.1 embedded profile 64 bit integers i.e. long, ulong including the appropriate vector data types and operations on 64-bit integers are optional. The "cles_khr_int64" extension string will be reported if the embedded profile implementation supports 64-bit integers. Reviewers: Anastasia, bader Reviewed By: Anastasia, bader Subscribers: bader, yaxunl, Anastasia, cfe-commits Differential Revision: https://reviews.llvm.org/D42532 llvm-svn: 323522
* [ASTImporter] Support LambdaExprs and improve template supportAleksei Sidorin2018-01-2613-87/+435
| | | | | | | | | | | | | | Also, a number of style and bug fixes was done: * ASTImporterTest: added sanity check for source node * ExternalASTMerger: better lookup for template specializations * ASTImporter: don't add templated declarations into DeclContext * ASTImporter: introduce a helper, ImportTemplateArgumentListInfo getting SourceLocations * ASTImporter: proper set ParmVarDecls for imported FunctionProtoTypeLoc Differential Revision: https://reviews.llvm.org/D42301 llvm-svn: 323519
* [Tooling] Test more APIs of ToolExecutor. NFC.Eric Liu2018-01-261-3/+8
| | | | llvm-svn: 323517
* [NFC] fix trivial typos in comments and documentsHiroshi Inoue2018-01-269-9/+9
| | | | | | "in in" -> "in", "on on" -> "on" etc. llvm-svn: 323509
* [Driver] Add an -fexperimental-isel driver option to enable/disable GlobalISel.Amara Emerson2018-01-265-0/+70
| | | | | | Differential Revision: https://reviews.llvm.org/D42276 llvm-svn: 323485
* Don't let test write to the source dir after r323426.Nico Weber2018-01-251-11/+11
| | | | llvm-svn: 323473
* AST: inline a single-use variable (NFC)Saleem Abdulrasool2018-01-251-2/+1
| | | | | | Inline the single use variable into the only use. NFC. llvm-svn: 323461
* Unused diagnostics can occur in tblgen.Benjamin Kramer2018-01-251-1/+1
| | | | llvm-svn: 323435
* [clang-cl] Add support for /arch:AVX512F and /arch:AVX512Nico Weber2018-01-252-5/+46
| | | | | | | | | | | | | | | | | | | | | For /arch:AVX512F: clang-cl and cl.exe both defines __AVX512F__ __AVX512CD__. clang-cl also defines __AVX512ER__ __AVX512PF__. 64-bit cl.exe also defines (according to /Bz) _NO_PREFETCHW. For /arch:AVX512: clang-cl and cl.exe both define __AVX512F__ __AVX512CD__ __AVX512BW__ __AVX512DQ__ __AVX512VL__. 64-bit cl.exe also defines _NO_PREFETCHW. So not 100% identical, but pretty close. Also refactor the existing AVX / AVX2 code to not repeat itself in both the 32-bit and 64-bit cases. https://reviews.llvm.org/D42538 llvm-svn: 323433
* clang-cl: Simplify handling of /arch: flag.Nico Weber2018-01-252-78/+60
| | | | | | | | | | | | | | | | | | | r213083 initially implemented /arch: support by mapping it to CPU features. Then r241077 additionally mapped it to CPU, which made the feature flags redundant (if harmless). This change here removes the redundant mapping to feature flags, and rewrites test/Driver/cl-x86-flags.c to be a bit more of an integration test that checks for preprocessor defines like AVX (like documented on MSDN) instead of for driver flags. To keep emitting warn_drv_unused_argument, use getLastArgNoClaim() followed by an explicit claim() if needed. This is in preparation for adding support for /arch:AVX512(F). No intended behavior change. https://reviews.llvm.org/D42497 llvm-svn: 323426
* [CodeGen] Decorate aggregate accesses with TBAA tagsIvan A. Kosarev2018-01-2516-97/+219
| | | | | | Differential Revision: https://reviews.llvm.org/D41539 llvm-svn: 323421
* [clang-format] Fixes indentation of inner text proto messagesKrasimir Georgiev2018-01-252-7/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Consider the text proto: ``` message { sub { key: value } } ``` Previously the first `{` was TT_Unknown, which caused the inner message to be indented by the continuation width. This didn't happen for: ``` message { sub: { key: value } } ``` This is because the code to mark the first `{` as a TT_DictLiteral was only considering the case where it marches forward and reaches a `:`. This patch updates this by looking not only for `:`, but also for `<` and `{`. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42500 llvm-svn: 323419
* [Driver] Add support for mips32 and scudoSimon Dardis2018-01-252-1/+7
| | | | | | | | | | | r317337 missed that scudo is supported on MIPS32, so permit that option for MIPS32. Reviewers: cryptoad, atanasyan Differential Revision: https://reviews.llvm.org/D42416 llvm-svn: 323412
* FreeBSD needs also execinfo (in sanitizers)Kamil Rytarowski2018-01-241-2/+3
| | | | | | | | | | | | | | | | Summary: As NetBSD, FreeBSD needs execinfo for backtrace's matters. Patch by: David CARLIER. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: emaste, krytarowski, cfe-commits Differential Revision: https://reviews.llvm.org/D42467 llvm-svn: 323387
* [analyzer] Do not attempt to get the pointee of void*Alexander Shaposhnikov2018-01-242-0/+15
| | | | | | | | | | | | Do not attempt to get the pointee of void* while generating a bug report (otherwise it will trigger an assert inside RegionStoreManager::getBinding assert(!T->isVoidType() && "Attempting to dereference a void pointer!")). Test plan: make check-all Differential revision: https://reviews.llvm.org/D42396 llvm-svn: 323382
* [coroutines] Pass coro func args to promise ctorBrian Gesiak2018-01-248-36/+200
| | | | | | | | | | | | | | | | | | | Summary: Use corutine function arguments to initialize a promise type, but only if the promise type defines a constructor that takes those arguments. Otherwise, fall back to the default constructor. Test Plan: check-clang Reviewers: rsmith, GorNishanov, eric_niebler Reviewed By: GorNishanov Subscribers: toby-allsopp, lewissbaker, EricWF, cfe-commits Differential Revision: https://reviews.llvm.org/D41820 llvm-svn: 323381
* [analyzer] NFC: Run many existing C++ tests with a custom operator new().Artem Dergachev2018-01-2411-3/+40
| | | | | | | | | | | In order to provide more test coverage for inlined operator new(), add more run-lines to existing test cases, which would trigger our fake header to provide a body for operator new(). Most of the code should still behave reasonably. When behavior intentionally changes, #ifs are provided. Differential Revision: https://reviews.llvm.org/D42221 llvm-svn: 323376
* [analyzer] Enable c++-allocator-inlining by default.Artem Dergachev2018-01-245-13/+13
| | | | | | | | | | | | | | | | | | | | | | This allows the analyzer to analyze ("inline") custom operator new() calls and, even more importantly, inline constructors of objects that were allocated by any operator new() - not necessarily a custom one. All changes in the tests in the current commit are intended improvements, even if they didn't carry any explicit FIXME flag. It is possible to restore the old behavior via -analyzer-config c++-allocator-inlining=false (this flag is supported by scan-build as well, and it can be into a clang --analyze invocation via -Xclang .. -Xclang ..). There is no intention to remove the old behavior for now. Differential Revision: https://reviews.llvm.org/D42219 rdar://problem/12180598 llvm-svn: 323373
* [analyzer] Assume that the allocated value is non-null before construction.Artem Dergachev2018-01-244-19/+90
| | | | | | | | | | | | | | | | | | I.e. not after. In the c++-allocator-inlining=true mode, we need to make the assumption that the conservatively evaluated operator new() has returned a non-null value. Previously we did this on CXXNewExpr, but now we have to do that before calling the constructor, because some clever constructors are sometimes assuming that their "this" is null and doing weird stuff. We would also crash upon evaluating CXXNewExpr when the allocator was inlined and returned null and had a throw specification; this is UB even for custom allocators, but we still need not to crash. Added more FIXME tests to ensure that eventually we fix calling the constructor for null return values. Differential Revision: https://reviews.llvm.org/D42192 llvm-svn: 323370
* Revert r323051 "[cmake] Use CLANG_BINARY_DIR to determine the build directory."Vassil Vassilev2018-01-241-1/+1
| | | | | | | | This broke swift builds. Thanks for the post-commit review of Chris Bieneman and Davide Italiano! llvm-svn: 323368
* IRGen: Emit an inline implementation of __builtin_wmemcmp on MSVCRT platforms.Peter Collingbourne2018-01-242-0/+94
| | | | | | | | | The MSVC runtime library does not provide a definition of wmemcmp, so we need an inline implementation. Differential Revision: https://reviews.llvm.org/D42441 llvm-svn: 323362
* Don't create hidden dllimport global values.Rafael Espindola2018-01-242-0/+12
| | | | | | | | Hidden visibility is almost the opposite of dllimport. We were producing them before (dllimport wins in the existing llvm implementation), but now the llvm verifier produces an error. llvm-svn: 323361
* [Hexagon] Accept lowercase b in -hvx-length=64b and -hvx-length=128bKrzysztof Parzyszek2018-01-242-3/+8
| | | | llvm-svn: 323360
* [CodeComplete] only respect LoadExternal hint at namespace/tu scopeSam McCall2018-01-244-8/+16
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42428 llvm-svn: 323347
* [CUDA] Disable PGO and coverage instrumentation in NVPTX.Artem Belevich2018-01-242-1/+39
| | | | | | | | | | | | NVPTX does not have runtime support necessary for profiling to work and even call arc collection is prohibitively expensive. Furthermore, there's no easy way to collect the samples. NVPTX also does not support global constructors that clang generates if sample/arc collection is enabled. Differential Revision: https://reviews.llvm.org/D42452 llvm-svn: 323345
* clang-cl: Parse /permissive-, /Bt, Bt+ (PR32672)Hans Wennborg2018-01-242-0/+6
| | | | llvm-svn: 323330
* [clang-format] Disable string literal breaking for text protosKrasimir Georgiev2018-01-241-0/+6
| | | | | | | | | | | | | | | | Summary: Commonly string literals in protos are already multiline, so breaking them further is undesirable. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D42373 llvm-svn: 323319
* Fix typos of occurred and occurrenceMalcolm Parsons2018-01-249-11/+11
| | | | llvm-svn: 323316
* Refactor RecursiveASTVisitor test for post-order traversalRaphael Isemann2018-01-244-129/+117
| | | | | | | | | | | | Summary: The new test is now in the right directory with the other ASTVisitor tests and uses now the provided TestVisitor framework. Subscribers: hintonda, v.g.vassilev, klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D37557 llvm-svn: 323310
* Attempt to fix implicit-fallthrough warning after r323218.Nico Weber2018-01-241-0/+1
| | | | llvm-svn: 323294
* Fix typo in comment.Nico Weber2018-01-241-1/+1
| | | | llvm-svn: 323293
* Fix test Driver/solaris-ld.c for Windows.Douglas Yung2018-01-241-33/+33
| | | | | | | | | - Test needs to be able to handle "clang.exe" on Windows - Test needs to be able to handle either '/' or '\\' used as the path separator Reviewed by Paul Robinson llvm-svn: 323285
* Adjust MaxAtomicInlineWidth for i386/i486 targets.Wei Mi2018-01-232-5/+65
| | | | | | | | | | | | | | This is to fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6. Currently, all MaxAtomicInlineWidth of x86-32 targets are set to 64. However, i386 doesn't support any cmpxchg related instructions. i486 only supports cmpxchg. So in this patch MaxAtomicInlineWidth is reset as follows: For i386, the MaxAtomicInlineWidth should be 0 because no cmpxchg is supported. For i486, the MaxAtomicInlineWidth should be 32 because it supports cmpxchg. For others 32 bits x86 cpu, the MaxAtomicInlineWidth should be 64 because of cmpxchg8b. Differential Revision: https://reviews.llvm.org/D42154 llvm-svn: 323281
* Fix test Driver/solaris-ld.cRichard Trieu2018-01-231-5/+5
| | | | | | Allow test to accept calls to ld without full path. llvm-svn: 323267
* AST: correct mangling for SEL on MS ABISaleem Abdulrasool2018-01-232-1/+45
| | | | | | | | We would previously treat `SEL` as a pointer-only type. This is not the case. It should be treated similarly to `id` and `Class`. Add some test cases to ensure that it will be properly handled as well. llvm-svn: 323257
* [WebAssembly] Factor out settings common to wasm32 and wasm64. NFC.Dan Gohman2018-01-231-2/+1
| | | | | | | MaxAtomicPromoteWidth and MaxAtomicInlineWidth are 64 on both wasm32 and wasm64, so they can be set in shared code. llvm-svn: 323253
* [analyzer] Mark lines as relevant even if they weren't executed but have a ↵George Karpenkov2018-01-232-92/+125
| | | | | | | | label attached Differential Revision: https://reviews.llvm.org/D42320 llvm-svn: 323251
* CodeGen: use `llvm.used` for ObjC protocolsSaleem Abdulrasool2018-01-232-7/+9
| | | | | | | | | These symbols are supposed to be preserved even by the linker. Use the `llvm.used` to ensure that the symbols are not removed by DCE in the linker. This should be a no-op change on MachO since the symbols are annotated as `no_dead_strip`. llvm-svn: 323247
* [analyzer] Show full analyzer invocation for reproducibility in HTML reportsGeorge Karpenkov2018-01-234-1/+38
| | | | | | | | | | | | Analyzing problems which appear in scan-build results can be very difficult, as after the launch no exact invocation is stored, and it's super-hard to launch the debugger. With this patch, the exact analyzer invocation appears in the footer, and can be copied to debug/check reproducibility/etc. rdar://35980230 llvm-svn: 323245
OpenPOWER on IntegriCloud