summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-format] Recognize percents as format specifiers in protosKrasimir Georgiev2018-02-143-0/+13
| | | | | | | | | | | | | | | | Summary: Frequently, a percent in protos denotes a formatting specifier for string replacement. Thus it is desirable to keep the percent together with what follows after it. Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43294 llvm-svn: 325159
* Update for llvm change. NFC.Rafael Espindola2018-02-142-3/+3
| | | | llvm-svn: 325156
* [Modules] Add more language features to be used with requires-declarationBruno Cardoso Lopes2018-02-144-1/+54
| | | | | | | | | Features added: c99, c11, c17, cplusplus14 and cplusplus17. rdar://problem/36328787 rdar://problem/36668431 llvm-svn: 325154
* [OpenMP] Fix trailing space when printing pragmas, by Joel. E. DennyAlexey Bataev2018-02-1467-150/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: -ast-print prints omp pragmas with a trailing space. While this behavior is likely of little concern to most users, surely it's unintentional, and it's annoying for some source-level work I'm pursuing. This patch focuses on omp pragmas, but it also fixes init_seg and loop hint pragmas because they share implementation. The testing strategy here is to add usually just one '{{$}}' per relevant -ast-print test file. This seems to achieve good code coverage. However, this strategy is probably easy to forget as the tests evolve. That's probably fine as this fix is far from critical. The main goal of the testing is to aid the initial review. This patch also adds a fixme for "#pragma unroll", which prints as "#pragma unroll (enable)", which is invalid syntax. Reviewers: ABataev Reviewed By: ABataev Subscribers: guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D43204 llvm-svn: 325145
* [CUDA] Allow external variables in separate compilationJonas Hahnfeld2018-02-142-1/+7
| | | | | | | | | | | | According to the CUDA Programming Guide this is prohibited in whole program compilation mode. This makes sense because external references cannot be satisfied in that mode anyway. However, such variables are allowed in separate compilation mode which is a valid use case. Differential Revision: https://reviews.llvm.org/D42923 llvm-svn: 325136
* Revert r324991 "Fix for PR32992. Static const classes not exported."Hans Wennborg2018-02-142-32/+3
| | | | | | | | | | | | This broke the Chromium build on Windows; see https://crbug.com/812231 > Fix for PR32992. Static const classes not exported. > > Patch by zahiraam! > > Differential Revision: https://reviews.llvm.org/D42968 llvm-svn: 325133
* [AST] Fix passing large-array-init.cpp on builds without assertsIvan A. Kosarev2018-02-141-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D43187 llvm-svn: 325123
* [AST] Refine the condition for element-dependent array fillersIvan A. Kosarev2018-02-142-2/+32
| | | | | | | | | | | | This patch fixes clang to not consider braced initializers for aggregate elements of arrays to be potentially dependent on the indices of the initialized elements. Resolves bug 18978: initialize a large static array = clang oom? https://bugs.llvm.org/show_bug.cgi?id=18978 Differential Revision: https://reviews.llvm.org/D43187 llvm-svn: 325120
* Quick fix for 325116 buildbots: move template specialization into namespaceAleksei Sidorin2018-02-141-27/+29
| | | | llvm-svn: 325118
* [Sema] Fix decltype of static data membersMikhail Maltsev2018-02-142-3/+9
| | | | | | | | | | | | | | | | | | | | | | | Summary: According to the C++11 standard [dcl.type.simple]p4: The type denoted by decltype(e) is defined as follows: - if e is an unparenthesized id-expression or an unparenthesized class member access (5.2.5), decltype(e) is the type of the entity named by e. Currently Clang handles the 'member access' case incorrectly for static data members (decltype returns T& instead of T). This patch fixes the issue. Reviewers: faisalv, rsmith, rogfer01 Reviewed By: rogfer01 Subscribers: rogfer01, cfe-commits Differential Revision: https://reviews.llvm.org/D42969 llvm-svn: 325117
* [ASTImporter] Fix lexical DC for templated decls; support ↵Aleksei Sidorin2018-02-144-64/+161
| | | | | | | | | | VarTemplatePartialSpecDecl Also minor refactoring in related functions was done. Differential Revision: https://reviews.llvm.org/D43012 llvm-svn: 325116
* Test commit accessHenry Wong2018-02-141-1/+1
| | | | llvm-svn: 325103
* Fix a couple of places where we assumed that non-type template parameters ↵Richard Smith2018-02-146-8/+26
| | | | | | are always rvalues. llvm-svn: 325095
* Implement function attribute artificialErich Keane2018-02-146-1/+37
| | | | | | | | | | | | Added support in clang for GCC function attribute 'artificial'. This attribute is used to control stepping behavior of debugger with respect to inline functions. Patch By: Elizabeth Andrews (eandrews) Differential Revision: https://reviews.llvm.org/D43259 llvm-svn: 325081
* [analyzer] [tests] Update CmpRuns to write to stdout correctly in ↵George Karpenkov2018-02-132-14/+18
| | | | | | multithreaded environment llvm-svn: 325070
* Teach Wreturn-type, Wunreachable-code, and alpha.deadcode.UnreachableCode to ↵Nico Weber2018-02-138-6/+57
| | | | | | | | | treat __assume(0) like __builtin_unreachable. Fixes PR29134. https://reviews.llvm.org/D43221 llvm-svn: 325052
* Update StmtProfile.cpp to handle zero template arguments.Richard Trieu2018-02-132-2/+20
| | | | | | | Treat having no templates arguments differently than having zero template arguments when profiling. llvm-svn: 325040
* [AMDGPU] Change constant addr space to 4Yaxun Liu2018-02-1314-69/+79
| | | | | | Differential Revision: https://reviews.llvm.org/D43171 llvm-svn: 325031
* An updated test to show the current warnings produced for implicit ↵Andrew V. Tischenko2018-02-131-0/+14
| | | | | | conversions from 'double' to 'float'. llvm-svn: 325011
* [clang-format] Support text proto extensionsKrasimir Georgiev2018-02-135-6/+113
| | | | | | | | | | | | | | | | | | | | | | Summary: This adds support for text proto extensions, like: ``` msg { [type.type/ext] { key: value } } ``` Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43180 llvm-svn: 324995
* Fix for PR32992. Static const classes not exported.Hans Wennborg2018-02-132-3/+32
| | | | | | | | Patch by zahiraam! Differential Revision: https://reviews.llvm.org/D42968 llvm-svn: 324991
* [DebugInfo] Avoid name conflict of generated VLA expression variable.Sander de Smalen2018-02-1311-13/+14
| | | | | | | | | | | | | | | | | Summary: This patch also adds the 'DW_AT_artificial' flag to the generated variable. Addresses the issues mentioned in http://llvm.org/PR30553. Reviewers: CarlosAlbertoEnciso, probinson, aprantl Reviewed By: aprantl Subscribers: JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D43189 llvm-svn: 324988
* [Modules] Fix remapping from Foo.Private to Foo_Private to happen before ↵Bruno Cardoso Lopes2018-02-122-33/+36
| | | | | | | | | | typo correction Typo correction is the last step here, remapping should come first. rdar://problem/37351970 llvm-svn: 324965
* [analyzer] Exploration strategy prioritizing unexplored coverage firstGeorge Karpenkov2018-02-125-12/+120
| | | | | | | | | | See reviews.llvm.org/M1 for evaluation, and lists.llvm.org/pipermail/cfe-dev/2018-January/056718.html for discussion. Differential Revision: https://reviews.llvm.org/D42775 llvm-svn: 324956
* [X86] Reverse the operand order of the implementation of the kunpack builtins.Craig Topper2018-02-123-4/+5
| | | | | | | | The second operand needs to be in the lower bits of the concatenation. This matches llvm 5.0, gcc, and icc behavior. Fixes PR36360. llvm-svn: 324954
* [CFG] Provide construction contexts for return value constructors.Artem Dergachev2018-02-123-2/+98
| | | | | | | | | | | When the current function returns a C++ object by value, CFG elements for constructors that construct the return values can now be queried to discover that they're indeed participating in construction of the respective return value at the respective return statement. Differential Revision: https://reviews.llvm.org/D42875 llvm-svn: 324952
* Look for 32-bit libraries in /usr/lib32 for MIPS O32 on FreeBSD.John Baldwin2018-02-122-0/+8
| | | | | | | | | | | | | | | Summary: FreeBSD N64 MIPS systems can include 32-bit libraries for O32 in /usr/lib32 similar to the 32-bit compatibility libraries provided for FreeBSD/amd64 and FreeBSD/powerpc64. Reviewers: dim Reviewed By: dim Differential Revision: https://reviews.llvm.org/D42972 llvm-svn: 324948
* [analyzer] [tests] Fix a typo in analyzer testing script.George Karpenkov2018-02-121-1/+1
| | | | | | Incorrect option instance construction. llvm-svn: 324946
* [AArch64] Fixes for ARMv8.2-A FP16 scalar intrinsic - clang portionAbderrazek Zaafrani2018-02-122-48/+145
| | | | | | https://reviews.llvm.org/D42993 llvm-svn: 324940
* [DebugInfo] Update Checksum handling in CGDebugInfoScott Linder2018-02-122-12/+16
| | | | | | Update to match new DIFile API. llvm-svn: 324929
* Add a unit test for Driver::getDefaultModuleCachePath().Adrian Prantl2018-02-122-0/+29
| | | | llvm-svn: 324917
* Further cleanup to Driver mode code, as suggested by dblaikie [NFC]Erich Keane2018-02-121-9/+7
| | | | llvm-svn: 324915
* [libclang] Add `CXSymbolRole role` to CXIdxEntityRefInfoFangrui Song2018-02-127-15/+85
| | | | | | | | | | | | | | | | | | Summary: CXIdxEntityRefInfo contains the member `CXIdxEntityRefKind kind;` to differentiate implicit and direct calls. However, there are more roles defined in SymbolRole. Among them, `Read/Write` are probably the most useful ones as they can be used to differentiate Read/Write occurrences of a symbol for document highlight in a text document. See `export namespace DocumentHighlightKind` on https://microsoft.github.io/language-server-protocol/specification Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42895 llvm-svn: 324914
* [Sema] Don't mark plain MS enums as fixedReid Kleckner2018-02-126-48/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a flaw in our AST: PR27098 MSVC always gives plain enums the underlying type 'int'. Clang does this as well, but we claim the enum is "fixed", as if the user actually wrote ': int'. It means we end up emitting spurious -Wsign-compare warnings on code like this: enum Vals { E1, E2, E3 }; bool f(unsigned v1, Vals v2) { return v1 == v2; } We think 'v2' can take on negative values because we think 'Vals' is fixed. This fixes that. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43110 llvm-svn: 324913
* Update target-note-test to be current with the AMDGPU changesErich Keane2018-02-121-9/+9
| | | | llvm-svn: 324909
* Make attribute-target on a Definition-after-use update the LLVM attributesErich Keane2018-02-124-40/+71
| | | | | | | | | | | | | | | As reported here: https://bugs.llvm.org/show_bug.cgi?id=36301 The issue is that the 'use' causes the plain declaration to emit the attributes to LLVM-IR. However, if the definition added it later, these would silently disappear. This commit extracts that logic to its own function in CodeGenModule, and has the attribute-applications done during 'definition' update the attributes properly. Differential Revision: https://reviews.llvm.org/D43095 llvm-svn: 324907
* Add Invalid-note test negllected in R324673,324674,324675,324676Erich Keane2018-02-121-0/+162
| | | | llvm-svn: 324902
* Re-commit r324490: [DebugInfo] Improvements to representation of enumeration ↵Momchil Velikov2018-02-125-10/+112
| | | | | | | | types (PR36168) Differential revision: https://reviews.llvm.org/D42736 llvm-svn: 324900
* [clang-format] Fix comment indentation in text protosKrasimir Georgiev2018-02-122-0/+13
| | | | | | | | | | Summary: This patch fixes a bug where the comment indent of comments in text protos gets messed up because by default paren states get created with AlignColons = true (which makes snese for ObjC). Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43194 llvm-svn: 324896
* Allow the NS, CF, and ObjC attributes to be used with ↵Aaron Ballman2018-02-126-50/+134
| | | | | | -fdouble-square-bracket-attributes. The syntactic locations for such attributes on ObjC constructs have been specifically chosen to follow the GNU attribute syntactic locations. llvm-svn: 324890
* ASan+operator new[]: Add an option for more thorough operator new[] cookie ↵Filipe Cabecinhas2018-02-125-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | poisoning Summary: Right now clang is skipping array cookie poisoning for any operator new[] which is not part of the set of replaceable global allocation functions. This commit adds a flag to tell clang to poison all operator new[] cookies. A previous review was poisoning all array cookies unconditionally, but there is an edge case which would stop working under ASan (a custom operator new[] saves whatever pointer it returned, and then accesses it). This newer revision adds a command line argument to toggle this feature. Original revision: https://reviews.llvm.org/D41301 Compiler-rt test revision with an explanation of the edge case: https://reviews.llvm.org/D41664 Reviewers: rjmccall, kcc, rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D43013 llvm-svn: 324884
* [CUDA] Add option to generate relocatable device codeJonas Hahnfeld2018-02-126-11/+59
| | | | | | | | | | | As a first step, pass '-c/--compile-only' to ptxas so that it doesn't complain about references to external function. This will successfully generate object files, but they won't work at runtime because the registration routines need to adapted. Differential Revision: https://reviews.llvm.org/D42921 llvm-svn: 324878
* [CUDA] Fix test cuda-external-tools.cuJonas Hahnfeld2018-02-121-51/+54
| | | | | | | | This didn't verify the CHECK prefix before! Differential Revision: https://reviews.llvm.org/D42920 llvm-svn: 324877
* [X86] Change the signature of the AVX512 packed fp compare intrinsics to ↵Craig Topper2018-02-103-33/+88
| | | | | | | | | | | | | | | | return vXi1 mask. Make bitcasts to scalar explicit in IR Summary: This is the clang equivalent of r324827 Reviewers: zvi, delena, RKSimon, spatel Reviewed By: RKSimon Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D43143 llvm-svn: 324828
* Fix test clang-diff-json.cppAaron Smith2018-02-101-3/+3
| | | | | | | | | | | | | | | Summary: This test would fail if the python path had spaces. Add a quote around the path to fix this problem and update some test values changed by the addition of quotes around the path. Tested on Windows and Linux with Python 3.x Reviewers: zturner, llvm-commits Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43164 llvm-svn: 324824
* Add vector add/sub/mul/div by scalar tests (PR27085)Simon Pilgrim2018-02-101-0/+42
| | | | | | Ensure the scalar is correctly splatted to all lanes llvm-svn: 324818
* Make a build bot happy.Gabor Horvath2018-02-102-7/+7
| | | | llvm-svn: 324809
* [Templight] Template Instantiation ObserverGabor Horvath2018-02-1025-4/+1113
| | | | | | | | | | | | | | | | | | | | | This patch adds a base-class called TemplateInstantiationObserver which gets notified whenever a template instantiation is entered or exited during semantic analysis. This is a base class used to implement the template profiling and debugging tool called Templight (https://github.com/mikael-s-persson/templight). The patch also makes a few more changes: * ActiveTemplateInstantiation class is moved out of the Sema class (so it can be used with inclusion of Sema.h). * CreateFrontendAction function in front-end utilities is given external linkage (not longer a hidden static function). * TemplateInstObserverChain data member added to Sema class to hold the list of template-inst observers. * Notifications to the template-inst observer are added at the key places where templates are instantiated. Patch by: Abel Sinkovics! Differential Revision: https://reviews.llvm.org/D5767 llvm-svn: 324808
* [analyzer] NFC: Assert that our fix for noreturn destructors keeps working.Artem Dergachev2018-02-101-5/+15
| | | | | | | | | | | | | | | | Massive false positives were known to be caused by continuing the analysis after a destructor with a noreturn attribute has been executed in the program but not modeled in the analyzer due to being missing in the CFG. Now that work is being done on enabling the modeling of temporary constructors and destructors in the CFG, we need to make sure that the heuristic that suppresses these false positives keeps working when such modeling is disabled. In particular, different code paths open up when the corresponding constructor is being inlined during analysis. Differential Revision: https://reviews.llvm.org/D42779 llvm-svn: 324802
* [analyzer] Fix a merge error in -analyzer-config tests.Artem Dergachev2018-02-102-2/+2
| | | | | | | | | | It was introduced when two -analyzer-config options were added almost simultaneously in r324793 and r324668 and the option count was not rebased correctly in the tests. Fixes the buildbots. llvm-svn: 324801
OpenPOWER on IntegriCloud