summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* GlobalISel (AArch64): fix ABI at border between GPRs and SP.Tim Northover2017-08-171-1/+1
| | | | | | | | If a struct would end up half in GPRs and half on SP the ABI says it should actually go entirely on the stack. We were getting this wrong in GlobalISel before, causing compatibility issues. llvm-svn: 311137
* PR34161: support evaluation of 'void()' expressions in C++14 onwards.Richard Smith2017-08-171-0/+2
| | | | llvm-svn: 311115
* Unguarded availability diagnoser should use TraverseStmt instead ofAlex Lorenz2017-08-171-2/+1
| | | | | | | | | Base::TraverseStmt when visiting the then/else branches of if statements This ensures that the statement stack is correctly tracked and correct multi-statement fixit is generated inside of an if (@available) llvm-svn: 311088
* Print enum constant values using the original source formattingAlex Lorenz2017-08-173-18/+45
| | | | | | | | if possible when creating "Declaration" nodes in XML comments rdar://14765746 llvm-svn: 311085
* Fix undefined behavior that is caused by not always initializing a bool.Daniel Jasper2017-08-171-0/+1
| | | | | | | The fix in r310994 is incomplete, as moveFromAndCancel can set the pointer without initializing OldIsSpeculativelyEvaluating. llvm-svn: 311070
* Further refactoring of the constant emitter. NFC.John McCall2017-08-171-166/+288
| | | | llvm-svn: 311065
* [analyzer] Add support for reference counting of parameters on the callee sideDevin Coughlin2017-08-171-9/+90
| | | | | | | | | | | | | | | This commit adds the functionality of performing reference counting on the callee side for Integer Set Library (ISL) to Clang Static Analyzer's RetainCountChecker. Reference counting on the callee side can be extensively used to perform debugging within a function (For example: Finding leaks on error paths). Patch by Malhar Thakkar! Differential Revision: https://reviews.llvm.org/D36441 llvm-svn: 311063
* [index] Add indexing for unresolved-using declarationsBen Langmuir2017-08-163-15/+66
| | | | | | | | | | | In dependent contexts we end up referencing these, so make sure they have USRs, and have their declarations indexed. For the most part they behave like typedefs, but we also need to worry about having multiple using declarations with the same "name". rdar://problem/33883650 llvm-svn: 311053
* Fix typos in comments; NFCGeorge Burgess IV2017-08-161-1/+1
| | | | llvm-svn: 311051
* Base optimization-record file names on the final outputHal Finkel2017-08-161-4/+7
| | | | | | | | | | | | | | Using Output.getFilename() to construct the file name used for optimization recording in Clang::ConstructJob, when -c is provided, does not work correctly if we're not using the integrated assembler. With -no-integrated-as (or -save-temps) Output.getFilename() gives the name of the temporary assembly file, not the final output file. Instead, use the final output (as provided by -o). If this is not available, then fall back to using a name based on the input file. Fixes PR31532. llvm-svn: 311041
* Use the file name from linemarker for debug info if an input is preprocessed ↵Taewook Oh2017-08-161-0/+11
| | | | | | | | | | | | | | | | | | | source. Summary: Even in the case of the input file is a preprocessed source, clang uses the file name of the preprocesses source for debug info (DW_AT_name attribute for DW_TAG_compile_unit). However, gcc uses the file name specified in the first linemarker instead. This makes more sense because the one specified in the linemarker represents the "actual" source file name. Clang already uses the file name specified in the first linemarker for Module name (https://github.com/llvm-mirror/clang/blob/master/lib/Frontend/FrontendAction.cpp#L779) if the input is preprocessed. This patch makes clang to use the same value for debug info as well. Reviewers: compnerd, rnk, dblaikie, rsmith Reviewed By: rnk Subscribers: aprantl, cfe-commits Differential Revision: https://reviews.llvm.org/D36474 llvm-svn: 311037
* [Driver] SafeStack does not need a runtime library on FuchsiaPetr Hosek2017-08-161-0/+5
| | | | | | | | Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D36779 llvm-svn: 311034
* [OPENMP] Fix for PR28581: OpenMP linear clause - wrong results.Alexey Bataev2017-08-162-6/+11
| | | | | | | | | | If worksharing construct has at least one linear item, an implicit synchronization point must be emitted to avoid possible conflict with the loading/storing values to the original variables. Added implicit barrier if the linear item is found before actual start of the worksharing construct. llvm-svn: 311013
* [OPRNMP] Fix for PR33445: ICE: OpenMP target containing ordered for.Alexey Bataev2017-08-161-12/+15
| | | | | | | | | | | If exceptions are enabled, there may be a problem with the codegen of the finalization functions from OpenMP runtime. It happens because of the problem with the getting of thread identifier value. Patch tries to fix it by using the result of the call of function __kmpc_global_thread_num() rather than loading of value of outlined function parameter. llvm-svn: 311007
* Fix a UBSan failure where this boolean was copied when uninitialized.Chandler Carruth2017-08-161-1/+1
| | | | | | | | | When r310905 moved the pointer and bool out of a PointerIntPair, it made them end up uninitialized and caused UBSan failures when copying the uninitialized boolean. However, making the pointer be null should avoid the reference to the boolean entirely. llvm-svn: 310994
* Fix comments about __OPENCL_MEMORY_SCOPE_* macrosYaxun Liu2017-08-161-1/+1
| | | | llvm-svn: 310986
* PR19668, PR23034: Fix handling of move constructors and deleted copyRichard Smith2017-08-168-73/+127
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | constructors when deciding whether classes should be passed indirectly. This fixes ABI differences between Clang and GCC: * Previously, Clang ignored the move constructor when making this determination. It now takes the move constructor into account, per https://github.com/itanium-cxx-abi/cxx-abi/pull/17 (this change may seem recent, but the ABI change was agreed on the Itanium C++ ABI list a long time ago). * Previously, Clang's behavior when the copy constructor was deleted was unstable -- depending on whether the lazy declaration of the copy constructor had been triggered, you might get different behavior. We now eagerly declare the copy constructor whenever its deletedness is unclear, and ignore deleted copy/move constructors when looking for a trivial such constructor. This also fixes an ABI difference between Clang and MSVC: * If the copy constructor would be implicitly deleted (but has not been lazily declared yet), for instance because the class has an rvalue reference member, we would pass it directly. We now pass such a class indirectly, matching MSVC. Based on a patch by Vassil Vassilev, which was based on a patch by Bernd Schmidt, which was based on a patch by Reid Kleckner! This is a re-commit of r310401, which was reverted in r310464 due to ARM failures (which should now be fixed). llvm-svn: 310983
* Revert "Revert "Revert "Fix LLVMgold plugin name/path for non-Linux."""Dan Albert2017-08-151-14/+2
| | | | llvm-svn: 310977
* Do not look through pack expansions when looking for unexpanded parameter packs.Richard Smith2017-08-151-18/+64
| | | | | | | Fixes a selection of rejects-valids when pack-expanding a lambda that itself contains a pack expansion. llvm-svn: 310972
* Extract IRGen's constant-emitter into its own helper class and clean upJohn McCall2017-08-1511-289/+811
| | | | | | | | | | | | the interface. The ultimate goal here is to make it easier to do some more interesting things in constant emission, like emit constant initializers that have ignorable side-effects, or doing the majority of an initialization in-place and then patching up the last few things with calls. But for now this is mostly just a refactoring. llvm-svn: 310964
* Allow the target field of a CK_ToUnion to be more easily recovered.John McCall2017-08-152-13/+26
| | | | llvm-svn: 310963
* Revert "Revert "Fix LLVMgold plugin name/path for non-Linux.""Dan Albert2017-08-151-2/+14
| | | | | | | | | | | | | | | | | | | Summary: Relanding https://reviews.llvm.org/D35739 which was reverted because it broke the tests on non-Linux. The tests have been fixed to be platform agnostic, and additional tests have been added to make sure that the plugin has the correct extension on each platform (%pluginext doesn't work in CHECK lines). Reviewers: srhines, pirama Reviewed By: srhines Subscribers: emaste, mehdi_amini, eraman, cfe-commits Differential Revision: https://reviews.llvm.org/D36769 llvm-svn: 310960
* Switch to consumeError(), since this can crash otherwise.Stephen Hines2017-08-151-1/+1
| | | | | | | | | | | | | | | | | Summary: If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled, this will cause an issue with an unchecked Success. Switching to consumeError() is the correct way to bypass the check. Reviewers: llvm-commits, cfe-commits, arphaman Reviewed By: arphaman Subscribers: arphaman, klimek, pirama Differential Revision: https://reviews.llvm.org/D36728 llvm-svn: 310958
* [clang] Code cleanup in clang/toolingAlexander Shaposhnikov2017-08-151-1/+1
| | | | | | | | | 1. Add missing explicit for SymbolName constructor. 2. Add missing std::move in createRenameReplacements. Differential revision: https://reviews.llvm.org/D36715 llvm-svn: 310948
* PR33082: Improve tracking of unexpanded parameter packs within variadic ↵Richard Smith2017-08-151-39/+87
| | | | | | generic lambdas. llvm-svn: 310946
* [index] Update indexing to handle CXXDeductionGuideDecls properlyArgyrios Kyrtzidis2017-08-153-4/+17
| | | | | | | | | | | CXXDeductionGuideDecls can't be referenced so there's no need to output a symbol occurrence for them. Also handle DeducedTemplateSpecializationTypeLocs in the TypeIndexer so we don't miss the symbol occurrences of the corresponding template decls. Patch by Nathan Hawes! Differential Revision: https://reviews.llvm.org/D36641 llvm-svn: 310933
* [OpenCL] Support variable memory scope in atomic builtinsYaxun Liu2017-08-154-64/+101
| | | | | | Differential Revision: https://reviews.llvm.org/D36580 llvm-svn: 310924
* Allow pretty platform names in availability attributesAlex Lorenz2017-08-151-7/+12
| | | | | | rdar://32076651 llvm-svn: 310921
* [OPENMP] Fix compiler crash on argument translate for NVPTX.Alexey Bataev2017-08-151-0/+5
| | | | | | | | When translating arguments for NVPTX target it is not taken into account that function may have variable number of arguments. Patch fixes this problem. llvm-svn: 310920
* [Sema] Silence -Wobjc-missing-property-synthesis for unavailable propertiesAlex Lorenz2017-08-151-1/+1
| | | | | | rdar://30296911 llvm-svn: 310916
* [OpenCL] Allow targets to select address space per typeSven van Haastregt2017-08-157-39/+67
| | | | | | | | | | | | | Generalize getOpenCLImageAddrSpace into getOpenCLTypeAddrSpace, such that targets can select the address space per type. No functional changes intended. Initial patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D33989 llvm-svn: 310911
* Avoid PointerIntPair of constexpr EvalInfo structsReid Kleckner2017-08-151-13/+11
| | | | | | | | | | | | | | They are stack allocated, so their alignment is not to be trusted. 32-bit MSVC only guarantees 4 byte stack alignment, even though alignof would tell you otherwise. I tried fixing this with __declspec align, but that apparently upsets GCC. Hopefully this version will satisfy all compilers. See PR32018 for some info about the mingw issues. Should supercede https://reviews.llvm.org/D34873 llvm-svn: 310905
* Revert "Fix LLVMgold plugin name/path for non-Linux."Dan Albert2017-08-151-14/+2
| | | | | | Broke a test. Will fix the test and re-land later. llvm-svn: 310903
* Fix LLVMgold plugin name/path for non-Linux.Dan Albert2017-08-141-2/+14
| | | | | | | | | | | | | | | | | | Summary: It's only named LLVMgold.so on Linux. Fix the name for Windows and Darwin. Also fix the path for Windows so binutils doesn't have to. Reviewers: srhines, pirama Reviewed By: srhines Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35739 llvm-svn: 310895
* [analyzer] Fix SimpleSValBuilder::simplifySValAlexander Shaposhnikov2017-08-141-1/+2
| | | | | | | | | | This diff fixes a crash (triggered assert) on the newly added test case. In the method Simplifier::VisitSymbolData we check the type of S and return Loc/NonLoc accordingly. Differential revision: https://reviews.llvm.org/D36564 llvm-svn: 310887
* [Sema] Improve some -Wunguarded-availability diagnosticsErik Pilkington2017-08-141-75/+78
| | | | | | | rdar://33543523 Differential revision: https://reviews.llvm.org/D36200 llvm-svn: 310874
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-08-143-112/+134
| | | | | | | | | | | | | __kmpc_for_static_init(). OpenMP 5.0 will include OpenMP Tools interface that requires distinguishing different worksharing constructs. Since the same entry point (__kmp_for_static_init(ident_t *loc, kmp_int32 global_tid,........)) is called in case static loop/sections/distribute it is suggested using 'flags' field of the ident_t structure to pass the type of the construct. llvm-svn: 310865
* [rename] Introduce symbol occurrencesAlex Lorenz2017-08-144-39/+108
| | | | | | | | | | | Symbol occurrences store the results of local rename and will also be used for the global, indexed rename results. Their kind is used to determine whether they should be renamed automatically or not. They can be converted to a set of AtomicChanges as well. Differential Revision: https://reviews.llvm.org/D36156 llvm-svn: 310853
* clang-format: [JS] wrap optional properties in type aliases.Martin Probst2017-08-141-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: clang-format wraps object literal keys in an object literal if they are marked as `TT_SelectorName`s and/or the colon is marked as `TT_DictLiteral`. Previously, clang-format would accidentally work because colons in type aliases were marked as `TT_DictLiteral`. r310367 fixed this to assing `TT_JsTypeColon`, which broke wrapping in certain situations. However the root cause was that clang-format incorrectly didn't skip questionmarks when detecting selector name. This change fixes both locations to (1) assign `TT_SelectorName` and (2) treat `TT_JsTypeColon` like `TT_DictLiteral`. Previously: type X = { a: string, b?: string, }; Now: type X = { a: string, b?: string, }; Reviewers: djasper, sammccall Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D36684 llvm-svn: 310852
* clang-format: [JS] do not insert whitespace in call positions.Martin Probst2017-08-141-7/+14
| | | | | | | | | | | | | | | | | | | | Summary: In JavaScript, may keywords can be used in method names and thus call sites: foo.delete(); foo.instanceof(); clang-format would previously insert whitespace after the `instanceof`. This change generically skips inserting whitespace between a keyword and a parenthesis if preceded by a dot, i.e. in a callsite. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D36142 llvm-svn: 310851
* [OPENMP][DEBUG] Fix for PR33676: Debug info for OpenMP region is broken.Alexey Bataev2017-08-142-3/+2
| | | | | | | After some changes in clang/LLVM debug info for task-based regions was not generated at all. Patch fixes this problem. llvm-svn: 310850
* [OPENMP] Generalization of calls of the outlined functions.Alexey Bataev2017-08-145-50/+64
| | | | | | General improvement of the outlined functions calls. llvm-svn: 310840
* clang-format: Fix left pointer alignment after delctype/typeofKrasimir Georgiev2017-08-141-8/+19
| | | | | | | | | | | | | Change 272124* introduced a regression in spaceRequiredBetween for left aligned pointers to decltype and typeof expressions. This fix adds logic to fix this. The test added is based on a related test in determineStarAmpUsage. Also add test cases for the regression. http://llvm.org/viewvc/llvm-project?view=revision&revision=272124 LLVM bug tracker: https://bugs.llvm.org/show_bug.cgi?id=30407 Differential revision: https://reviews.llvm.org/D35847 Fix contributed by euhlmann! llvm-svn: 310831
* Set the lexical context for dummy tag decl inside createTagFromNewDeclAlex Lorenz2017-08-141-1/+1
| | | | | | | This is a follow-up to r310706. This change has been recommended by Bruno Cardoso Lopes and Richard Smith. llvm-svn: 310829
* [analyzer] Rename functions responsible for CFG-based suppress-on-sink.Artem Dergachev2017-08-141-13/+21
| | | | | | | | | Update comments. No functional change intended. Addresses Devin's post-commit review comments in https://reviews.llvm.org/D35673 and https://reviews.llvm.org/D35674. llvm-svn: 310820
* Fix memory leak in ToolChain::TranslateOpenMPTargetArgsJonas Hahnfeld2017-08-141-1/+5
| | | | | | | rL310433 introduced a code path where DAL is not returned and must be freed. This change allows to run openmp-offload.c when Clang is built with ASan. llvm-svn: 310817
* Rename cxx1z -> cxx17 across all diagnostic IDs.Richard Smith2017-08-137-9/+9
| | | | llvm-svn: 310805
* [c++2a] Treat 'concept' and 'requires' as keywords, add compat warning for ↵Richard Smith2017-08-132-2/+8
| | | | | | C++17 and before. llvm-svn: 310803
* [AArch64] Add support for a MinGW AArch64 targetMartin Storsjo2017-08-135-30/+92
| | | | | | Differential Revision: https://reviews.llvm.org/D36364 llvm-svn: 310798
* PR34163: Don't cache an incorrect key function for a class if queried betweenRichard Smith2017-08-124-22/+13
| | | | | | | | | | | the class becoming complete and its inline methods being parsed. This replaces the hack of using the "late parsed template" flag to track member functions with bodies we've not parsed yet; instead we now use the "will have body" flag, which carries the desired implication that the function declaration *is* a definition, and that we've just not parsed its body yet. llvm-svn: 310776
OpenPOWER on IntegriCloud