summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix unused-variable compilation error.Haojian Wu2017-06-211-0/+2
| | | | llvm-svn: 305898
* [analyzer] LocalizationChecker: Support new localizable APIs.Artem Dergachev2017-06-211-0/+43
| | | | | | | | | | | | Add support for new methods that were added in macOS High Sierra & iOS 11 and require a localized string. Patch by Kulpreet Chilana! rdar://problem/32795210 Differential Revision: https://reviews.llvm.org/D34266 llvm-svn: 305896
* Revert r305678: [driver][macOS] Pick the system version for theAlex Lorenz2017-06-211-22/+1
| | | | | | | | | | | | | deployment target if the SDK is newer than the system This commit also reverts follow-up commits r305680 and r305685 that have buildbot fixes. The change in r305678 wasn't correct because it relied on `llvm::sys::getProcessTriple`, which uses a pre-configured OS version. We should lookup the actual macOS version of the system on which the compiler is running. llvm-svn: 305891
* Moved code hanlding precompiled preamble out of the ASTUnit.Ilya Biryukov2017-06-213-589/+779
| | | | | | | | | | | | Reviewers: bkramer, krasimir, arphaman, akyrtzi, klimek Reviewed By: klimek Subscribers: mgorny, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D34287 llvm-svn: 305890
* Changed wording in commentRaphael Isemann2017-06-211-2/+1
| | | | llvm-svn: 305878
* Support MS builtins using 'long' on LP64 platformsBruno Cardoso Lopes2017-06-211-1/+13
| | | | | | | | | | | | | | | This allows for -fms-extensions to work the same on LP64. For example, _BitScanReverse is expected to be 32-bit, matching Windows/LLP64, even though long is 64-bit on x86_64 Darwin or Linux (LP64). Implement this by adding a new character code 'N', which is 'int' if the target is LP64 and the same 'L' otherwise Differential Revision: https://reviews.llvm.org/D34377 rdar://problem/32599746 llvm-svn: 305875
* [ODRHash] Supply more information when generic error message is emitted.Richard Trieu2017-06-211-0/+11
| | | | llvm-svn: 305872
* Prevent devirtualization of calls to un-instantiated functions.Sunil Srivastava2017-06-204-2/+19
| | | | | | | | PR 27895 Differential Revision: https://reviews.llvm.org/D22057 llvm-svn: 305862
* Special-case handling of destructors in override lists when dumping ASTs.Lang Hames2017-06-201-3/+6
| | | | | | | Fixes a bug in r305850: CXXDestructors don't have names, so we need to handle printing of them separately. llvm-svn: 305860
* Preserve CXX method overrides in ASTImporterLang Hames2017-06-202-0/+36
| | | | | | | | | | | | | | Summary: The ASTImporter should import CXX method overrides from the source context when it imports a method decl. Reviewers: spyffe, rsmith, doug.gregor Reviewed By: spyffe Differential Revision: https://reviews.llvm.org/D34371 llvm-svn: 305850
* [clang] Fix format specifiers fixits for nested macrosAlexander Shaposhnikov2017-06-201-11/+16
| | | | | | | | | | | | | | ExpansionLoc was previously calculated incorrectly in the case of nested macros expansions. In this diff we build the stack of expansions where the last one is the actual expansion which should be used for grouping together the edits. The definition of MacroArgUse is adjusted accordingly. Test plan: make check-all Differential revision: https://reviews.llvm.org/D34268 llvm-svn: 305845
* [AArch64] ADD ARMv.2-A FP16 vector intrinsicsAbderrazek Zaafrani2017-06-204-7/+189
| | | | | | Differential Revision: https://reviews.llvm.org/D34161 llvm-svn: 305820
* Fix for Bug 33471: Preventing operator auto from resolving to a template ↵Erich Keane2017-06-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | operator. As the bug report says, struct A { template<typename T> operator T(); }; void foo() { A().operator auto(); } causes: "undeduced type in IR-generation UNREACHABLE executed at llvm/tools/clang/lib/CodeGen/CodeGenFunction.cpp:208!" The problem is that in this case, "T" is being deduced as "auto", which I believe is incorrect. The 'operator auto' implementation in Clang is standards compliant, however there is a defect report against core (1670). Differential Revision: https://reviews.llvm.org/D34370 llvm-svn: 305812
* [GSoC] Flag value completion for clangYuka Takahashi2017-06-202-5/+23
| | | | | | | | | | | | This is patch for GSoC project, bash-completion for clang. To use this on bash, please run `source clang/utils/bash-autocomplete.sh`. bash-autocomplete.sh is code for bash-completion. In this patch, Options.td was mainly changed in order to add value class in Options.inc. llvm-svn: 305805
* D31187: Fix removal of out-of-line definitions.Vassil Vassilev2017-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | Consider: struct MyClass { void f() {} } MyClass::f(){} // expected error redefinition of f. #1 Some clients (eg. cling) need to call removeDecl for the redefined (#1) decl. This patch enables us to remove the lookup entry is registered in the semantic decl context and not in the primary decl context of the lexical decl context where we currently are trying to remove it from. It is not trivial to test this piece and writing a full-blown unit test seems too much. llvm-svn: 305799
* [OpenCL] Diagnose scoped address-space qualified variablesAnastasia Stulova2017-06-201-2/+16
| | | | | | | | | | | | Produce an error if variables qualified with a local or a constant address space are not declared in the outermost scope of a kernel. Patch by Simon Perretta. Differential Revision: https://reviews.llvm.org/D34024 llvm-svn: 305798
* [preprocessor] When preprocessor option 'SingleFileParseMode' is enabled, ↵Argyrios Kyrtzidis2017-06-202-14/+53
| | | | | | | | | | parse all directive blocks if the condition uses undefined macros This is useful for being able to parse the preprocessor directive blocks even if the header, that defined the macro that is checked, hasn't been included. Differential Revision: https://reviews.llvm.org/D34263 llvm-svn: 305797
* [OpenCL] Fix OpenCL and SPIR version metadata generation.Alexey Bader2017-06-203-41/+37
| | | | | | | | | | | | | | Summary: OpenCL and SPIR version metadata must be generated once per module instead of once per mangled global value. Reviewers: Anastasia, yaxunl Reviewed By: Anastasia Subscribers: ahatanak, cfe-commits Differential Revision: https://reviews.llvm.org/D34235 llvm-svn: 305796
* [analyzer] Teach CloneDetection about Qt Meta-Object Compiler to filter auto ↵Leslie Zhai2017-06-202-2/+2
| | | | | | | | | | | | generated files Reviewers: v.g.vassilev, teemperor Reviewed By: teemperor Differential Revision: https://reviews.llvm.org/D34353 llvm-svn: 305774
* [analyzer] Check NULL pointer dereference issue for memset functionLeslie Zhai2017-06-201-0/+51
| | | | | | | | | | Reviewers: dcoughlin, zaks.anna, NoQ, danielmarjamaki Reviewed By: NoQ, danielmarjamaki Differential Revision: https://reviews.llvm.org/D31868 llvm-svn: 305773
* Turn off "disable free" mode when preprocessing imported module files inRichard Smith2017-06-201-0/+1
| | | | | | | | | -frewrite-imports mode. This could end up accumulating a very large amount of intermediate state. Clear it out after each module file is processed. llvm-svn: 305764
* Support non-identifier module names when preprocessing modules.Richard Smith2017-06-196-59/+112
| | | | llvm-svn: 305758
* [Clang] Handle interaction of -pg and no_instrument_function attribute.Manoj Gupta2017-06-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | Summary: Disable generation of counting-function attribute if no_instrument_function attribute is present in function. Interaction between -pg and no_instrument_function is the desired behavior and matches gcc as well. This is required for fixing a crash in Linux kernel when function tracing is enabled. Fixes PR33515. Reviewers: hfinkel, rengolin, srhines, hans Reviewed By: hfinkel Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34357 llvm-svn: 305728
* [Parser][ObjC] Use an artificial EOF token while parsing lexed ObjC methodsAlex Lorenz2017-06-191-1/+11
| | | | | | | | | | | This change avoid a crash that occurred when skipping to EOF while parsing an ObjC interface/implementation. rdar://31963299 Differential Revision: https://reviews.llvm.org/D34185 llvm-svn: 305719
* CodeGen: Cast temporary variable to proper address spaceYaxun Liu2017-06-194-42/+74
| | | | | | | | | | | | | | | | In C++ all variables are in default address space. Previously change has been made to cast automatic variables to default address space. However that is not sufficient since all temporary variables need to be casted to default address space. This patch casts all temporary variables to default address space except those for passing indirect arguments since they are only used for load/store. This patch only affects target having non-zero alloca address space. Differential Revision: https://reviews.llvm.org/D33706 llvm-svn: 305711
* clang-format: Fix C99 designated initializers corner casesFrancois Ferrand2017-06-193-6/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes the missing space before the designated initializer when `Cpp11BracedListStyle=false` : const struct A a = { .a = 1, .b = 2 }; ^ Also, wrapping between opening brace and designated array initializers used to have an excessive penalty (like breaking between an expression and the subscript operator), leading to unexpected wrapping: const struct Aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa = {[1] = aaaaaaaaaaaaaaaaaaaaaaaaaaa, [2] = bbbbbbbbbbbbbbbbbbbbbbbbbbb}; instead of: const struct Aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa = { [1] = aaaaaaaaaaaaaaaaaaaaaaaaaaa, [2] = bbbbbbbbbbbbbbbbbbbbbbbbbbb}; Finally, designated array initializers are not binpacked, just like designated member initializers. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, krasimir, klimek Differential Revision: https://reviews.llvm.org/D33491 llvm-svn: 305696
* Revert "[NFC] Refactor DiagnosticRenderer to use FullSourceLoc"Christof Douma2017-06-195-237/+227
| | | | | | | This reverts commit 305684. This patch breaks extra/tools/clang-tidy llvm-svn: 305688
* [NFC] Refactor DiagnosticRenderer to use FullSourceLocChristof Douma2017-06-195-227/+237
| | | | | | | | | | | | | | | | Move the DiagnosticRenderer and its dependents to using FullSourceLocs instead of a SourceLocation and SourceManager pointer. The changeset is rather large but entirely mechanical. This is step one to allow DiagnosticRenderer to take either llvm::SMLocs or clang::SourceLocations. Patch by Sanne Wouda Review: https://reviews.llvm.org/D31709 Change-Id: If351a112cdf6718e2d3ef6721b8da9c6376b32dd llvm-svn: 305684
* Add missing OS check to r305678Alex Lorenz2017-06-191-2/+4
| | | | | | | That commit failed on non-macOS buildbots as I've forgotten to make sure that the system on which Clang is running on is actually macOS. llvm-svn: 305680
* [driver][macOS] Pick the system version for the deployment targetAlex Lorenz2017-06-191-1/+20
| | | | | | | | | | | | | | if the SDK is newer than the system This commit improves the driver by making sure that it picks the system version for the deployment target when the version of the macOS SDK is newer than the system version. rdar://29449467 Differential Revision: https://reviews.llvm.org/D34175 llvm-svn: 305678
* [analyzer] Fix logical not for pointers with different bit widthDaniel Marjamaki2017-06-191-3/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D31029 llvm-svn: 305669
* clang-format: Improve understanding of combined typedef+record declarationsDaniel Jasper2017-06-191-2/+5
| | | | | | | | | | Fixes an issue where struct A { int X; }; would be broken onto multiple lines, but typedef struct A { int X; } A2; was collapsed onto a single line. Patch by Jacob Bandes-Storch. Thank you. llvm-svn: 305667
* clang-format: Handle "if constexpr".Daniel Jasper2017-06-193-2/+10
| | | | | | | | | | | | | | | | | | | | c++1z adds the following constructions to the language: if constexpr (cond) statement1; else if constexpr (cond) statement2; else if constexpr (cond) statement3; else statement4; A first version of this was proposed in reviews.llvm.org/D26953 by Francis Visoiu Mistrih, but never commited. This patch additionally fixes the behavior when allowing short if statements on a single line and was authored by Jacob Bandes-Storch. Thank you to both authors. llvm-svn: 305666
* [analyzer] Teach CloneDetection about Qt Meta-Object CompilerLeslie Zhai2017-06-192-2/+24
| | | | | | | | | | Reviewers: v.g.vassilev, zaks.anna, NoQ, teemperor Reviewed By: v.g.vassilev, zaks.anna, NoQ, teemperor Differential Revision: https://reviews.llvm.org/D31320 llvm-svn: 305659
* CodeGen: make the type match the comment for a libcallSaleem Abdulrasool2017-06-171-1/+1
| | | | | | | | Fix the type for a (runtime) library call to match both the comment and the runtime implementation. As it happens, the type being used matched, this just makes it more precise. llvm-svn: 305638
* Call setMustBuildLookupTable on TagDecls in ExternalASTMergerLang Hames2017-06-171-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: setMustBuildLookupTable should be called on imported TagDecls otherwise we may fail to import their member decls (if they have any). Not calling the setMustBuildLookupTable method results in a failure in the attached test case when lookup for the 'x' member fails on struct S, which hasn't had its decls imported elsewhere. (By contrast the member-in-struct testcase hasn't run into this issue because the import of its decls is triggered when the struct instance is defined, and the member access follows this). Reviewers: spyffe, rsmith Reviewed By: spyffe, rsmith Differential Revision: https://reviews.llvm.org/D34253 llvm-svn: 305619
* Killing a tab and some other spurious whitespace; NFC.Aaron Ballman2017-06-161-1/+1
| | | | llvm-svn: 305586
* [PR33394] Avoid lexing editor placeholders when Clang is used onlyAlex Lorenz2017-06-162-41/+56
| | | | | | | | | | | | | | | | for preprocessing r300667 added support for editor placeholder to Clang. That commit didn’t take into account that users who use Clang for preprocessing only (-E) will get the "editor placeholder in source file" error when preprocessing their source (PR33394). This commit ensures that Clang doesn't lex editor placeholders when running a preprocessor only action. rdar://32718000 Differential Revision: https://reviews.llvm.org/D34256 llvm-svn: 305576
* Fix a bug that warnings generated with -M or -MM flagsYuka Takahashi2017-06-161-0/+3
| | | | | | | | | This is a patch for bug: https://bugs.llvm.org/show_bug.cgi?id=6817 Warnings should not be emitted with -M and -MM flags, because this mode is only used for generate MakeFiles. llvm-svn: 305561
* Expand vector oparation to as IR constants, PR28129.Dinar Temirbulatov2017-06-161-0/+21
| | | | llvm-svn: 305551
* [ubsan] PR33081: Skip the standard type checks for volatileVedant Kumar2017-06-161-0/+5
| | | | | | | | | | Skip checks for null dereference, alignment violation, object size violation, and dynamic type violation if the pointer points to volatile data. Differential Revision: https://reviews.llvm.org/D34262 llvm-svn: 305546
* [XRay][clang] Support capturing the implicit `this` argument to C++ class ↵Dean Michael Berris2017-06-161-6/+8
| | | | | | | | | | | | | | | | | | member functions Summary: Before this change, we couldn't capture the `this` pointer that's implicitly the first argument of class member functions. There are some interesting things we can do with capturing even just this single argument for zero-argument member functions. Reviewers: rnk, pelikan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D34052 llvm-svn: 305544
* [ODRHash] Hash VarDecl members.Richard Trieu2017-06-162-0/+125
| | | | | | | These VarDecl's are static data members of classes. Since the initializers are also hashed, this also provides checking for default arguments to methods. llvm-svn: 305543
* [Completion] Code complete the members for a dependent type after a '::'Alex Lorenz2017-06-151-3/+7
| | | | | | | | | | This commit is a follow up to r302797 which added support for dependent completions after the '.' and '->' operators. This commit adds support for dependent completions after the '::' operator. Differential Revision: https://reviews.llvm.org/D34173 llvm-svn: 305511
* [index] Record C++17 global binding declarationsAlex Lorenz2017-06-152-0/+10
| | | | | | | | The global C++17 binding declarations should be indexed as variable symbols. Differential Revision: https://reviews.llvm.org/D33920 llvm-svn: 305508
* [index] Index static_assert declarationsAlex Lorenz2017-06-151-0/+7
| | | | | | | | | | static_assert declarations have to be visited while indexing so that we can gather the references to declarations that are present in their assert expression. Differential Revision: https://reviews.llvm.org/D33913 llvm-svn: 305504
* [coroutines] Remove pass-through operator co_await; Replace it with the ↵Eric Fiselier2017-06-152-14/+7
| | | | | | | | | | | | input expression Reviewers: GorNishanov, rsmith Reviewed By: GorNishanov Differential Revision: https://reviews.llvm.org/D34216 llvm-svn: 305498
* [coroutines] Allow co_await and co_yield expressions that return an lvalue ↵Eric Fiselier2017-06-154-7/+57
| | | | | | | | | | | | | | | | | | to compile Summary: The title says it all. Reviewers: GorNishanov, rsmith Reviewed By: GorNishanov Subscribers: rjmccall, cfe-commits Differential Revision: https://reviews.llvm.org/D34194 llvm-svn: 305496
* Apply summary-based dead stripping to regular LTO modules with summaries.Peter Collingbourne2017-06-151-4/+4
| | | | | | | | | | | | | | | If a regular LTO module has a summary index, then instead of linking it into the combined regular LTO module right away, add it to the combined summary index and associate it with a special module that represents the combined regular LTO module. Any such modules are linked during LTO::run(), at which time we use the results of summary-based dead stripping to control whether to link prevailing symbols. Differential Revision: https://reviews.llvm.org/D33922 llvm-svn: 305482
* Revert "Load lazily the template specialization in multi-module setups."Vassil Vassilev2017-06-151-47/+38
| | | | | | This broke our libcxx modules builds. llvm-svn: 305460
OpenPOWER on IntegriCloud