- Sep 11, 2017
-
-
Vedant Kumar authored
Differential Revision: https://reviews.llvm.org/D37647 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312957 91177308-0d34-0410-b5e6-96231b3b80d8
-
Vedant Kumar authored
This patch teaches the preprocessor to report more precise source ranges for code that is skipped due to conditional directives. The new behavior includes the '#' from the opening directive and the full text of the line containing the closing directive in the skipped area. This matches up clang's behavior (we don't IRGen the code between the closing "endif" and the end of a line). This also affects the code coverage implementation. See llvm.org/PR34166 (this also happens to be rdar://problem/23224058). The old behavior (report the end of the skipped range as the end location of the 'endif' token) is preserved for indexing clients. Differential Revision: https://reviews.llvm.org/D36642 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312947 91177308-0d34-0410-b5e6-96231b3b80d8
-
Miklos Vajna authored
Summary: The use case is that renaming multiple symbols in a large enough codebase is much faster if all of these can be done with a single invocation, but there will be multiple translation units where one or more symbols are not found. Old behavior was to exit with an error (default) or exit without reporting an error (-force). New behavior is that -force results in a best-effort rename: rename symbols which are found and just ignore the rest. The existing help for -force sort of already implies this behavior. Reviewers: cfe-commits, klimek, arphaman Reviewed By: klimek Differential Revision: https://reviews.llvm.org/D37634 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312942 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
This primarily impacts the Windows MSVC and Windows itanium environments. Windows MSVC does not use `__cxa_atexit` and Itanium follows suit. Simplify the logic for the default value calculation and blanket the Windows environments to default to off for use of `__cxa_atexit`. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312941 91177308-0d34-0410-b5e6-96231b3b80d8
-
Martin Probst authored
Summary: While `goog.setTestOnly` usually appears in the imports section of a file, it is not actually an import, and also usually doesn't take long parameters (nor namespaces as a parameter, it's a description/message that should be wrapped). This fixes a regression where a `goog.setTestOnly` call nested in a function was not wrapped. Reviewers: djasper Subscribers: klimek Differential Revision: https://reviews.llvm.org/D37685 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312918 91177308-0d34-0410-b5e6-96231b3b80d8
-
Cameron Desrochers authored
When using a virtual file-system (VFS) and a preamble file (PCH) is generated, it is generated on-disk in the real file-system instead of in the VFS (which makes sense, since the VFS is read-only). However, when subsequently reading the generated PCH, the frontend passes through the VFS it has been given -- resulting in an error and a failed parse (since the VFS doesn't contain the PCH; the real filesystem does). This patch fixes that by detecting when a VFS is being used for a parse that needs to work with a PCH file, and creating an overlay VFS that includes the PCH file from the real file-system. This allows tests to be written which make use of both PCH files and a VFS. Differential Revision: https://reviews.llvm.org/D37474 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312917 91177308-0d34-0410-b5e6-96231b3b80d8
-
Johannes Altmanninger authored
Summary: This causes template arguments to be traversed before the templated declaration, which is useful for clients that expect the nodes in the same order as they are in the source code. Additionally, there seems to be no good reason not to do so. This was moved here from LexicallyOrderedRecursiveASTVisitor. The tests still reside in LexicallyOrderedRecursiveASTVisitorTest.cpp under VisitTemplateDecls. Reviewers: arphaman, rsmith, klimek Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37662 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312911 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
Summary: **Short overview:** Fixed bug: https://bugs.llvm.org/show_bug.cgi?id=34001 Clang-format bug resulting in a strange behavior of control statements short blocks. Different flags combinations do not guarantee expected result. Turned on option AllowShortBlocksOnASingleLine does not work as intended. **Description of the problem:** Cpp source file UnwrappedLineFormatter does not handle AllowShortBlocksOnASingleLine flag as it should. Putting a single-line control statement without any braces, clang-format works as expected (depending on AllowShortIfStatementOnASingleLine or AllowShortLoopsOnASingleLine value). Putting a single-line control statement in braces, we can observe strange and incorrect behavior. Our short block is intercepted by tryFitMultipleLinesInOne function. The function returns a number of lines to be merged. Unfortunately, our control statement block is not covered properly. There are several if-return statements, but none of them handles our block. A block is identified by the line first token and by left and right braces. A function block works as expected, there is such an if-return statement doing proper job. A control statement block, from the other hand, falls into strange conditional construct, which depends on BraceWrapping.AfterFunction flag (with condition that the line’s last token is left brace, what is possible in our case) or goes even further. That should definitely not happen. **Description of the patch:** By adding three different if statements, we guarantee that our short control statement block, however it looks like (different brace wrapping flags may be turned on), is handled properly and does not fall into wrong conditional construct. Depending on appropriate options we return either 0 (when something disturbs our merging attempt) or let another function (tryMergeSimpleBlock) take the responsibility of returned result (number of merged lines). Nevertheless, one more correction is required in mentioned tryMergeSimpleBlock function. The function, previously, returned either 0 or 2. The problem was that this did not handle the case when our block had the left brace in a separate line, not the header one. After change, after adding condition, we return the result compatible with block’s structure. In case of left brace in the header’s line we do everything as before the patch. In case of left brace in a separate line we do the job similar to the one we do in case of a “non-header left brace” function short block. To be precise, we try to merge the block ignoring the header line. Then, if success, we increment our returned result. **After fix:** **CONFIG:** ``` AllowShortBlocksOnASingleLine: true AllowShortIfStatementsOnASingleLine: true BreakBeforeBraces: Custom BraceWrapping: { AfterClass: true, AfterControlStatement: true, AfterEnum: true, AfterFunction: true, AfterNamespace: false, AfterStruct: true, AfterUnion: true, BeforeCatch: true, BeforeElse: true } ``` **BEFORE:** ``` if (statement) doSomething(); if (statement) { doSomething(); } if (statement) { doSomething(); } if (statement) { doSomething(); } if (statement) doSomething(); if (statement) { doSomething1(); doSomething2(); } ``` **AFTER:** ``` if (statement) doSomething(); if (statement) { doSomething(); } if (statement) { doSomething(); } if (statement) { doSomething(); } if (statement) doSomething(); if (statement) { doSomething1(); doSomething2(); } ``` Contributed by @PriMee! Reviewers: krasimir, djasper Reviewed By: krasimir Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D37140 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312904 91177308-0d34-0410-b5e6-96231b3b80d8
-
Daniel Jasper authored
Revert r312830: "Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of the pointer used in atomic expr"." This triggers llvm.org/PR31620 in several of our internal builds. I'll forward reproduction instructions to the original author. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312897 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 10, 2017
-
-
Dave Lee authored
Summary: Add the `objcImplementationDecl` matcher. See related: D30854 Tested with: ``` ./tools/clang/unittests/ASTMatchers/ASTMatchersTests ``` Reviewers: aaron.ballman, compnerd, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D37643 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312889 91177308-0d34-0410-b5e6-96231b3b80d8
-
Coby Tayree authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312882 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sylvestre Ledru authored
set the svn:executable property, seems that it is necessary for apache (discussed with Tanya by email) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312877 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 09, 2017
-
-
Nuno Lopes authored
Differential Revision: https://reviews.llvm.org/D37628 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312870 91177308-0d34-0410-b5e6-96231b3b80d8
-
MinSeong Kim authored
Summary: The find_first_existing_file and find_first_existing_vc_file macros in lib/Basic/CMakeLists.txt are removed. The macros are also defined in {LLVM}/cmake/modules/AddLLVM.cmake for the same purpose. This change serves the following 2 objectives: 1. To remove the redundant code in clang to use the same macros in llvm, 2. The macros in AddLLVM.cmake can also handle repo for displaying correct version information. Reviewers: jordan_rose, cfe-commits, modocache, hintonda Reviewed By: hintonda Subscribers: mgorny Differential Revision: https://reviews.llvm.org/D35533 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312865 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
This fixes a possible crash on certain kinds of corrupted AST file, but checking in an AST file corrupted in just the right way will be a maintenance nightmare because the format changes frequently. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312851 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312850 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Trieu authored
Treat typedef enum as named enums instead of anonymous enums. Anonymous enums are ignored by the warning, so previously, typedef enums were ignored as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312842 91177308-0d34-0410-b5e6-96231b3b80d8
-
Saleem Abdulrasool authored
When performing a NSFastEnumeration, the compiler synthesizes a call to `countByEnumeratingWithState:objects:count:` where the `count` parameter is of type `NSUInteger` and the return type is a `NSUInteger`. We would previously always use a `UnsignedLongTy` for the `NSUInteger` type. On 32-bit targets, `long` is 32-bits which is the same as `unsigned int`. Most 64-bit targets are LP64, where `long` is 64-bits. However, on LLP64 targets, such as Windows, `long` is 32-bits. Introduce new `getNSUIntegerType` and `getNSIntegerType` helpers to allow us to determine the correct type for the `NSUInteger` type. Wire those through into the generation of the message dispatch to the selector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312835 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 08, 2017
-
-
Wei Mi authored
Reinstall the patch "Use EmitPointerWithAlignment to get alignment information of the pointer used in atomic expr". This is to fix PR34347. EmitAtomicExpr now only uses alignment information from Type, instead of Decl, so when the declaration of an atomic variable is marked to have the alignment equal as its size, EmitAtomicExpr doesn't know about it and will generate libcall instead of atomic op. The patch uses EmitPointerWithAlignment to get the precise alignment information. Differential Revision: https://reviews.llvm.org/D37310 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312830 91177308-0d34-0410-b5e6-96231b3b80d8
-
Vedant Kumar authored
The current coverage implementation doesn't handle region termination very precisely. Take for example an `if' statement with a `return': void f() { if (true) { return; // The `if' body's region is terminated here. } // This line gets the same coverage as the `if' condition. } If the function `f' is called, the line containing the comment will be marked as having executed once, which is not correct. The solution here is to create a deferred region after terminating a region. The deferred region is completed once the start location of the next statement is known, and is then pushed onto the region stack. In the cases where it's not possible to complete a deferred region, it can safely be dropped. Testing: lit test updates, a stage2 coverage-enabled build of clang This is a reapplication but there are no changes from the original commit. With D36813, the segment builder in llvm will be able to handle deferred regions correctly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312818 91177308-0d34-0410-b5e6-96231b3b80d8
-
Aaron Ballman authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312811 91177308-0d34-0410-b5e6-96231b3b80d8
-
Wei Mi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312810 91177308-0d34-0410-b5e6-96231b3b80d8
-
Wei Mi authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312805 91177308-0d34-0410-b5e6-96231b3b80d8
-
Wei Mi authored
This is to fix PR34347. EmitAtomicExpr now only uses alignment information from Type, instead of Decl, so when the declaration of an atomic variable is marked to have the alignment equal as its size, EmitAtomicExpr doesn't know about it and will generate libcall instead of atomic op. The patch uses EmitPointerWithAlignment to get the precise alignment information. Differential Revision: https://reviews.llvm.org/D37310 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312801 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sjoerd Meijer authored
Pacify the windows builder; fixed the new test as on Windows some additional attributes are printed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312798 91177308-0d34-0410-b5e6-96231b3b80d8
-
Konstantin Zhuravlyov authored
Differential Revision: https://reviews.llvm.org/D37599 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312795 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sjoerd Meijer authored
This is a recommit of r312781; in some build configurations variable names are omitted, so changed the new regression test accordingly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312794 91177308-0d34-0410-b5e6-96231b3b80d8
-
Roman Lebedev authored
Summary: As requested by Sam McCall. ``` $ /build/llvm-build-Clang-release/./bin/clang -c /build/clang/test/Sema/outof-range-constant-compare.c /build/clang/test/Sema/outof-range-constant-compare.c:40:11: warning: comparison of unsigned expression < 0 is always false [-Wtautological-unsigned-zero-compare] if (a < 0x0000000000000000UL) // expected-warning {{comparison of unsigned expression < 0 is always false}} ~ ^ ~~~~~~~~~~~~~~~~~~~~ ``` Reviewers: sammccall, bkramer, djasper, rsmith, rjmccall, aaron.ballman Reviewed By: sammccall, aaron.ballman Subscribers: aaron.ballman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D37620 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312792 91177308-0d34-0410-b5e6-96231b3b80d8
-
Krasimir Georgiev authored
Summary: 1.Updated annotations for include/clang/StaticAnalyzer/Core/PathSensitive/Store.h, which belong to the old version of clang. 2.Delete annotations for CodeGenFunction::getEvaluationKind() in clang/lib/CodeGen/CodeGenFunction.h, which belong to the old version of clang. Reviewers: bkramer, krasimir, klimek Reviewed By: bkramer Subscribers: MTC Differential Revision: https://reviews.llvm.org/D36330 Contributed by @MTC! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312790 91177308-0d34-0410-b5e6-96231b3b80d8
-
Ilya Biryukov authored
Summary: The crash occured when FunctionDecl was parsed with an initializer. Reviewers: bkramer, klimek, francisco.lopes Reviewed By: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D37382 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312788 91177308-0d34-0410-b5e6-96231b3b80d8
-
Erik Verbruggen authored
In case of copy constructor is implicitly deleted it's still shown. PR34402 describes a way to reproduce that. Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D37435 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312785 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sjoerd Meijer authored
The clang-with-lto-ubuntu bot didn't like the new regression test, revert while I investigate the issue. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312784 91177308-0d34-0410-b5e6-96231b3b80d8
-
Sjoerd Meijer authored
This adds _Float16 as a source language type, which is a 16-bit floating point type defined in C11 extension ISO/IEC TS 18661-3. In follow up patches documentation and more tests will be added. Differential Revision: https://reviews.llvm.org/D33719 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312781 91177308-0d34-0410-b5e6-96231b3b80d8
-
Erik Verbruggen authored
When we have enabled cache for global completions we did not have diagnostics for Bar and could not complete Ba as in provided code example. template <typename T> struct Foo { T member; }; template<typename T> using Bar = Foo<T>; int main() { Ba } (This is the fixed version of r 311442, which was reverted in r311445.) Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D35355 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312780 91177308-0d34-0410-b5e6-96231b3b80d8
-
Peter Collingbourne authored
Differential Revision: https://reviews.llvm.org/D37607 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312770 91177308-0d34-0410-b5e6-96231b3b80d8
-
Rafael Espindola authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312766 91177308-0d34-0410-b5e6-96231b3b80d8
-
Roman Lebedev authored
Summary: This is a first half(?) of a fix for the following bug: https://bugs.llvm.org/show_bug.cgi?id=34147 (gcc -Wtype-limits) GCC's -Wtype-limits does warn on comparison of unsigned value with signed zero (as in, with 0), but clang only warns if the zero is unsigned (i.e. 0U). Also, be careful not to double-warn, or falsely warn on comparison of signed/fp variable and signed 0. Yes, all these testcases are needed. Testing: $ ninja check-clang-sema check-clang-semacxx Also, no new warnings for clang stage-2 build. Reviewers: rjmccall, rsmith, aaron.ballman Reviewed By: rjmccall Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D37565 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312750 91177308-0d34-0410-b5e6-96231b3b80d8
-
Richard Smith authored
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312749 91177308-0d34-0410-b5e6-96231b3b80d8
-
Jonathan Roelofs authored
The ToolChain class validates the -mthread-model flag in the constructor which doesn't work correctly since the thread model methods are virtual methods. The check is moved into Clang::ConstructJob() when constructing the internal command line. https://reviews.llvm.org/D37496 Patch by: Ian Tessier! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312748 91177308-0d34-0410-b5e6-96231b3b80d8
-
- Sep 07, 2017
-
-
Richard Smith authored
Fixes some accepts-invalids with tags and other declarations declared in the same scope. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@312743 91177308-0d34-0410-b5e6-96231b3b80d8
-