summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* [ObjC] Allow the use of implemented unavailable methods from withinAlex Lorenz2019-01-091-6/+22
| | | | | | | | | | | | | | | | | | the @implementation context In Objective-C, it's common for some frameworks to mark some methods like init as unavailable in the @interface to prohibit their usage. However, these frameworks then often implemented said method and refer to it in another method that acts as a factory for that object. The recent change to how messages to self are type checked in clang (r349841) introduced a regression which started to prohibit this pattern with an X is unavailable error. This commit addresses the aforementioned regression. rdar://47134898 Differential Revision: https://reviews.llvm.org/D56469 llvm-svn: 350768
* [OpenMP] Avoid remainder operations for loop index values on a collapsed ↵Gheorghe-Teodor Bercea2019-01-091-32/+44
| | | | | | | | | | | | | | | | loop nest. Summary: Change the strategy for computing loop index variables after collapsing a loop nest via the collapse clause by replacing the expensive remainder operation with multiplications and additions. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56413 llvm-svn: 350759
* [OpenMP] Add flag for preventing the extension to 64 bits for the collapse ↵Gheorghe-Teodor Bercea2019-01-093-11/+21
| | | | | | | | | | | | | | | | loop counter Summary: Introduce a compiler flag for cases when the user knows that the collapsed loop counter can be safely represented using at most 32 bits. This will prevent the emission of expensive mathematical operations (such as the div operation) on the iteration variable using 64 bits where 32 bit operations are sufficient. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: hfinkel, kkwli0, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D55928 llvm-svn: 350758
* [CodeGen] Clarify comment about COFF common symbol alignmentShoaib Meenai2019-01-091-2/+6
| | | | | | | | | | | | | After a discussion on the commit thread, it seems the 32 byte alignment limitation is an MSVC toolchain artifact, not an inherent COFF restriction. Clarify the comment accordingly, since saying COFF in the comment but using isKnownWindowsMSVCEnvironment in the conditional is confusing. Also add a newline before the comment, which is consistent with the local style. Differential Revision: https://reviews.llvm.org/D56466 llvm-svn: 350754
* [AST] Move back BasePathSize to the bit-fields of CastExprBruno Ricci2019-01-092-51/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The number of trailing CXXBaseSpecifiers in CastExpr was moved from CastExprBitfields to a trailing object in r338489 (D50050). At this time these bit-fields classes were only 32 bits wide. However later r345459 widened these bit-field classes to 64 bits. The reason for this change was that on 64 bit archs alignment requirements caused 4 bytes of padding after the Stmt sub-object in nearly all expression classes. Reusing this padding yielded an >10% reduction in the size used by all statement/expressions when parsing all of Boost (on a 64 bit arch). This increased the size of statement/expressions for 32 bits archs, but this can be mitigated by moving more data to the bit-fields of Stmt (and moreover most people now care about 64 bits archs as a host). Therefore move back the number of CXXBaseSpecifiers in CastExpr to the bit-fields of Stmt. This in effect mostly revert r338489 while keeping the added test. Differential Revision: https://reviews.llvm.org/D56358 Reviewed By: lebedev.ri Reviewers: lebedev.ri, rjmccall llvm-svn: 350741
* Incorrect implicit data-sharing for nested tasksAlexey Bataev2019-01-091-8/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is a minor issue in how the implicit data-sharings for nested tasks are computed. For the following example: ``` int x; #pragma omp task shared(x) #pragma omp task x++; ``` We compute an implicit data-sharing of shared for `x` in the second task although I think that it should be firstprivate. Below you can find the part of the OpenMP spec that covers this example: - // In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above and that in the enclosing context is determined to be shared by all implicit tasks bound to the current team is shared.// - //In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivate.// Since each implicit-task has its own copy of `x`, we shouldn't apply the first rule. Reviewers: ABataev Reviewed By: ABataev Subscribers: cfe-commits, rogfer01 Tags: #openmp Differential Revision: https://reviews.llvm.org/D56430 llvm-svn: 350734
* [AST] Store the results in OverloadExpr in a trailing arrayBruno Ricci2019-01-093-137/+171
| | | | | | | | | | | | | | | Use the newly available space in the bit-fields of Stmt to pack OverloadExpr, UnresolvedLookupExpr and UnresolvedMemberExpr. Additionally store the results in the overload set in a trailing array. This saves 1 pointer + 8 bytes per UnresolvedLookupExpr and UnresolvedMemberExpr. Differential Revision: https://reviews.llvm.org/D56368 Reviewed By: rjmccall llvm-svn: 350732
* Revert r350648: "Fix clang for r350647: Missed a function rename"Florian Hahn2019-01-091-3/+2
| | | | | | | The related commit r350647 breaks thread sanitizer on some macOS builders, e.g. http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52725/ llvm-svn: 350718
* [Driver] Fix libcxx detection on Darwin with clang run as ./clangIlya Biryukov2019-01-091-4/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: By using '..' instead of fs::parent_path. The intention of the code was to go from 'path/to/clang/bin' to 'path/to/clang/include'. In most cases parent_path works, however it would fail when clang is run as './clang'. This was noticed in Chromium's bug tracker, see https://bugs.chromium.org/p/chromium/issues/detail?id=919761 Reviewers: arphaman, thakis, EricWF Reviewed By: arphaman, thakis Subscribers: christof, cfe-commits Differential Revision: https://reviews.llvm.org/D56446 llvm-svn: 350714
* Use DeclSpec for quals in DeclaratorChunk::FunctionTypeInfo.Anastasia Stulova2019-01-099-102/+88
| | | | | | | | | | Rather than duplicating data fields, use DeclSpec directly to store the qualifiers for the functions/methods. This change doesn't handle attributes yet and has to be extended further. Differential revision: https://reviews.llvm.org/D55948 llvm-svn: 350703
* [X86] Make the pointer arguments to avx512 gather/scatter intrinsics 'void*' ↵Craig Topper2019-01-093-96/+96
| | | | | | | | to match gcc and Intel's documentation. The avx2 gather intrinsics are documented to use 'int', 'long long', 'float', or 'double' *. So I'm leaving those. This matches gcc. llvm-svn: 350696
* [ASTDump] NFC: Move dumpDeclRef to NodeDumperStephen Kelly2019-01-082-42/+41
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55337 llvm-svn: 350677
OpenPOWER on IntegriCloud