summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* revert r338831 - Fix unused variable warning in tablegen generated codeErich Keane2018-08-031-8/+4
| | | | | | No longer necessary thanks to r338889 (and friends). llvm-svn: 338893
* clang-format: [JS] don't break comments before any '{'Martin Probst2018-08-032-12/+22
| | | | | | | | | | | | | | | | | | | | Summary: Previously, clang-format would avoid breaking before the first `{` found, but then happily break before subsequent '{'s on the line. This change fixes that by looking for the first location that has no opening curly, if any. This fixes the original commit by correcting the loop condition. This reverts commit 66dc646e09b795b943668179c33d09da71a3b6bc. Reviewers: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50249 llvm-svn: 338890
* [NFCI] My attempt to fix a warning in r338886 broke the build! Fix it.Erich Keane2018-08-031-1/+1
| | | | | | | | Clang format got the best of me... it introduced spaces around something in a table-genned file, so it was interpreted as an array and not a code block. llvm-svn: 338889
* [AST][NFC] Add missing doc for ObjCMethodDecl and ObjCContainerDeclBruno Ricci2018-08-031-0/+6
| | | | | | | | | | | Add a comment in ObjCMethodDecl and ObjCContainerDecl stating that we store some bits in ObjCMethodDeclBits and ObjCContainerDeclBits. This was missed by the recent move in r338641 : [AST][4/4] Move the bit-fields from ObjCMethodDecl and ObCContainerDecl into DeclContext llvm-svn: 338888
* [AST][NFC] Small doc update for DeclContextBruno Ricci2018-08-031-8/+15
| | | | | | | | | | | | | | | | Factored out from https://reviews.llvm.org/D49729 following @erichkeane comments. * Add missing classes in the list of classes deriving directly from DeclContext. * Move the friend declarations together and add a comment for why they are required. Reviewed By: erichkeane Differential Revision: https://reviews.llvm.org/D49790 llvm-svn: 338887
* [NFC] Fix unused expression warning introduced in r338884Erich Keane2018-08-031-2/+3
| | | | llvm-svn: 338886
* Test commitBruno Ricci2018-08-031-1/+1
| | | | llvm-svn: 338885
* [NFC] Silence unused variable warning in Attr.td/AttrParsedAttrImpl.incErich Keane2018-08-031-1/+1
| | | | llvm-svn: 338884
* Revert "clang-format: [JS] don't break comments before any '{'"Tim Northover2018-08-032-20/+12
| | | | | | This reverts commit r338837, it introduced an infinite loop on all bots. llvm-svn: 338879
* clang-format-diff: Make it work with python3 tooKrasimir Georgiev2018-08-031-10/+15
| | | | | | | | | | | | | | | | Summary: It is not necessary, but would be nice if the script run on python3 as well (as opposed to only python2, which is going to be deprecated https://pythonclock.org/) Contributed by MarcoFalke! Reviewers: krasimir Reviewed By: krasimir Subscribers: lebedev.ri, sammccall, cfe-commits Differential Revision: https://reviews.llvm.org/D48098 llvm-svn: 338839
* clang-format: [JS] don't break comments before any '{'Martin Probst2018-08-032-12/+20
| | | | | | | | | | | | | | | | Summary: Previously, clang-format would avoid breaking before the first `{` found, but then happily break before subsequent '{'s on the line. This change fixes that by looking for the first location that has no opening curly, if any. Reviewers: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50230 llvm-svn: 338837
* Fully qualify the renamed symbol if the shortened name is ambiguous.Eric Liu2018-08-032-3/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: For example, when renaming `a::b::x::foo` to `y::foo` below, replacing `x::foo()` with `y::foo()` can cause ambiguity. In such cases, we simply fully qualify the name with leading `::`. ``` namespace a { namespace b { namespace x { void foo() {} } namespace y { void foo() {} } } } namespace a { namespace b { void f() { x::foo(); } } } ``` Reviewers: ilya-biryukov, hokein Reviewed By: ilya-biryukov Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50189 llvm-svn: 338832
* Fix unused variable warning in tablegen generated codeKarl-Johan Karlsson2018-08-031-4/+8
| | | | llvm-svn: 338831
* [libclang 8/8] Add support for the flag_enum attributeMichael Wu2018-08-034-2/+12
| | | | | | | | | | | | | | | | | Summary: This adds support to libclang for reading the flag_enum attribute. This also bumps CINDEX_VERSION_MINOR for this patch series. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49635 llvm-svn: 338820
* [libclang 7/8] Add support for getting property setter and getter namesMichael Wu2018-08-035-0/+76
| | | | | | | | | | | | | | Summary: This allows libclang to access the actual names of property setters and getters without needing to go through the indexer API. Usually default names are used, but the property can specify a different name. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49634 llvm-svn: 338816
* [libclang 6/8] Add support for reading implicit attributesMichael Wu2018-08-034-2/+37
| | | | | | | | | | | | | | | | | Summary: Having access to implicit attributes is sometimes useful so users of libclang don't have to duplicate some of the logic in sema. This depends on D49081 since it also adds a CXTranslationUnit flag. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49631 llvm-svn: 338815
* [libclang 5/8] Add support for ObjC attributes without argsMichael Wu2018-08-034-1/+108
| | | | | | | | | | | | | | | | | Summary: This adds support to libclang for identifying ObjC related attributes that don't take arguments. All attributes but NSObject and NSConsumed are tested. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49127 llvm-svn: 338813
* [CodeGen] Emit parallel_loop_access for each loop in the loop stack.Michael Kruse2018-08-033-2/+54
| | | | | | | | | | | | | | | | | Summary: Emit !llvm.mem.parallel_loop_access metadata for memory accesses even if the parallel loop is not the top on the loop stack. Fixes llvm.org/PR37558. Reviewers: ABataev, hfinkel, amusman, tyler.nowicki Reviewed By: hfinkel Subscribers: Meinersbur, hfinkel, cfe-commits Differential Revision: https://reviews.llvm.org/D48808 llvm-svn: 338810
* [libclang 4/8] Add the clang_Type_getNullability() APIMichael Wu2018-08-035-0/+85
| | | | | | | | | | | | | | | | | Summary: This patch adds a clang-c API for querying the nullability of an AttributedType. The test here also tests D49081 Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49082 llvm-svn: 338809
* [libclang 3/8] Add support for AttributedTypeMichael Wu2018-08-033-3/+32
| | | | | | | | | | | | | | | | | | | Summary: This patch adds support to the libclang API for identifying AttributedTypes in CXTypes and reading the modified type that the type points to. Currently AttributedTypes are skipped. This patch continues to skip AttributedTypes by default, but adds a parsing option to CXTranslationUnit to include AttributedTypes. This patch depends on D49066 since it also adds a CXType. Testing will be added in another patch which depends on this one. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49081 llvm-svn: 338808
* [libclang 2/8] Add support for ObjCTypeParamMichael Wu2018-08-033-1/+9
| | | | | | | | | | | | | | | | | Summary: This patch adds support to the libclang API for identifying ObjCTypeParams in CXTypes. This patch depends on D49063 since both patches add new values to CXTypeKind. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49066 llvm-svn: 338807
* Sema: Fix explicit address space cast involving void pointersYaxun Liu2018-08-032-10/+67
| | | | | | | | | | | | Explicit cast of a void pointer to a pointer type in different address space is incorrectly classified as bitcast, which causes invalid bitcast in codegen. The patch fixes that by checking the address space of the source and destination type and set the correct cast kind. Differential Revision: https://reviews.llvm.org/D50003 llvm-svn: 338805
* [libclang 1/8] Add support for ObjCObjectTypeMichael Wu2018-08-036-3/+180
| | | | | | | | | | | | | | Summary: This patch adds support to the clang-c API for identifying ObjCObjects in CXTypes, enumerating type args and protocols on ObjCObjectTypes, and retrieving the base type of ObjCObjectTypes. Currently only ObjCInterfaceTypes are exposed, which do not have type args or protocols. Reviewers: yvvan, jbcoe Reviewed By: yvvan Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49063 llvm-svn: 338804
* Fold two cast plus a cast in a loop into a variable.Nicolas Lesser2018-08-031-5/+5
| | | | | | This avoids to recast `Record` multiple times. llvm-svn: 338801
* Append new attributes to the end of an AttributeList.Michael Kruse2018-08-0335-207/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recommit of r335084 after revert in r335516. ... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse order, and therefore printed in the wrong order in -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effect, especially on diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attributes' order was changed instead. This unfortunately causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible to each other. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reverse. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway. Differential Revision: https://reviews.llvm.org/D48100 llvm-svn: 338800
* [modules] Defer merging deduced return types.Richard Smith2018-08-035-20/+78
| | | | | | | | | | | We can't read a deduced return type until we are sure that the types referred to by it are not in the middle of being loaded. So defer all reading of such deduced return types until the end of the recursive deserialization step. Also, when we load a function type that has a deduced return type, update all other redeclarations of the function to have that deduced return type. llvm-svn: 338798
* [analyzer] Detect pointers escaped after ReturnStmt execution in MallocChecker.Reka Kovacs2018-08-023-3/+67
| | | | | | | | | | Objects local to a function are destroyed right after the statement returning (part of) them is executed in the analyzer. This patch enables MallocChecker to warn in these cases. Differential Revision: https://reviews.llvm.org/D49361 llvm-svn: 338780
* [analyzer] Obtain a ReturnStmt from a CFGAutomaticObjDtor.Reka Kovacs2018-08-023-1/+58
| | | | | | | | | | | The CoreEngine only gives us a ReturnStmt if the last element in the CFGBlock is a CFGStmt, otherwise the ReturnStmt is nullptr. This patch adds support for the case when the last element is a CFGAutomaticObjDtor, by returning its TriggerStmt as a ReturnStmt. Differential Revision: https://reviews.llvm.org/D49811 llvm-svn: 338777
* [analyzer] Add a safety check to InnerPointerChecker.Reka Kovacs2018-08-021-2/+5
| | | | | | Do not crash if the CXXRecordDecl of an object is not available. llvm-svn: 338775
* [WebAssembly] Support for atomic.wait / atomic.wake builtinsHeejin Ahn2018-08-023-0/+43
| | | | | | | | | | | | | | Summary: Add support for atomic.wait / atomic.wake builtins based on the Wasm thread proposal. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, cfe-commits Differential Revision: https://reviews.llvm.org/D49396 llvm-svn: 338771
* Fix assertion failure when emitting code for a merged lambda.Richard Smith2018-08-022-3/+14
| | | | llvm-svn: 338766
* [analyzer] Fix tests.George Karpenkov2018-08-022-2/+4
| | | | llvm-svn: 338756
* AMDGPU: Fix missing declaration of queue ptr builtinMatt Arsenault2018-08-022-0/+8
| | | | llvm-svn: 338754
* [analyzer] Forward arguments in registerChecker to avoid accidental copiesGeorge Karpenkov2018-08-021-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D50108 llvm-svn: 338753
* Work around more GCC miscompiles exposed by r338464.Martin Storsjo2018-08-021-1/+5
| | | | | | | | | This is the same fix as in r338478, for another occurrance of the same pattern from r338464. See gcc.gnu.org/PR86769 for details of the bug. llvm-svn: 338749
* __c11_atomic_load's _Atomic can be constJF Bastien2018-08-023-5/+6
| | | | | | | | | | | | | | | | | | | | | Summary: C++11 onwards specs the non-member functions atomic_load and atomic_load_explicit as taking the atomic<T> by const (potentially volatile) pointer. C11, in its infinite wisdom, decided to drop the const, and C17 will fix this with DR459 (the current draft forgot to fix B.16, but that’s not the normative part). clang’s lib/Headers/stdatomic.h implements these as #define to the __c11_* equivalent, which are builtins with custom typecheck. Fix the typecheck. D47613 takes care of the libc++ side. Discussion: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058129.html <rdar://problem/27426936> Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47618 llvm-svn: 338743
* [c-index-test] Use correct executable path to discover resource directory.Volodymyr Sapsai2018-08-021-5/+10
| | | | | | | | | | | | | | | | | Driver builds resource directory path based on provided executable path. Instead of string "clang" use actual executable path. rdar://problem/42699514 Reviewers: nathawes, akyrtzi, bob.wilson Reviewed By: akyrtzi Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50160 llvm-svn: 338741
* [analyzer] Make RegionVector use const referenceFangrui Song2018-08-021-10/+7
| | | | llvm-svn: 338732
* Try to make builtin address space declarations not uselessMatt Arsenault2018-08-0211-76/+207
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The way address space declarations for builtins currently work is nearly useless. The code assumes the address spaces used for builtins is a confusingly named "target address space" from user code using __attribute__((address_space(N))) that matches the builtin declaration. There's no way to use this to declare a builtin that returns a language specific address space. The terminology used is highly cofusing since it has nothing to do with the the address space selected by the target to use for a language address space. This feature is essentially unused as-is. AMDGPU and NVPTX are the only in-tree targets attempting to use this. The AMDGPU builtins certainly do not behave as intended (i.e. all of the builtins returning pointers can never compile because the numbered address space never matches the expected named address space). The NVPTX builtins are missing tests for some, and the others seem to rely on an implicit addrspacecast. Change the used address space for builtins based on a target hook to allow using a language address space for a builtin. This allows the same builtin declaration to be used for multiple languages with similarly purposed address spaces (e.g. the same AMDGPU builtin can be used in OpenCL and CUDA even though the constant address spaces are arbitarily different). This breaks the possibility of using arbitrary numbered address spaces alongside the named address spaces for builtins. If this is an issue we probably need to introduce another builtin declaration character to distinguish language address spaces from so-called "target address spaces". llvm-svn: 338707
* clang-format: fix a crash in comment wraps.Martin Probst2018-08-023-25/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, clang-format would crash if it tried to wrap an overlong single line comment, because two parts of the code inserted a break in the same location. /** heregoesalongcommentwithnospace */ This wasn't previously noticed as it could only trigger for an overlong single line comment that did have no breaking opportunities except for a whitespace at the very beginning. This also introduces a check for JavaScript to not ever wrap a comment before an opening curly brace: /** @mods {donotbreakbeforethecurly} */ This is because some machinery parsing these tags sometimes supports breaks before a possible `{`, but in some other cases does not. Previously clang-format was careful never to wrap a line with certain tags on it. The better solution is to specifically disable wrapping before the problematic token: this allows wrapping and aligning comments but still avoids the problem. Reviewers: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50177 llvm-svn: 338706
* Test commit accessMichael Wu2018-08-021-1/+0
| | | | llvm-svn: 338675
* [analyzer] Extend NoStoreFuncVisitor to follow fields.George Karpenkov2018-08-024-131/+423
| | | | | | | | rdar://39701823 Differential Revision: https://reviews.llvm.org/D49901 llvm-svn: 338667
* Pass triple to RUN line to fix failing bots.Akira Hatanaka2018-08-021-2/+2
| | | | | | This is a follow-up to r338656. llvm-svn: 338664
* Serialize DoesNotEscape.Akira Hatanaka2018-08-014-0/+32
| | | | | | I forgot to commit this in r326530. llvm-svn: 338656
* [AST] Remove the static_assert check in ObjCMethodDecl::ObjCMethodDeclVlad Tsyrklevich2018-08-011-7/+0
| | | | | | | | | | | | | | Summary: This check was introduced by r338641 but this broke some builds. For now remove it. Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50163 llvm-svn: 338648
* Fix -Wcovered-switch-default uncovered after r338630Reid Kleckner2018-08-011-1/+1
| | | | llvm-svn: 338643
* [AST][4/4] Move the bit-fields from ObjCMethodDecl and ObjCContainerDecl ↵Erich Keane2018-08-015-125/+134
| | | | | | | | | | | | | | | | | into DeclContext This patch follows https://reviews.llvm.org/D49729, https://reviews.llvm.org/D49732 and https://reviews.llvm.org/D49733. Move the bits from ObjCMethodDecl and ObjCContainerDecl into DeclContext. Differential Revision: https://reviews.llvm.org/D49734 Patch By: bricci llvm-svn: 338641
* [NFC][CodeGenCXX] Use -emit-llvm-only instead of -emit-llvm and ignoring it.Roman Lebedev2018-08-011-1/+1
| | | | | | As pointed out by Richard Smith in post-review of r338489. llvm-svn: 338640
* [AST][3/4] Move the bit-fields from BlockDecl, LinkageSpecDecl and ↵Erich Keane2018-08-016-53/+69
| | | | | | | | | | | | | | | | | OMPDeclareReductionDecl into DeclContext This patch follows https://reviews.llvm.org/D49729 and https://reviews.llvm.org/D49732, and is followed by https://reviews.llvm.org/D49734. Move the bits from BlockDecl, LinkageSpecDecl and OMPDeclareReductionDecl into DeclContext. Differential Revision: https://reviews.llvm.org/D49733 Patch By: bricci llvm-svn: 338639
* [AST][2/4] Move the bit-fields from FunctionDecl and CXXConstructorDecl into ↵Erich Keane2018-08-016-212/+269
| | | | | | | | | | | | | | | | | DeclContext This patch follows https://reviews.llvm.org/D49729 and is followed by https://reviews.llvm.org/D49733 and https://reviews.llvm.org/D49734. Move the bits from FunctionDecl and CXXConstructorDecl into DeclContext. Differential Revision: https://reviews.llvm.org/D49732 Patch By: bricci llvm-svn: 338636
OpenPOWER on IntegriCloud