summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [ubsan] Add helpers to decide when null/vptr checks are required. NFC.Vedant Kumar2017-10-032-8/+21
| | | | llvm-svn: 314750
* [ubsan] Save a ptrtoint when emitting alignment checksVedant Kumar2017-10-031-5/+10
| | | | | | | The alignment check emits a ptrtoint instruction which can be reused in the call to the diagnostic handler. llvm-svn: 314749
* Remove an assertion I added from the refactoring of pasteTokens ↵Faisal Vali2017-10-031-4/+0
| | | | | | | | | | | | (https://reviews.llvm.org/rL314747). - it made the bots v angry! I'm not exactly sure why the assertion doesn't hold - if anyone has any insight - would appreciate it. Thanks! llvm-svn: 314748
* [NFC] Refactor PasteTokens so that it can be passed the Token Stream and ↵Faisal Vali2017-10-031-38/+58
| | | | | | | | | | | | | | Index to start concatenating at. In passing: - change the name of the function to pasteTokens c/w coding standards - rename CurToken to CurTokenIdx (since it is not the token, but the index) - add doxygen comments to document some of pasteTokens' functionality - use parameter names different from the data member names. This will be useful for implementing __VA_OPT__ (https://reviews.llvm.org/D35782#inline-322587) llvm-svn: 314747
* [clang-cl] Claim ignored /O[12xd] argumentsReid Kleckner2017-10-031-20/+20
| | | | | | Fixes PR34809 llvm-svn: 314743
* PR33839: Fix -Wunused handling for structured binding declarations.Richard Smith2017-10-023-6/+26
| | | | | | | We warn about a structured binding declaration being unused only if none of its bindings are used. llvm-svn: 314733
* [Analyzer] Avoid copy and modifying passed reference in ↵George Karpenkov2017-10-021-16/+18
| | | | | | | | BodyFarm::create_call_once Differential Revision: https://reviews.llvm.org/D38475 llvm-svn: 314722
* Add support for Myriad ma2x8x series of CPUsWalter Lee2017-10-022-4/+65
| | | | | | | | | | | | | | | Summary: Also: - Add support for some older Myriad CPUs that were missing. - Fix some incorrect compiler defines for exisitng CPUs. Reviewers: jyknight Subscribers: fedor.sergeev Differential Revision: https://reviews.llvm.org/D37551 llvm-svn: 314706
* [refactor] Simplify the refactoring interfaceAlex Lorenz2017-10-023-57/+57
| | | | | | | | | | | | | This commit simplifies the interface for the refactoring action rules and the refactoring requirements. It merges the selection constraints and the selection requirements into one class. The refactoring actions rules must now be implemented using subclassing instead of raw function / lambda pointers. This change also removes a bunch of template-based traits and other template definitions that are now redundant. Differential Revision: https://reviews.llvm.org/D37681 llvm-svn: 314704
* Revert "Add /System/Library/PrivateFrameworks as a header search path."Douglas Gregor2017-10-021-1/+0
| | | | | | This reverts commit f7a95215a435aa8d5f64f43a8bb23ba077270755. llvm-svn: 314697
* [CUDA] Fix name of __activemask()Jonas Hahnfeld2017-10-021-1/+1
| | | | | | | | | The name has two underscores in the official CUDA documentation: http://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#warp-vote-functions Differential Revision: https://reviews.llvm.org/D38468 llvm-svn: 314691
* Revert "[Sema] Warn on attribute nothrow conflicting with language specifiers"Reid Kleckner2017-10-021-20/+1
| | | | | | | | | | | This reverts r314461. It is warning on user code that uses END_COM_MAP(), which expands to declare QueryInterface with conflicting exception specifers. I've spent a while trying to understand why, but haven't been able to extract a reduced test case. Let's revert and I'll keep trying. llvm-svn: 314689
* [OPENMP] Capture argument of `device` clause for target-basedAlexey Bataev2017-10-025-2/+19
| | | | | | | | | | directives. The argument of the `device` clause in target-based executable directives must be captured to support codegen for the `target` directives with the `depend` clauses. llvm-svn: 314686
* [clang-format] Fix regression about short functions after #elseKrasimir Georgiev2017-10-021-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch fixes a regression introduced in r312904, where the formatter confuses the `else` in `#else` with an `else` of an `if-else` statement. For example, formatting this code with google style ``` #ifdef A int f() {} #else int f() {} #endif ``` resulted in ``` #ifdef A int f() {} #else int f() { } #endif ``` Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37973 llvm-svn: 314683
* [OPENMP] Simplify codegen for non-offloading code.Alexey Bataev2017-10-021-31/+20
| | | | | | | Simplified and generalized codegen for non-offloading part that works if offloading is failed or condition of the `if` clause is `false`. llvm-svn: 314670
* [CodeGen] Have a special function to get TBAA info for may-alias accessesIvan A. Kosarev2017-10-025-8/+23
| | | | | | | | | This is part of D37826 reworked to be a separate patch to simplify review. Differential Revision: https://reviews.llvm.org/D38408 llvm-svn: 314660
* [CodeGen] Do not refer to complete TBAA info where we actually deal with ↵Ivan A. Kosarev2017-10-029-58/+62
| | | | | | | | | | | | | | just TBAA access types This patch fixes misleading names of entities related to getting, setting and generation of TBAA access type descriptors. This is effectively an attempt to provide a review for D37826 by breaking it into smaller pieces. Differential Revision: https://reviews.llvm.org/D38404 llvm-svn: 314657
* Dependent Address Space SupportAndrew Gozillon2017-10-0213-44/+444
| | | | | | | | | | | | | | This patch relates to: https://reviews.llvm.org/D33666 This adds support for template parameters to be passed to the address_space attribute. The main goal is to add further flexibility to the attribute and allow for it to be used easily with templates. The main additions are a new type (DependentAddressSpaceType) alongside its TypeLoc and its mangling. As well as the logic required to support dependent address spaces which mainly resides in TreeTransform.h and SemaType.cpp. llvm-svn: 314649
* Test Commit.Andrew Gozillon2017-10-011-1/+0
| | | | llvm-svn: 314623
* [Analysis] Remove unused makeLvalueToRValue variant.Davide Italiano2017-09-301-13/+0
| | | | llvm-svn: 314605
* [NFC] Add assertion that we assume a valid macro argument index.Faisal Vali2017-09-301-0/+3
| | | | llvm-svn: 314600
* [NFC] Remove superfluous parameter Faisal Vali2017-09-302-7/+6
| | | | | | - MacroArgs already knows the maximum number of arguments that can be supplied to the macro. No need to pass MacroInfo (information about the macro definition) to the call to getPreExpArgument (which by the way might benefit from being called getExpandedArgument() ?) for it to compute the number of arguments. llvm-svn: 314593
* [ODRHash] Add base classes to hashing CXXRecordDecl.Richard Trieu2017-09-303-3/+132
| | | | llvm-svn: 314581
* [Analyzer] Synthesize function body for std::call_onceGeorge Karpenkov2017-09-301-28/+288
| | | | | | Differential Revision: https://reviews.llvm.org/D37840 llvm-svn: 314571
* Add a "vexing parse" warning for ambiguity between a variable declaration and aRichard Smith2017-09-291-0/+96
| | | | | | | | | | | | | | function-style cast. This fires for cases such as T(x); ... where 'x' was previously declared and T is a type. This construct declares a variable named 'x' rather than the (probably expected) interpretation of a function-style cast of 'x' to T. llvm-svn: 314570
* [PS4] Tidy up some debug-tuning v. triple decision-making.Paul Robinson2017-09-292-7/+11
| | | | llvm-svn: 314558
* [Sema] Correct IUnknown to support Unknwnbase.h Header.Erich Keane2017-09-291-3/+15
| | | | | | | | | | | | | | Apparently, the MSVC SDK has a strange implementation that causes a number of implicit functions as well as a template member function of the IUnknown type. This patch allows these as InterfaceLike types as well. Additionally, it corrects the behavior where extern-C++ wrapped around an Interface-Like type would permit an interface-like type to exist in a namespace. Differential Revision: https://reviews.llvm.org/D38303 llvm-svn: 314557
* [Sema] Suppress warnings for C's zero initializerDaniel Marjamaki2017-09-292-2/+16
| | | | | | | | Patch by S. Gilles! Differential Revision: https://reviews.llvm.org/D28148 llvm-svn: 314499
* [X86][MS-InlineAsm] Extended support for variables / identifiers on memory / ↵Coby Tayree2017-09-292-44/+30
| | | | | | | | | | | immediate expressions Allow the proper recognition of Enum values and global variables inside ms inline-asm memory / immediate expressions, as they require some additional overhead and treated incorrect if doesn't early recognized. supersedes D33278, D35774 Differential Revision: https://reviews.llvm.org/D37413 llvm-svn: 314494
* [NFC] Replace 'arguments' with 'parameters' in comments relating to lexing a ↵Faisal Vali2017-09-291-7/+7
| | | | | | macro definition. llvm-svn: 314484
* [NFC] Rename variable 'Arguments' to 'Parameters' when lexing the Macro ↵Faisal Vali2017-09-291-9/+9
| | | | | | Definition. llvm-svn: 314483
* [Sema] Put nullability fix-it after the end of the pointer.Volodymyr Sapsai2017-09-281-15/+22
| | | | | | | | | | | | | | | | | | Fixes nullability fix-it for `id<SomeProtocol>`. With this change nullability specifier is inserted after ">" instead of between "id" and "<". rdar://problem/34260995 Reviewers: jordan_rose, doug.gregor, ahatanak, arphaman Reviewed By: jordan_rose Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D38327 llvm-svn: 314473
* [clang] Add getUnsignedPointerDiffType methodAlexander Shaposhnikov2017-09-283-5/+10
| | | | | | | | | | | | | | | | | C11 standard refers to the unsigned counterpart of the type ptrdiff_t in the paragraph 7.21.6.1p7 where it defines the format specifier %tu. In Clang (in PrintfFormatString.cpp, lines 508-510) there is a FIXME for this case, in particular, Clang didn't diagnose %tu issues at all, i.e. it didn't emit any warnings on the code printf("%tu", 3.14). In this diff we add a method getUnsignedPointerDiffType for getting the corresponding type similarly to how it's already done in the other analogous cases (size_t, ssize_t, ptrdiff_t etc) and fix -Wformat diagnostics for %tu plus the emitted fix-it as well. Test plan: make check-all Differential revision: https://reviews.llvm.org/D38270 llvm-svn: 314470
* Properly parse a postfix expression following a Boolean literal. Fixes PR34273.Aaron Ballman2017-09-281-1/+2
| | | | | | Patch by Nicolas Lesser. llvm-svn: 314463
* [Sema] Correct nothrow inherited by noexceptErich Keane2017-09-281-0/+3
| | | | | | | | | | | | | | | As reported in https://bugs.llvm.org/show_bug.cgi?id=33235, a noexcept function was unable to inherit from a nothrow defaulted constructor. Attribute "nothrow" is supposed to be semantically identical to noexcept, and in fact, a number of other places in the code treat them identically. This patch simply checks the RecordDecl for the correct attribute in the case where no other exception specifier was set. Differential Revision: https://reviews.llvm.org/D38209 llvm-svn: 314462
* [Sema] Warn on attribute nothrow conflicting with language specifiersErich Keane2017-09-281-1/+20
| | | | | | | | | | | | | | I discovered it was possible to create a 'nothrow' noexcept(false) function, which is both non-sensical as well as seemingly breaking. This patch warns if attribute nothrow is used with anything besides "noexcept". "noexcept(true)" isn't possible, because the noexcept decl isn't parsed until later. Differential Revision: https://reviews.llvm.org/D38205 llvm-svn: 314461
* [AMDGPU] Allow flexible register names in inline asm constraintsYaxun Liu2017-09-281-6/+73
| | | | | | | | | | | | | | | | | | | | | | | | Currently AMDGPU inline asm only allow v and s as register names in constraints. This patch allows the following register names in constraints: (n, m is unsigned integer, n < m) v s {vn} or {v[n]} {sn} or {s[n]} {S} , where S is a special register name {v[n:m]} {s[n:m]} Differential Revision: https://reviews.llvm.org/D37568 llvm-svn: 314452
* [DWARF] Allow forward declarations of a class template instantiationPaul Robinson2017-09-283-0/+10
| | | | | | | | | to have child entries describing the template parameters. This will be on by default for SCE tuning. Differential Revision: https://reviews.llvm.org/D14358 llvm-svn: 314444
* Consolidate std::move() detection code. No behavior change.Nico Weber2017-09-285-31/+13
| | | | llvm-svn: 314427
* Fix -Wcast-qual warning after r314336.Nico Weber2017-09-281-1/+1
| | | | llvm-svn: 314424
* Use std::is_trivial instead of is_trivially_copyable.Benjamin Kramer2017-09-281-2/+2
| | | | | | | | The oldest versions of GCC we support (before 5) didn't support that trait. is_trivial is stronger superset that clang::Token fulfills, so just use that instead. llvm-svn: 314391
* [NFC] Don't use C++17 standard lib variable template helper traits, instead ↵Faisal Vali2017-09-281-2/+2
| | | | | | use ::value. llvm-svn: 314373
* [NFC] Modernize MacroArgs using TrailingObjectsFaisal Vali2017-09-281-10/+15
| | | | | | Refactor MacroArgs to use TrailingObjects when creating a variably sized object on the heap to store the unexpanded tokens immediately after the MacroArgs object. llvm-svn: 314372
* Look through parentheses.Akira Hatanaka2017-09-281-1/+1
| | | | | | | | | This fixes a bug where clang would emit instructions to reclaim a value that's going to be __bridge-casted to CF. rdar://problem/34687542 llvm-svn: 314370
* [Targets/X86] Remove unneded `return` in setMaxAtomicWidth(). NFCI.Davide Italiano2017-09-281-1/+0
| | | | llvm-svn: 314367
* [Preprocessor] Preserve #pragma clang assume_nonnull in preprocessed outputEli Friedman2017-09-272-0/+23
| | | | | | | | Patch by Zbigniew Sarbinowski! Differential Revision: https://reviews.llvm.org/D37861 llvm-svn: 314364
* [AVR] Update data layout to match current LLVM trunkDylan McKay2017-09-271-2/+1
| | | | | | The data layout was changed in r314179 to fix atomic loads and stores. llvm-svn: 314354
* Add support for remembering origins to ExternalASTMergerSean Callanan2017-09-272-98/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ExternalASTMerger has hitherto relied on being able to look up any Decl through its named DeclContext chain. This works for many cases, but causes problems for function-local structs, which cannot be looked up in their containing FunctionDecl. An example case is void f() { { struct S { int a; }; } { struct S { bool b; }; } } It is not possible to lookup either of the two Ses individually (or even to provide enough information to disambiguate) after parsing is over; and there is typically no need to, since they are invisible to the outside world. However, ExternalASTMerger needs to be able to complete either S on demand. This led to an XFAIL on test/Import/local-struct, which this patch removes. The way the patch works is: It defines a new data structure, ExternalASTMerger::OriginMap, which clients are expected to maintain (default-constructing if the origin does not have an ExternalASTMerger servicing it) As DeclContexts are imported, if they cannot be looked up by name they are placed in the OriginMap. This allows ExternalASTMerger to complete them later if necessary. As DeclContexts are imported from an origin that already has its own OriginMap, the origins are forwarded – but only for those DeclContexts that are actually used. This keeps the amount of stored data minimal. The patch also applies several improvements from review: - Thoroughly documents the interface to ExternalASTMerger; - Adds optional logging to help track what's going on; and - Cleans up a bunch of braces and dangling elses. Differential Revision: https://reviews.llvm.org/D38208 llvm-svn: 314336
* [CUDA] Work around conflicting function definitions in CUDA-9 headers.Artem Belevich2017-09-271-0/+11
| | | | | | Differential Revision: https://reviews.llvm.org/D38326 llvm-svn: 314334
* [OpenMP] Fix translation of target argsJonas Hahnfeld2017-09-271-4/+6
| | | | | | | | | | ToolChain::TranslateArgs() returns nullptr if no changes are performed. This would currently mean that OpenMPArgs are lost. Patch fixes this by falling back to simply using OpenMPArgs in that case. Differential Revision: https://reviews.llvm.org/D38259 llvm-svn: 314330
OpenPOWER on IntegriCloud