summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sema] P0961R1: Relaxing the structured bindings customization point finding ↵Erik Pilkington2018-08-091-2/+15
| | | | | | | | rules Differential revision: https://reviews.llvm.org/D50418 llvm-svn: 339375
* Add getEndLoc API to replace getLocEndStephen Kelly2018-08-096-14/+15
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50348 llvm-svn: 339374
* Add getBeginLoc API to replace getStartLocStephen Kelly2018-08-091-1/+2
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50347 llvm-svn: 339373
* Add getBeginLoc API to replace getLocStartStephen Kelly2018-08-094-14/+15
| | | | | | | | Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50346 llvm-svn: 339372
* [analyzer] Fix the bug in UninitializedObjectChecker caused by not handling ↵George Karpenkov2018-08-091-2/+3
| | | | | | | | block pointers Differential Revision: https://reviews.llvm.org/D50523 llvm-svn: 339369
* Implement diagnostic stream operator for ParsedAttr.Erich Keane2018-08-094-285/+254
| | | | | | | | | | | | | As a part of attempting to clean up the way attributes are printed, this patch adds an operator << to the diagnostics/ partialdiagnostics so that ParsedAttr can be sent directly. This patch also rewrites a large amount* of the times when ParsedAttr was printed using its IdentifierInfo object instead of being printed itself. *"a large amount" == "All I could find". llvm-svn: 339344
* Fix structural inequivalency of forward EnumDeclGabor Marton2018-08-091-0/+8
| | | | | | | | | | | | | | Summary: Currently we consider one forward declared RecordDecl and another with a definition equal. We have to do the same in case of enums. Reviewers: a_sidorin, r.stahl, xazax.hun Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50444 llvm-svn: 339336
* Add support for importing imaginary literalsGabor Marton2018-08-092-0/+14
| | | | | | | | | | Reviewers: a_sidorin, r.stahl, xazax.hun Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D50428 llvm-svn: 339334
* Correctly initialise global blocks on Windows.David Chisnall2018-08-091-2/+26
| | | | | | | | | | | | | | | | | | Summary: Windows does not allow globals to be initialised to point to globals in another DLL. Exported globals may be referenced only from code. Work around this by creating an initialiser that runs in early library initialisation and sets the isa pointer. Reviewers: rjmccall Reviewed By: rjmccall Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50436 llvm-svn: 339317
* Refactor attribute printing to be a bit more obviously-correct.Richard Smith2018-08-091-13/+9
| | | | | | No functionality change intended. llvm-svn: 339306
* Delete some unreachable AST printing code.Richard Smith2018-08-091-16/+0
| | | | llvm-svn: 339304
* [Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExprCraig Topper2018-08-081-3/+9
| | | | | | | | | | This addresses a FIXME that has existed since before clang supported the builtin. This time with only reviewed changes. Differential Revision: https://reviews.llvm.org/D50471 llvm-svn: 339295
* [ADT] Normalize empty triple componentsPetr Hosek2018-08-082-3/+2
| | | | | | | | | | | | | | | | | LLVM triple normalization is handling "unknown" and empty components differently; for example given "x86_64-unknown-linux-gnu" and "x86_64-linux-gnu" which should be equivalent, triple normalization returns "x86_64-unknown-linux-gnu" and "x86_64--linux-gnu". autoconf's config.sub returns "x86_64-unknown-linux-gnu" for both "x86_64-linux-gnu" and "x86_64-unknown-linux-gnu". This changes the triple normalization to behave the same way, replacing empty triple components with "unknown". This addresses PR37129. Differential Revision: https://reviews.llvm.org/D50219 llvm-svn: 339294
* Revert r339287 "[Builtins] Add __builtin_clrsb support to ↵Craig Topper2018-08-081-9/+3
| | | | | | | | IntExprEvaluator::VisitBuiltinCallExpr" This add an additional unintended change in it. llvm-svn: 339289
* [Builtins] Add __builtin_clrsb support to IntExprEvaluator::VisitBuiltinCallExprCraig Topper2018-08-081-3/+9
| | | | | | | | This addresses a FIXME that has existed since before clang supported the builtin. Differential Revision: https://reviews.llvm.org/D50471 llvm-svn: 339287
* [Headers] Define *_HAS_SUBNORM for FLT, DBL, LDBLPirama Arumuga Nainar2018-08-081-0/+6
| | | | | | | | | | | | | | Summary: These macros are defined in the C11 standard and can be defined based on the __*_HAS_DENORM__ default macros. Reviewers: bruno, rsmith, doug.gregor Subscribers: llvm-commits, enh, srhines Differential Revision: https://reviews.llvm.org/D37302 llvm-svn: 339284
* [Builtins] Implement __builtin_clrsb to be compatible with gccCraig Topper2018-08-081-0/+20
| | | | | | | | | | gcc defines an intrinsic called __builtin_clrsb which counts the number of extra sign bits on a number. This is equivalent to counting the number of leading zeros on a positive number or the number of leading ones on a negative number and subtracting one from the result. Since we can't count leading ones we need to invert negative numbers to count zeros. This patch will cause the builtin to be expanded inline while gcc uses a call to a function like clrsbdi2 that is implemented in libgcc. But this is similar to what we already do for popcnt. And I don't think compiler-rt supports clrsbdi2. Differential Revision: https://reviews.llvm.org/D50168 llvm-svn: 339282
* [CodeGen][Timers] Enable llvm::TimePassesIsEnabled when -ftime-report is ↵Craig Topper2018-08-081-0/+1
| | | | | | | | | | specified r330571 added a new FrontendTimesIsEnabled variable and replaced many usages of llvm::TimePassesIsEnabled. Including the place that set llvm::TimePassesIsEnabled for -ftime-report. The effect of this is that -ftime-report now only contains the timers specifically referenced in CodeGenAction.cpp and none of the timers in the backend. This commit adds back the assignment, but otherwise leaves everything else unchanged. llvm-svn: 339281
* AMDGPU: Fix enabling denormals by default on pre-VI targetsMatt Arsenault2018-08-082-66/+68
| | | | | | | | Fast FMAF is not a sufficient condition to enable denormals. Before VI, enabling denormals caused F32 instructions to run at F64 speeds. llvm-svn: 339278
* [DebugInfo][OpenCL] Address post-commit review for r338299Scott Linder2018-08-082-55/+97
| | | | | | | | NFC refactor of code to generate debug info for OpenCL 2.X blocks. Differential Revision: https://reviews.llvm.org/D50099 llvm-svn: 339265
* [CGObjCGNU] Rename GetSelector helper method to fix -Woverloaded-virtual ↵Simon Pilgrim2018-08-081-8/+8
| | | | | | | | | | warning (PR38210) As suggested by @theraven on PR38210, this patch fixes the gcc -Woverloaded-virtual warnings by renaming the extra CGObjCGNU::GetSelector method to CGObjCGNU::GetTypedSelector Differential Revision: https://reviews.llvm.org/D50448 llvm-svn: 339264
* [AST] Check described template at structural equivalence check.Balazs Keri2018-08-081-119/+138
| | | | | | | | | | | | | | | | | | | | Summary: When checking a class or function the described class or function template is checked too. Split StructuralEquivalenceContext::Finish into multiple functions. Improved test with symmetric check, added new tests. Reviewers: martong, a.sidorin, a_sidorin, bruno Reviewed By: martong, a.sidorin Subscribers: rnkovacs, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D49223 llvm-svn: 339256
* [analyzer][UninitializedObjectChecker] Pointer/reference objects are ↵Kristof Umann2018-08-081-34/+75
| | | | | | | | | | | | | | | | dereferenced according to dynamic type This patch fixed an issue where the dynamic type of pointer/reference object was known by the analyzer, but wasn't obtained in the checker, which resulted in false negatives. This should also increase reliability of the checker, as derefencing is always done now according to the dynamic type (even if that happens to be the same as the static type). Special thanks to Artem Degrachev for setting me on the right track. Differential Revision: https://reviews.llvm.org/D49199 llvm-svn: 339240
* [analyzer][UninitializedObjectChecker] Fixed a false negative by no longer ↵Kristof Umann2018-08-081-15/+33
| | | | | | | | | | | | | | | | | filtering out certain constructor calls As of now, all constructor calls are ignored that are being called by a constructor. The point of this was not to analyze the fields of an object, so an uninitialized field wouldn't be reported multiple times. This however introduced false negatives when the two constructors were in no relation to one another -- see the test file for a neat example for this with singletons. This patch aims so fix this issue. Differential Revision: https://reviews.llvm.org/D48436 llvm-svn: 339237
* [ASTImporter] Load external Decls when getting field index.Balazs Keri2018-08-081-19/+28
| | | | | | | | | | | | | | | | | Summary: At equality check of fields without name the index of fields is compared. At determining the index of a field all fields of the parent context should be loaded from external source to find the field at all. Reviewers: a.sidorin, a_sidorin, r.stahl Reviewed By: a.sidorin Subscribers: martong, cfe-commits Differential Revision: https://reviews.llvm.org/D49796 llvm-svn: 339226
* [NFC][VFS] Fix typos in comments.Volodymyr Sapsai2018-08-081-2/+2
| | | | llvm-svn: 339215
* PR38286: Don't crash when attempting to define a constructor for anRichard Smith2018-08-081-2/+8
| | | | | | incomplete class template. llvm-svn: 339210
* [CodeGen] IncompleteArray Support Balaji V. Iyer2018-08-081-0/+10
| | | | | | | | | Added code to support ArrayType that is not ConstantArray. https://reviews.llvm.org/D49952 rdar://42476155 llvm-svn: 339207
* [analyzer] Avoid querying this-pointers for static-methods.Matt Davis2018-08-071-2/+4
| | | | | | | | | | | | | | | | | | | Summary: The loop-widening code processes c++ methods looking for `this` pointers. In the case of static methods (which do not have `this` pointers), an assertion was triggering. This patch avoids trying to process `this` pointers for static methods, and thus avoids triggering the assertion . Reviewers: dcoughlin, george.karpenkov, NoQ Reviewed By: NoQ Subscribers: NoQ, xazax.hun, szepet, a.sidorin, mikhail.ramalho, cfe-commits Differential Revision: https://reviews.llvm.org/D50408 llvm-svn: 339201
* [VFS] Unify iteration code for VFSFromYamlDirIterImpl, NFC intended.Volodymyr Sapsai2018-08-071-19/+10
| | | | | | | | | | | | | | First and subsequent iteration steps are similar, capture this similarity. Reviewers: bruno, benlangmuir Reviewed By: bruno Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D50118 llvm-svn: 339199
* [Sema] Ensure an auto non-type template parameter is dependentErik Pilkington2018-08-071-1/+10
| | | | | | | | | | | The dependent auto was getting stripped away while rebuilding the template parameter type, so substitute it in. rdar://41852459 Differential revision: https://reviews.llvm.org/D50088 llvm-svn: 339198
* [NFC] CGDecl factor out constant emissionJF Bastien2018-08-071-47/+56
| | | | | | The code is cleaner this way, and with some changes I'm playing with it makes sense to split it out so we can reuse it. llvm-svn: 339191
* Clean up and simplify RequireCompleteType.Richard Smith2018-08-072-56/+42
| | | | | | | No functional change intended, except that we will now produce more "declared here" notes. llvm-svn: 339187
* [Headers] Expand _Unwind_Exception for SEH on MinGW/x86_64Martin Storsjo2018-08-071-0/+4
| | | | | | | | This matches how GCC defines this struct. Differential Revision: https://reviews.llvm.org/D50380 llvm-svn: 339170
* [Sema] Fix for crash on conditional operation with address_space pointerLeonard Chan2018-08-071-24/+20
| | | | | | | | | | | | | | | | | | | | | | Compiling the following causes clang to crash ``` char *cmp(__attribute__((address_space(1))) char *x, __attribute__((address_space(2))) char *y) { return x < y ? x : y; } ``` with the message: "wrong cast for pointers in different address spaces(must be an address space cast)!" This is because during IR emission, the source and dest type for a bitcast should not have differing address spaces. This fix prints an error since the code shouldn't compile in the first place. Differential Revision: https://reviews.llvm.org/D50278 llvm-svn: 339167
* [VFS] Emit an error when entry at root level uses a relative path.Volodymyr Sapsai2018-08-071-3/+15
| | | | | | | | | | | | | | | | | | | | | Entries with only a filename prevent us from building a file system tree and cause the assertion > Assertion failed: (NewParentE && "Parent entry must exist"), function uniqueOverlayTree, file clang/lib/Basic/VirtualFileSystem.cpp, line 1303. Entries with a relative path are simply not discoverable during header search. rdar://problem/28990865 Reviewers: bruno, benlangmuir Reviewed By: bruno Subscribers: dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D49518 llvm-svn: 339164
* [WebAssembly] Remove use of lld -flavor flagSam Clegg2018-08-072-5/+1
| | | | | | | | | This flag is deprecated. The preferred way to select the lld flavor is by calling it by one of its aliases. Differential Revision: https://reviews.llvm.org/D50395 llvm-svn: 339163
* [OPENMP] Mark variables captured in declare target region as implicitlyAlexey Bataev2018-08-074-8/+44
| | | | | | | | | declare target. According to OpenMP 5.0, variables captured in lambdas in declare target regions must be considered as implicitly declare target. llvm-svn: 339152
* [OpenCL] Restore r338899 (reverted in r338904), fixing stack-use-after-returnScott Linder2018-08-071-21/+35
| | | | | | | | | Always emit alloca in entry block for enqueue_kernel builtin. Ensures the statically sized alloca is not converted to DYNAMIC_STACKALLOC later because it is not in the entry block. llvm-svn: 339150
* [analyzer][UninitializedObjectChecker] New flag to turn off dereferencingKristof Umann2018-08-071-8/+35
| | | | | | | | | | | Even for a checker being in alpha, some reports about pointees held so little value to the user that it's safer to disable pointer/reference chasing for now. It can be enabled with a new flag, in which case checker should function as it has always been. This can be set with `CheckPointeeInitialization`. Differential Revision: https://reviews.llvm.org/D49438 llvm-svn: 339135
* [objc-gnustep] Don't emit .guess ivar offset vars.David Chisnall2018-08-071-34/+4
| | | | | | | | | | | These were intended to allow non-fragile and fragile ABI code to be mixed, as long as the fragile classes were higher up the hierarchy than the non-fragile ones. Unfortunately: - No one actually wants to do this. - Recent versions of Linux's run-time linker break it. llvm-svn: 339128
* [clang-format] comment reflow: add last line's penalty when ending brokenKrasimir Georgiev2018-08-071-1/+8
| | | | | | | | | | | | | | | | | | Summary: This fixes a bug in clang-format where the last line's penalty is not taken into account when its ending is broken. Usually the last line's penalty is handled by addNextStateToQueue, but in cases where the trailing `*/` is put on a newline, the contents of the last line have to be considered for penalizing. Reviewers: mprobst Reviewed By: mprobst Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50378 llvm-svn: 339123
* AMDGPU: Add builtin for s_dcache_wbMatt Arsenault2018-08-071-0/+1
| | | | llvm-svn: 339110
* AMDGPU: Add builtin for s_dcache_inv_volMatt Arsenault2018-08-071-1/+3
| | | | llvm-svn: 339109
* [analyzer] Add ASTContext to CheckerManagerGeorge Karpenkov2018-08-063-30/+29
| | | | | | | | | Some checkers require ASTContext. Having it in the constructor saves a lot of boilerplate of having to pass it around. Differential Revision: https://reviews.llvm.org/D50111 llvm-svn: 339079
* [analyzer] InnerPointerChecker: fix displayed checker name.Reka Kovacs2018-08-063-8/+28
| | | | | | | | | | | | | | | | For InnerPointerChecker to function properly, both the checker itself and parts of MallocChecker that handle relevant use-after-free problems need to be turned on. So far, the latter part has been developed within MallocChecker's NewDelete sub-checker, often causing warnings to appear under that name. This patch defines a new CheckKind within MallocChecker for the inner pointer checking functionality, so that the correct name is displayed in warnings and in the ExplodedGraph. Tested on clang-tidy. Differential Review: https://reviews.llvm.org/D50211 llvm-svn: 339067
* [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the ↵Simon Marchi2018-08-062-17/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | requested name Summary: InMemoryFileSystem::status behaves differently than RealFileSystem::status. The Name contained in the Status returned by RealFileSystem::status will be the path as requested by the caller, whereas InMemoryFileSystem::status returns the normalized path. For example, when requested the status for "../src/first.h", RealFileSystem returns a Status with "../src/first.h" as the Name. InMemoryFileSystem returns "/absolute/path/to/src/first.h". The reason for this change is that I want to make a unit test in the clangd testsuite (where we use an InMemoryFileSystem) to reproduce a bug I get with the clangd program (where a RealFileSystem is used). This difference in behavior "hides" the bug in the unit test version. An indirect impact of this change is that a -Wnonportable-include-path warning is now emitted in test PCH/case-insensitive-include.c. This is because the real path of the included file (with the wrong case) was not available previously, whereas it is now. Reviewers: malaperle, ilya-biryukov, bkramer Reviewed By: ilya-biryukov Subscribers: eric_niebler, malaperle, omtcyfz, hokein, bkramer, ilya-biryukov, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D48903 llvm-svn: 339063
* [MinGW] Predefine UNICODE if -municode is specified during compilationMartin Storsjo2018-08-061-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D50199 llvm-svn: 339048
* Fix for broken build on clang-hexagon-elf for ambiguous call toLeonard Chan2018-08-061-1/+2
| | | | | | std::abs. llvm-svn: 339044
* [Fixed Point Arithmetic] Remove unused include.Benjamin Kramer2018-08-061-1/+0
| | | | | | lib/Basic cannot depend on lib/AST. llvm-svn: 339031
OpenPOWER on IntegriCloud