summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] Destroy tokens in DeclaratorChunk paramsBenjamin Kramer2018-07-241-2/+1
| | | | | | Otherwise this leaks in some edge cases. llvm-svn: 337862
* Don't lifetime-extend or track lifetime problems through the LHS of '->*'.Richard Smith2018-07-242-1/+7
| | | | | | Fixes a false-positive warning found by selfhost. llvm-svn: 337857
* Revert "[VFS] Cleanups to VFS interfaces."Jordan Rupprecht2018-07-243-35/+31
| | | | | | This reverts commit r337834 due to test failures. llvm-svn: 337850
* Remove stale documentation from InternalsManual.rstErich Keane2018-07-241-5/+0
| | | | | | | The DuplicatesAllowedWhileMerging was removed a while ago, but the documentation remained. llvm-svn: 337835
* [VFS] Cleanups to VFS interfaces.Sam McCall2018-07-243-31/+35
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: - add comments clarifying semantics - Status::copyWithNewName(Status, Name) --> instance method - Status::copyWithNewName(fs::file_status, Name) --> constructor (it's not a copy) - File::getName() -> getRealPath(), reflecting its actual behavior/function and stop returning status().getName() in the base class (callers can do this fallback if they want to, it complicates the contracts). This is mostly NFC, but the behavior of File::getName() affects FileManager's FileEntry::tryGetRealPathName(), which now fails in more cases: - non-real file cases - real-file cases where the underlying vfs::File was opened in a way that doesn't call realpath(). (In these cases we don't know a distinct real name, so in principle it seems OK) Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49724 llvm-svn: 337834
* [Sema] Mark implicitly-inserted ICE's as being part of explicit cast (PR38166)Roman Lebedev2018-07-2411-3/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As discussed in [[ https://bugs.llvm.org/show_bug.cgi?id=38166 | PR38166 ]], we need to be able to distinqush whether the cast we are visiting is actually a cast, or part of an `ExplicitCast`. There are at least four ways to get there: 1. Introduce a new `CastKind`, and use it instead of `IntegralCast` if we are in `ExplicitCast`. Would work, but does not scale - what if we will need more of these cast kinds? 2. Introduce a flag in `CastExprBits`, whether this cast is part of `ExplicitCast` or not. Would work, but it isn't immediately clear where it needs to be set. 2. Fix `ScalarExprEmitter::VisitCastExpr()` to visit these `NoOp` casts. As pointed out by @rsmith, CodeGenFunction::EmitMaterializeTemporaryExpr calls skipRValueSubobjectAdjustments, which steps over the CK_NoOp cast`, which explains why we currently don't visit those. This is probably impossible, as @efriedma points out, that is intentional as per `[class.temporary]` in the standard 3. And the simplest one, just record which NoOp casts we skip. It just kinda works as-is afterwards. But, the approach with a flag is the least intrusive one, and is probably the best one overall. Reviewers: rsmith, rjmccall, majnemer, efriedma Reviewed By: rsmith Subscribers: cfe-commits, aaron.ballman, vsk, llvm-commits, rsmith Differential Revision: https://reviews.llvm.org/D49508 llvm-svn: 337815
* Add a .keep file to prevent svn from skipping over an empty folder.Jiading Gai2018-07-241-0/+0
| | | | llvm-svn: 337813
* For x86_64, gcc 7.2 under Amazon Linux AMI sets its path to x86_64-amazon-linux.Jiading Gai2018-07-248-1/+24
| | | | | | | | | | | | | | | gcc 7.2 under Amazon Linux AMI sets its paths to x86_64-amazon-linux. Adding this triple to the list of search, plus a test case to cover this. The patch fixes the following bug reported in bugzilla: https://bugs.llvm.org/show_bug.cgi?id=35992 Reviewers: echristo Differential Revision: https://reviews.llvm.org/D46230 llvm-svn: 337811
* [Test commit] Fix a spelling error.Jiading Gai2018-07-241-1/+1
| | | | llvm-svn: 337807
* Revert "[DebugInfo] Generate debug information for labels. (Fix PR37395)"Shiva Chen2018-07-245-83/+0
| | | | | | This reverts commit 4288dd3bf082482e02c8a044c611c18168cb0180. llvm-svn: 337803
* [DebugInfo] Generate debug information for labels. (Fix PR37395)Shiva Chen2018-07-245-0/+83
| | | | | | | | | | | | | Generate DILabel metadata and call llvm.dbg.label after label statement to associate the metadata with the label. After fixing PR37395. Differential Revision: https://reviews.llvm.org/D45045 Patch by Hsiangkai Wang. llvm-svn: 337800
* Attempt to fix regression due to r337791Yaxun Liu2018-07-241-1/+1
| | | | llvm-svn: 337797
* Fix unused variable warnings; NFCGeorge Burgess IV2018-07-241-2/+2
| | | | | | | Looks like MTE was previously used for its SourceLoc, but we're now using a seperate SourceLocation here. llvm-svn: 337796
* [HIP] pass -target-cpu when running the device-mode compilerYaxun Liu2018-07-242-8/+10
| | | | | | Differential Revision: https://reviews.llvm.org/D49643 llvm-svn: 337793
* Add missing testcase update for r337790.Richard Smith2018-07-241-2/+2
| | | | llvm-svn: 337792
* Enable .hip files for test/DriverYaxun Liu2018-07-242-3/+3
| | | | | | Partially revert r334128 due to regressions. llvm-svn: 337791
* Warn if a local variable's initializer retains a pointer/reference to aRichard Smith2018-07-246-100/+96
| | | | | | non-lifetime-extended temporary object. llvm-svn: 337790
* Borrow visibility from __fundamental_type_info for generated fundamental ↵Thomas Anderson2018-07-242-61/+137
| | | | | | | | | | | | type infos This is necessary so the clang gives hidden visibility to fundamental types when -fvisibility=hidden is passed. Fixes https://bugs.llvm.org/show_bug.cgi?id=35066 Differential Revision: https://reviews.llvm.org/D49109 llvm-svn: 337788
* [WebAssembly] Change size_t to `unsigned long`.Dan Gohman2018-07-242-23/+25
| | | | | | | | | | | | Changing it to unsigned long (which is 32-bit on wasm32) makes it the same type as wasm64 (where unsigned long is 64-bit), which would eliminate the most common cause for mangled names being different between wasm32 and wasm64. For example, export lists containing symbol names could now often be the same between wasm32 and wasm64. Differential Revision: https://reviews.llvm.org/D40526 llvm-svn: 337783
* NFC: Add the emacs c++ mode hint "-*- C++ -*-" to the headers that don't have itErik Pilkington2018-07-2414-14/+14
| | | | | | https://llvm.org/docs/CodingStandards.html#file-headers llvm-svn: 337780
* [analyzer] Add a no-crash to a recently added test.Artem Dergachev2018-07-231-1/+1
| | | | | | No functional change intended. llvm-svn: 337776
* [analyzer] pr38273: Legalize Loc<>NonLoc comparison symbols.Artem Dergachev2018-07-232-2/+8
| | | | | | | | | Remove an assertion in RangeConstraintManager that expects such symbols to never appear, while admitting that the constraint manager doesn't yet handle them. Differential Revision: https://reviews.llvm.org/D49703 llvm-svn: 337769
* Support lifetime-extension of conditional temporaries.Richard Smith2018-07-237-129/+247
| | | | llvm-svn: 337767
* [Sema] Fix crash on BlockExprs in a default member initializersErik Pilkington2018-07-232-0/+14
| | | | | | | | | | | | Clang would crash when instantiating a BlockDecl that appeared in a default-member-initializer of a class template. Fix this by deferring the instantiation until we instantate the BlockExpr. rdar://41200624 Differential revision: https://reviews.llvm.org/D49688 llvm-svn: 337766
* [ASTMatchers] Add an isMain() matcherGeorge Karpenkov2018-07-234-0/+21
| | | | | | Differential Revision: https://reviews.llvm.org/D49615 llvm-svn: 337761
* [ASTMatchers] [NFC] Regenerate HTML docs.George Karpenkov2018-07-231-4/+4
| | | | llvm-svn: 337760
* [clang-cl] Expose -fblocks and -fno-builtin as driver flagsReid Kleckner2018-07-232-5/+10
| | | | | | | | Users have requested them. Helps with PR36427. llvm-svn: 337746
* Do not try to perform lifetime-extension through conditionalRichard Smith2018-07-233-27/+69
| | | | | | | | | expressions. CodeGen can't cope with that yet. Instead, produce a "not supported" warning for now and don't extend lifetime. llvm-svn: 337744
* Fold -Wreturn-stack-address into general initialization lifetimeRichard Smith2018-07-2317-573/+365
| | | | | | checking. llvm-svn: 337743
* Update to -r337585, allow scoped enum inits in -pedanticErich Keane2018-07-234-1/+19
| | | | llvm-svn: 337738
* [CodeGen] Record if a C++ record is a trivial typeAaron Smith2018-07-231-0/+4
| | | | | | | | | | | | | | Summary: This has a dependence on D45122 Reviewers: rnk, zturner, llvm-commits, aleksandr.urakov Reviewed By: rnk Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D45124 llvm-svn: 337736
* [ms] Fix mangling of vector types in QMM_Result contexts.Nico Weber2018-07-232-2/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | If QMM_Result is set (which it is for return types, RTTI descriptors, and exception type descriptors), tag types (structs, enums, classes, unions) get their qualifiers mangled in. __m64 and friends is a struct/union thingy in MSVC, but not in clang's headers. To make mangling work, we call mangleArtificalTagType(TTK_Union/TTK_Struct for the vector types to mangle them as tag types -- but the isa<TagType> check when mangling in QMM_Result mode isn't true for these vector types. Add an isArtificialTagType() function and check for that too. Fixes PR37276 and some other issues. I tried to audit all references to TagDecl and TagType in MicrosoftMangle.cpp to find other places where we need to call mangleArtificalTagType(), but couldn't find any. I tried to audit all calls to mangleArtificalTagType() to see if isArtificialTagType() needs to handle more than just the vector types, but as far as I can tell all other types we use it for are types that MSVC can't handle at all (Objective-C types etc). https://reviews.llvm.org/D49597 llvm-svn: 337732
* Separate out the initialization kind for a statement expression resultRichard Smith2018-07-234-27/+50
| | | | | | | | | | from that for a return value. No functionality change intended: I don't believe any of the diagnostics affected by this patch are reachable when initializing the result of statement expression. llvm-svn: 337728
* Fold dangling-field warning into general initialization lifetime checks.Richard Smith2018-07-236-155/+203
| | | | | | | This reinstates r337627, reverted in r337671, with a fix to correctly handle the lvalueness of array subscript expressions on pointers. llvm-svn: 337726
* Revert "[OPENMP] Fix PR38026: Link -latomic when -fopenmp is used."Jonas Hahnfeld2018-07-232-13/+9
| | | | | | | | | | | | This reverts commit r336467: libatomic is not available on all Linux systems and this commit completely breaks OpenMP on them, even if there are no atomic operations or all of them can be lowered to hardware instructions. See http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20180716/234816.html for post-commit discussion. llvm-svn: 337722
* [CStringSyntaxChecker] Improvements of strlcpy checkDavid Carlier2018-07-232-2/+19
| | | | | | | | | | | | Adding an additional check whenwe offset fro the buffer base address. Reviewers: george.karpenkov,NoQ Reviewed By: george.karpenkov Differential Revision: https://reviews.llvm.org/D49633 llvm-svn: 337721
* [DebugInfo] Error out when enabling -fdebug-types-section on non-ELF target.Jonas Devlieghere2018-07-232-2/+15
| | | | | | | | | | | Currently, support for debug_types is only present for ELF and trying to pass -fdebug-types-section for other targets results in a crash in the backend. Until this is fixed, we should emit a diagnostic in the front end when the option is passed for non-linux targets. Differential revision: https://reviews.llvm.org/D49594 llvm-svn: 337717
* [MS] Update _MSVC_LANG values for C++17 and C++2aReid Kleckner2018-07-233-105/+114
| | | | | | Fixes PR38262 llvm-svn: 337715
* [Sema] Don't emit -Wmemset-transposed-args for memset(p,0,0)Erik Pilkington2018-07-232-4/+8
| | | | | | Thanks to Arthur O'Dwyer for the suggestion! llvm-svn: 337706
* [NEON] Define half-precision vmaxnm intrinsics only when availableIvan A. Kosarev2018-07-232-3/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D49375 llvm-svn: 337704
* [ASTMatchers] add matcher for decltypeType and its underlyingTypeJonas Toth2018-07-234-0/+34
| | | | | | | | | | | | | | | | Summary: This patch introduces a new matcher for `DecltypeType` and its underlying type in order to fix a bug in clang-tidy, see https://reviews.llvm.org/D48717 for more. Reviewers: aaron.ballman, alexfh, NoQ, dcoughlin Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D48759 llvm-svn: 337703
* [NEON] Define half-precision vrnd intrinsics only when availableIvan A. Kosarev2018-07-232-6/+64
| | | | | | Differential Revision: https://reviews.llvm.org/D49376 llvm-svn: 337699
* [NEON] Fix support for vrndi_f32(), vrndiq_f32() and vrndns_f32() intrinsicsIvan A. Kosarev2018-07-235-188/+87
| | | | | | | | | | This patch adds support for vrndi_f32() and vrndiq_f32() intrinsics in AArch32 mode and for vrndns_f32() intrinsic in AArch64 mode. Differential Revision: https://reviews.llvm.org/D48829 llvm-svn: 337690
* [AST] Use llvm::TrailingObjects in CXXTryStmtBenjamin Kramer2018-07-232-17/+12
| | | | | | | | | | | | | | 1. Use llvm::TrailingObjects in CXXTryStmt instead of manually doing the reinterpret_casts + pointer arithmetic. This is more consistent with other classes using this idiom and this make it clearer that this class has trailing objects. 2. Make the class CXXTryStmt final since it has trailing objects. 3. Move the friend declarations together. No functional changes. Patch by Bruno Ricci! Differential Revision: https://reviews.llvm.org/D48873 llvm-svn: 337688
* [Tooling] Use UniqueStringSaver. NFCSam McCall2018-07-232-13/+3
| | | | llvm-svn: 337682
* Fix for last commit: adding new test file forgotten.Adam Balogh2018-07-231-0/+43
| | | | llvm-svn: 337679
* [Analyzer] Quick Fix for exponential execution time when simpilifying ↵Adam Balogh2018-07-237-28/+94
| | | | | | | | | | | | | | | | | | complex additive expressions Patch https://reviews.llvm.org/rC329780 not only rearranges comparisons but also binary expressions. This latter behavior is not protected by the analyzer option. Hower, since no complexity threshold is enforced to the symbols this may result in exponential execution time if the expressions are too complex: https://bugs.llvm.org/show_bug.cgi?id=38208. For a quick fix we extended the analyzer option to also cover the additive cases. This is only a temporary fix, the final solution should be enforcing the complexity threshold to the symbols. Differential Revision: https://reviews.llvm.org/D49536 llvm-svn: 337678
* Revert "Fold dangling-field warning into general initialization lifetime ↵Ilya Biryukov2018-07-235-191/+152
| | | | | | | | | | | | | | | | checks." This reverts commit r337627. After the change, clang started producing invalid warning on the following code: struct foo { foo(char *x) : x_(&x[10]) {} private: char *x_; }; 1.cpp:2:21: warning: initializing pointer member 'x_' with the stack address of parameter 'x' [-Wdangling-field] llvm-svn: 337671
* Fix the testBrad Smith2018-07-221-1/+2
| | | | llvm-svn: 337663
* OpenBSD/arm has switched to float ABI SoftFP.Brad Smith2018-07-222-2/+2
| | | | llvm-svn: 337660
OpenPOWER on IntegriCloud