summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.Sam McCall2019-01-142-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes ASTContext's parent map for nodes in such classes (e.g. operator()). https://bugs.llvm.org/show_bug.cgi?id=39949 This also changes the observed shape of the AST for implicit RAVs. - this includes AST MatchFinder: cxxRecordDecl() now matches lambda classes, functionDecl() matches the call operator, and the parent chain is body -> call operator -> lambda class -> lambdaexpr rather than body -> lambdaexpr. - this appears not to matter for the ASTImporterLookupTable builder - this doesn't matter for the other RAVs in-tree. In order to do this, we remove the TraverseLambdaBody hook. The problem is it's hard/weird to ensure this hook is called when traversing via the implicit class. There were just two users of this hook in-tree, who use it to skip bodies. I replaced these with explicitly traversing the captures only. Another approach would be recording the bodies when the lambda is visited, and then recognizing them later. I'd be open to suggestion on how to preserve this hook, instead. Reviewers: aaron.ballman, JonasToth Subscribers: cfe-commits, rsmith, jdennett Differential Revision: https://reviews.llvm.org/D56444 llvm-svn: 351047
* [X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select ↵Craig Topper2019-01-143-51/+55
| | | | | | | | in IR instead. Fixes PR40259 llvm-svn: 351036
* [X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a ↵Craig Topper2019-01-141-0/+25
| | | | | | | | | | vXi1 vector. We'll do the scalar<->vXi1 conversions with bitcasts in IR. Fixes PR40258 llvm-svn: 351029
* [ASTDump] NFC: Move dump of individual Stmts to TextNodeDumperStephen Kelly2019-01-122-489/+467
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55340 llvm-svn: 351014
* Implement TemplateArgument dumping in terms of VisitorStephen Kelly2019-01-122-44/+68
| | | | | | | | | | | | Summary: Split the output streaming from the traversal to other AST nodes. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55491 llvm-svn: 351012
* [ASTDump] Change parameter to StringRefStephen Kelly2019-01-121-2/+2
| | | | llvm-svn: 351011
* [analyzer] Fix unused variable warnings in Release buildsBenjamin Kramer2019-01-121-5/+2
| | | | | | This was just an inlined version of isa<CXXConstructExpr>. NFC. llvm-svn: 351007
* [NetBSD] Enable additional sanitizer typesMichal Gorny2019-01-121-0/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D56607 llvm-svn: 351002
* NFC: Port loop to cxx_range_forStephen Kelly2019-01-121-3/+2
| | | | llvm-svn: 350984
* [analyzer] Support for OSObjects out parameters in RetainCountCheckerGeorge Karpenkov2019-01-113-72/+217
| | | | | | | | | rdar://46357478 rdar://47121327 Differential Revision: https://reviews.llvm.org/D56240 llvm-svn: 350982
* [analyzer] Introduce a convenience method for getting a CallEvent from an ↵George Karpenkov2019-01-111-22/+30
| | | | | | | | arbitrary Stmt Differential Revision: https://reviews.llvm.org/D56300 llvm-svn: 350981
* [Darwin][Driver] Don't pass a file as object_path_lto during ThinLTOSteven Wu2019-01-112-7/+25
| | | | | | | | | | | | | | | | | | | | | | Summary: After r327851, Driver::GetTemporaryPath will create the file rather than just create a potientially unqine filename. If clang driver pass the file as parameter as -object_path_lto, ld64 will pass it back to libLTO as GeneratedObjectsDirectory, which is going to cause a LLVM ERROR if it is not a directory. Now during thinLTO, pass a temp directory path to linker instread. rdar://problem/47194182 Reviewers: arphaman, dexonsmith Reviewed By: arphaman Subscribers: mehdi_amini, inglorion, jkorous, cfe-commits Differential Revision: https://reviews.llvm.org/D56608 llvm-svn: 350970
* Implement Attr dumping in terms of visitorsStephen Kelly2019-01-112-19/+31
| | | | | | | | | | | | | | Remove now-vestigial dumpType and dumpBareDeclRef methods. The old tablegen generated code used to expect them to be present, but the new generated code has no such requirement. Reviewers: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D55492 llvm-svn: 350958
* [ASTDump] Add utility for dumping a label with child nodesStephen Kelly2019-01-111-7/+7
| | | | | | | | | | | | | | | | | | | Summary: Use it to add optional label nodes to Stmt dumps. This preserves behavior of InitExprList dump: // CHECK-NEXT: `-InitListExpr {{.+}} <col:13, col:15> 'U [3]' // CHECK-NEXT: |-array_filler: InitListExpr {{.+}} <col:15> 'U' field Field {{.+}} 'i' 'int' // CHECK-NEXT: `-InitListExpr {{.+}} <col:14> 'U' field Field {{.+}} 'i' 'int' // CHECK-NEXT: `-IntegerLiteral {{.+}} <col:14> 'int' 1 Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55488 llvm-svn: 350957
* [LTO] Add option to enable LTOUnit splitting, and disable unless neededTeresa Johnson2019-01-114-10/+34
| | | | | | | | | | | | | | | | | | | | Summary: Adds a new -f[no]split-lto-unit flag that is disabled by default to control module splitting during ThinLTO. It is automatically enabled for -fsanitize=cfi and -fwhole-program-vtables. The new EnableSplitLTOUnit codegen flag is passed down to llvm via a new module flag of the same name. Depends on D53890. Reviewers: pcc Subscribers: ormris, mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D53891 llvm-svn: 350949
* [attributes] Extend os_returns_(not_?)_retained attributes to parametersGeorge Karpenkov2019-01-111-20/+72
| | | | | | | | | | | When applied to out-parameters, the attributes specify the expected lifetime of the written-into object. Additionally, introduce OSReturnsRetainedOn(Non)Zero attributes, which specify that an ownership transfer happens depending on a return code. Differential Revision: https://reviews.llvm.org/D56292 llvm-svn: 350942
* Fix a pair of Wfallthrough warnings in ScanfFormatString.Erich Keane2019-01-111-0/+2
| | | | | Change-Id: Ia73a34fdd93fc974224583505f9e6432493cb0da llvm-svn: 350941
* Implementation Feature Test Macros for P0722R3Chris Kennelly2019-01-111-0/+1
| | | | | | | | | | | | | | | | | Summary: P1353R0, adopted in San Diego, specified an implementation feature test macro for destroying delete (P0722R3). The implementation of the feature (https://reviews.llvm.org/rL315662) is not guarded behind a flag, so the macro is not conditional on language version. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55741 llvm-svn: 350934
* [Sema] Make canPassInRegisters return true if the CXXRecordDecl passedAkira Hatanaka2019-01-111-0/+3
| | | | | | | | | | | | to it is a trivial_abi class. A class that has all of its copy and move constructors deleted can still be passed or returned in registers if the class is annotated with trivial_abi. This fixes PR39683. llvm-svn: 350920
* [Sema] If CheckPlaceholderExpr rewrites the initializer of an autoAkira Hatanaka2019-01-113-14/+13
| | | | | | | | | | | | variable during auto type deduction, use the rewritten initializer when performing initialization of the variable. This silences spurious -Warc-repeated-use-of-weak warnings that are issued when the initializer uses a weak ObjC pointer. Differential Revision: https://reviews.llvm.org/D55662 llvm-svn: 350917
* Remember to instantiate explicit template argument lists in a friendRichard Smith2019-01-113-14/+81
| | | | | | | | | | | | | | | function declaration. We'd previously often just drop these on the floor, and friend redeclaration matching would usually (but not always) figure out the right redeclaration anyway. Also, don't try to match a dependent friend function template specialization to a template until instantiation, and don't forget to reject qualified friend declarations in dependent contexts that don't name an already-declared entity. llvm-svn: 350915
* [AST] Remove ASTContext from getThisType (NFC)Brian Gesiak2019-01-1119-48/+39
| | | | | | | | | | | | | | | | | | | | | Summary: https://reviews.llvm.org/D54862 removed the usages of `ASTContext&` from within the `CXXMethodDecl::getThisType` method. Remove the parameter altogether, as well as all usages of it. This does not result in any functional change because the parameter was unused since https://reviews.llvm.org/D54862. Test Plan: check-clang Reviewers: akyrtzi, mikael Reviewed By: mikael Subscribers: mehdi_amini, dexonsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D56509 llvm-svn: 350914
* Fix header issues.Richard Trieu2019-01-114-0/+7
| | | | | | | | | | | | | Several headers would fail to compile if other headers were not previously included. The usual issue is that a class is forward declared, but the full definition is needed. The requirement for the definition is use of isa/dyn_cast or calling functions of pointer-packed data types such as DenseMap or PointerIntPair. Add missing includes to these headers. SVals.h required an out-of-line method definition in the .cpp file to avoid circular inclusion of headers with BasicValueFactory.h llvm-svn: 350913
* Add an explicit initializer to silence a -Wmissing-field-initializers ↵Aaron Ballman2019-01-111-1/+1
| | | | | | diagnostic; NFC. llvm-svn: 350912
* [WebAssembly] Add unimplemented-simd128 feature, gate builtinsThomas Lively2019-01-102-10/+54
| | | | | | | | | | | Summary: Depends on D56501. Also adds a macro define `__wasm_unimplemented_simd128__` for feature detection of unimplemented SIMD builtins. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, kristina, cfe-commits, rrwinterton llvm-svn: 350909
* [analyzer] pr38838, pr39976: Fix crash on diagnosing before implicit destructor.Artem Dergachev2019-01-101-0/+2
| | | | | | | | | | | | | | | | | | | We need to be able to emit the diagnostic at PreImplicitCall, and the patch implements this functionality. However, for now the need for emitting such diagnostics is not all that great: it is only necessary to not crash when emitting a false positive due to an unrelated issue of having dead symbol collection not working properly. Coming up with a non-false-positive test seems impossible with the current set of checkers, though it is likely to be needed for good things as well in the future. Differential Revision: https://reviews.llvm.org/D56042 rdar://problem/46911462 llvm-svn: 350907
* Properly support -shared-libgcc.Sterling Augustine2019-01-101-6/+3
| | | | | | This revision was revied in D55016. llvm-svn: 350900
* Correct the source range returned from preprocessor callbacks.Aaron Ballman2019-01-102-35/+47
| | | | | | This adjusts the source range passed in to the preprocessor callbacks to only include the condition range itself, rather than all of the conditionally skipped tokens. llvm-svn: 350891
* NFC: Change case of identifiersStephen Kelly2019-01-102-3/+3
| | | | llvm-svn: 350890
* [Sema] Call CheckPlaceholderExpr to resolve typeof or decltypeAkira Hatanaka2019-01-105-7/+16
| | | | | | | | | | | | | | | placeholder expressions while an unevaluated context is still on the expression evaluation context stack. This prevents recordUseOfWeek from being called when a weak variable is used as an operand of a decltype or a typeof expression and fixes spurious -Warc-repeated-use-of-weak warnings. rdar://problem/45742525 Differential Revision: https://reviews.llvm.org/D55662 llvm-svn: 350887
* [HIP] Use nul instead of /dev/null when running on windowsYaxun Liu2019-01-101-1/+7
| | | | | | | | When clang is running on windows, /dev/null is not available. Use nul as empty input file instead. Differential Revision: https://reviews.llvm.org/D56225 llvm-svn: 350885
* Fix false positive unsequenced access and modification warning in array ↵Nicolas Lesser2019-01-101-16/+28
| | | | | | | | | | | | | | | | | | | | subscript expression. Summary: In the [expr.sub] p1, we can read that for a given E1[E2], E1 is sequenced before E2. Patch by Mateusz Janek. Reviewers: rsmith, Rakete1111 Reviewed By: rsmith, Rakete1111 Subscribers: riccibruno, lebedev.ri, Rakete1111, hiraditya, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D50766 llvm-svn: 350874
* [analyzer] [hotfix] Fix the testsGeorge Karpenkov2019-01-101-5/+7
| | | | | | The error must have crept during the cherry-pick. llvm-svn: 350870
* [analyzer] Update the category name for RetainCountChecker reportsGeorge Karpenkov2019-01-106-67/+65
| | | | | | | | | | ..now that it includes OSObjects rdar://46509986 Differential Revision: https://reviews.llvm.org/D56404 llvm-svn: 350869
* [analyzer] [NFC] [RetainCountChecker] Remove dead unused mapGeorge Karpenkov2019-01-101-6/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D56402 llvm-svn: 350868
* [analyzer] Quote the type of the leaked/problematic object in diagnostics ↵George Karpenkov2019-01-101-8/+9
| | | | | | | | for readability Differential Revision: https://reviews.llvm.org/D56344 llvm-svn: 350867
* [analyzer] [NFC] Reduce redundancy in RetainSummaryManager by using a functionGeorge Karpenkov2019-01-101-20/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D56282 llvm-svn: 350865
* [analyzer] [RetainCountChecker] [NFC] Remove SummaryLogGeorge Karpenkov2019-01-104-103/+46
| | | | | | | | | | | | | | The complicated machinery for passing the summary log around is actually only used for one thing! To figure out whether the "dealloc" message was sent. Since I have tried to extend it for other uses and failed (it's actually very hard to use), I think it's much better to simply use a tag and remove the summary log altogether. Differential Revision: https://reviews.llvm.org/D56228 llvm-svn: 350864
* [analyzer] [RetainCountChecker] [NFC] Another minor cleanupGeorge Karpenkov2019-01-101-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D56224 llvm-svn: 350863
* [analyzer] [RetainCountChecker] [NFC] Refactor the way attributes are handledGeorge Karpenkov2019-01-101-83/+103
| | | | | | | | | | | | | Make sure all checks for attributes go through a centralized function, which checks whether attribute handling is enabled, and performs validation. The type of the attribute is returned. Sadly, metaprogramming is required as attributes have no sensible static getters. Differential Revision: https://reviews.llvm.org/D56222 llvm-svn: 350862
* [analyzer] [RetainCountChecker] Remove redundant enum UnarySummaryKindGeorge Karpenkov2019-01-101-16/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D56072 llvm-svn: 350861
* [analyzer] [RetainCountChecker] Remove obsolete "MakeCollectable" enum valueGeorge Karpenkov2019-01-102-7/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D56071 llvm-svn: 350860
* [analyzer] [RetainCountChecker] [NFC] Remove redundant enum items *Msg, as ↵George Karpenkov2019-01-104-65/+69
| | | | | | | | the object type is already communicated by a separate field Differential Revision: https://reviews.llvm.org/D56070 llvm-svn: 350859
* [analyzer] [NFC] Track object type with ArgEffect in RetainCountChecker.George Karpenkov2019-01-105-122/+140
| | | | | | | | This would be needed in the future. https://reviews.llvm.org/D56040 llvm-svn: 350858
* [analyzer] [NFC] Move ObjKind into a separate top-level enum in ↵George Karpenkov2019-01-105-48/+48
| | | | | | | | | | RetainSummaryManager. Allows using it in future outside of RetEffect. Differential Revision: https://reviews.llvm.org/D56039 llvm-svn: 350857
* [analyzer][CrossTU][NFC] Generalize to external definitions instead of ↵Rafael Stahl2019-01-101-7/+7
| | | | | | | | | | | | | | | | external functions Summary: This is just changing naming and documentation to be general about external definitions that can be imported for cross translation unit analysis. There is at least a plan to add VarDecls: D46421 Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, serge-sans-paille Reviewed By: xazax.hun, martong Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D56441 llvm-svn: 350852
* Correct the spelling of helpURI to helpUri.Aaron Ballman2019-01-101-1/+1
| | | | | | JSON is case sensitive and the SARIF spec uses the corrected spelling. llvm-svn: 350817
* [AMDGPU] Separate feature dot-instsStanislav Mekhanoshin2019-01-101-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D56525 llvm-svn: 350794
* In nothrow new-expressions, null-check the result if we're going toRichard Smith2019-01-101-2/+3
| | | | | | | | | apply sanitizers to it. This avoids a sanitizer false positive that we are initializing a null pointer. llvm-svn: 350779
* [Sema] Mark target of __attribute__((alias("target"))) used for CNick Desaulniers2019-01-091-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Prevents -Wunneeded-internal-delcaration warnings when the target has no other references. This occurs frequently in device drivers in the Linux kernel. Sema would need to invoke the demangler on the target, since in C++ the target name is mangled: int f() { return 42; } int g() __attribute__((alias("_Z1fv"))); Sema does not have the ability to demangle names at this time. https://bugs.llvm.org/show_bug.cgi?id=39088 https://github.com/ClangBuiltLinux/linux/issues/232 Reviewers: rsmith, rjmccall Reviewed By: rsmith Subscribers: erik.pilkington, cfe-commits, pirama, srhines Differential Revision: https://reviews.llvm.org/D54188 llvm-svn: 350776
OpenPOWER on IntegriCloud