summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* Add support for __declspec(code_seg("segname"))Erich Keane2018-07-1815-8/+829
| | | | | | | | | | | | | | | | | | | This patch uses CodeSegAttr to represent __declspec(code_seg) rather than building on the existing support for #pragma code_seg. The code_seg declspec is applied on functions and classes. This attribute enables the placement of code into separate named segments, including compiler- generated codes and template instantiations. For more information, please see the following: https://msdn.microsoft.com/en-us/library/dn636922.aspx This patch fixes the regression for the support for attribute ((section). https://github.com/llvm-mirror/clang/commit/746b78de7812bc785fbb5207b788348040b23fa7 Patch by Soumi Manna (Manna) Differential Revision: https://reviews.llvm.org/D48841 llvm-svn: 337420
* [analyzer] Remove a debug print that was accidentally left around.Artem Dergachev2018-07-181-1/+0
| | | | | | No functional change intended. llvm-svn: 337417
* Support implicit _Atomic struct load / storeJF Bastien2018-07-182-0/+13
| | | | | | | | | | | | | | | | | Summary: Using _Atomic to do implicit load / store is just a seq_cst atomic_load / atomic_store. Stores currently assert in Sema::ImpCastExprToType with 'can't implicitly cast lvalue to rvalue with this cast kind', but that's erroneous. The codegen is fine as the test shows. While investigating I found that Richard had found the problem here: https://reviews.llvm.org/D46112#1113557 <rdar://problem/40347123> Reviewers: dexonsmith Subscribers: cfe-commits, efriedma, rsmith, aaron.ballman Differential Revision: https://reviews.llvm.org/D49458 llvm-svn: 337410
* [CodeComplete] Allow getDeclaration on RK_Pattern result.Eric Liu2018-07-181-2/+4
| | | | | | | | | | | | | | Summary: RK_Pattern results can also have associated declarations e.g. field decls in constructor initializers. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D49484 llvm-svn: 337394
* Mention clang-cl improvements from r335466 and r336379 in ReleaseNotes.rstNico Weber2018-07-181-1/+13
| | | | llvm-svn: 337381
* [modules] Print input files when -module-file-info file switch is passed.Vassil Vassilev2018-07-182-0/+49
| | | | | | | | | This patch improves traceability of duplicated header files which end up in multiple pcms. Differential Revision: https://reviews.llvm.org/D47118 llvm-svn: 337353
* [AArch64] Define TARGET_HEADER_BUILTINMartin Storsjo2018-07-181-0/+2
| | | | | | | Without it, the new intrinsics became available for all language variants. This was missed in SVN r337327. llvm-svn: 337352
* Re-land r337333, "Teach Clang to emit address-significance tables.",Peter Collingbourne2018-07-189-0/+60
| | | | | | | | | | | | | | | | | | | | | which was reverted in r337336. The problem that required a revert was fixed in r337338. Also added a missing "REQUIRES: x86-registered-target" to one of the tests. Original commit message: > Teach Clang to emit address-significance tables. > > By default, we emit an address-significance table on all ELF > targets when the integrated assembler is enabled. The emission of an > address-significance table can be controlled with the -faddrsig and > -fno-addrsig flags. > > Differential Revision: https://reviews.llvm.org/D48155 llvm-svn: 337339
* Revert r337333, "Teach Clang to emit address-significance tables."Peter Collingbourne2018-07-179-58/+0
| | | | | | | | | Causing multiple failures on sanitizer bots due to TLS symbol errors, e.g. /usr/bin/ld: __msan_origin_tls: TLS definition in /home/buildbots/ppc64be-clang-test/clang-ppc64be/stage1/lib/clang/7.0.0/lib/linux/libclang_rt.msan-powerpc64.a(msan.cc.o) section .tbss.__msan_origin_tls mismatches non-TLS reference in /tmp/lit_tmp_0a71tA/mallinfo-3ca75e.o llvm-svn: 337336
* Teach Clang to emit address-significance tables.Peter Collingbourne2018-07-179-0/+58
| | | | | | | | | | | By default, we emit an address-significance table on all ELF targets when the integrated assembler is enabled. The emission of an address-significance table can be controlled with the -faddrsig and -fno-addrsig flags. Differential Revision: https://reviews.llvm.org/D48155 llvm-svn: 337333
* Replace LLVM_ALIGNAS with just alignas.Richard Smith2018-07-175-7/+7
| | | | | | | Various places in Clang and LLVM are already using alignas; it seems our minimum host configuration now requires it. llvm-svn: 337330
* Restructure checking for, and warning on, lifetime extension.Richard Smith2018-07-1723-241/+484
| | | | | | | | | | | | | This change implements C++ DR1696, which makes initialization of a reference member of a class from a temporary object ill-formed. The standard wording here is imprecise, but we interpret it as meaning that any time a mem-initializer would result in lifetime extension, the program is ill-formed. This reinstates r337226, reverted in r337255, with a fix for the InitializedEntity alignment problem that was breaking ARM buildbots. llvm-svn: 337329
* [COFF] Add more missing MSVC ARM64 intrinsicsMandeep Singh Grang2018-07-174-7/+52
| | | | | | | | | | | | | | | | | | | Summary: Added the following intrinsics: _BitScanForward, _BitScanReverse, _BitScanForward64, _BitScanReverse64 _InterlockedAnd64, _InterlockedDecrement64, _InterlockedExchange64, _InterlockedExchangeAdd64, _InterlockedExchangeSub64, _InterlockedIncrement64, _InterlockedOr64, _InterlockedXor64. Reviewers: compnerd, mstorsjo, rnk, javed.absar Reviewed By: mstorsjo Subscribers: kristof.beyls, chrib, llvm-commits Differential Revision: https://reviews.llvm.org/D49445 llvm-svn: 337327
* Remove unnecessary trailing ; in macro intrinsic definition.Eric Christopher2018-07-171-1/+1
| | | | llvm-svn: 337321
* [analyzer] Fix Z3 backend after D48205Mikhail R. Gadelha2018-07-172-30/+30
| | | | | | | | | | | | | | | | | Summary: An assertion was added in D48205 to catch places where a `nonloc::SymbolVal` was wrapping a `loc` object. This patch fixes that in the Z3 backend by making the `SValBuilder` object accessible from inherited instances of `SimpleConstraintManager` and calling `SVB.makeSymbolVal(foo)` instead of `nonloc::SymbolVal(foo)`. Reviewers: NoQ, george.karpenkov Reviewed By: NoQ Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D49430 llvm-svn: 337304
* clang-cl: Postpone Wmsvc-not-found emission until link.exe gets used.Nico Weber2018-07-172-2/+5
| | | | | | | | | | | | | | | | | Wmsvc-not-found was added in r297851 to help diagnose why link.exe can't be executed. However, it's emitted even when using -fuse-ld=lld, and in cross builds there's no way to get rid of the warning other than disabling it. Instead, emit it when we look up link.exe and it ends up not being executable. That way, when passing -fuse-ld=lld it will never be printed. It will also not be printed if we find link.exe on PATH. (We might want to eventually default to lld one day, at least when running on a non-Win host, but that's for another day.) Fixes PR38016. llvm-svn: 337290
* [Fixed Point Arithmetic] Fix for bug where integer literals could be treated ↵Leonard Chan2018-07-174-5/+105
| | | | | | | | | | | | | | | | as fixed point literals This addresses a bug brought up in https://bugs.llvm.org/show_bug.cgi?id=38161 where integer literals could be treated as fixed point types and throw errors related to fixed point types when the 'k' or 'r' suffix used. The fix also addresses the second issue brought up with the assertion by not treating integers as fixed point types in the first place. Integers that have suffixes 'k' and 'r' now throw the error `invalid suffix 'k/r' on integer constant`. A few more tests were also added to ensure that fixed point types, and any errors/warnings related to them, are limited to C for now. Prior discussion also at https://reviews.llvm.org/D46915. Differential Revision: https://reviews.llvm.org/D49327 llvm-svn: 337289
* Remove superfluous ; to fix -Wpedantic warning from gccNico Weber2018-07-171-1/+1
| | | | llvm-svn: 337285
* [Tooling] Add operator== to CompileCommandSimon Marchi2018-07-172-0/+37
| | | | | | | | | | | | Summary: It does the obvious thing of comparing all fields. This will be needed for a clangd patch I have in the pipeline. Subscribers: dblaikie, ilya-biryukov, ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D49265 llvm-svn: 337284
* Revert "[Sema] Reword warning for constant captures that are not required"Benjamin Kramer2018-07-172-8/+8
| | | | | | | | This reverts commit r337152. This applies to non-constants too. The real explanation is that the capture is not ODR-used, but putting that into the warning message seems ... worse. llvm-svn: 337278
* Always use __mcount on NetBSD. Some platforms don't provide _mcount.Joerg Sonnenberger2018-07-173-12/+14
| | | | llvm-svn: 337277
* [ASTImporter] Fix poisonous structural equivalence cacheGabor Marton2018-07-175-33/+109
| | | | | | | | | | | | | | | | | | | | | Summary: Implementation functions call into the member functions of ASTStructuralEquivalence, thus they can falsely alter the DeclsToCheck state (they add decls). This results that some leaf declarations can be stated as inequivalent as a side effect of one inequivalent element in the DeclsToCheck list. And since we store the non-equivalencies, any (otherwise independent) decls will be rendered as non-equivalent. Solution: I tried to clearly separate the implementation functions (the static ones) and the public interface. From now on, the implementation functions do not call any public member functions, only other implementation functions. Reviewers: a.sidorin, a_sidorin, r.stahl Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D49300 llvm-svn: 337275
* For NetBSD, unwind data is emitted by default, so also enable frameJoerg Sonnenberger2018-07-172-0/+13
| | | | | | pointer optimisation by default when using optimisation. llvm-svn: 337274
* By popular demand, switch in64_t on NetBSD/AArch64 and NetBSD/PowerPC64Joerg Sonnenberger2018-07-174-45/+38
| | | | | | to long for consistency with other 64bit platforms. llvm-svn: 337271
* [ASTImporter] Fix import of unnamed structsGabor Marton2018-07-173-8/+124
| | | | | | | | | | | | | | | Summary: D48773 simplified ASTImporter nicely, but it introduced a new error: Unnamed structs are not imported correctly, if they appear in a recursive context. This patch provides a fix for structural equivalency. Reviewers: a.sidorin, a_sidorin, balazske, gerazo Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D49296 llvm-svn: 337267
* [ASTImporter] Import described template (if any) of function.Balazs Keri2018-07-172-1/+15
| | | | | | | | | | | | | | | | | Summary: When a function is imported, check if it has a described template. The name lookup is corrected to find the templated entity in this case. The described template of the function is imported too. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D49235 llvm-svn: 337260
* Temporarily revert r337226 "Restructure checking for, and warning on, ↵Florian Hahn2018-07-1723-483/+240
| | | | | | | | | | | | | | | | | | | | | | | | | | | lifetime extension." This change breaks on ARM because pointers to clang::InitializedEntity are only 4 byte aligned and do not have 3 bits to store values. A possible solution would be to change the fields in clang::InitializedEntity to enforce a bigger alignment requirement. The error message is llvm/include/llvm/ADT/PointerIntPair.h:132:3: error: static_assert failed "PointerIntPair with integer size too large for pointer" static_assert(IntBits <= PtrTraits::NumLowBitsAvailable, include/llvm/ADT/PointerIntPair.h:73:13: note: in instantiation of template class 'llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> >' requested here Value = Info::updateInt(Info::updatePointer(0, PtrVal), llvm/include/llvm/ADT/PointerIntPair.h:51:5: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::setPointerAndInt' requested here setPointerAndInt(PtrVal, IntVal); ^ llvm/tools/clang/lib/Sema/SemaInit.cpp:6237:12: note: in instantiation of member function 'llvm::PointerIntPair<const clang::InitializedEntity *, 3, (anonymous namespace)::LifetimeKind, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *>, llvm::PointerIntPairInfo<const clang::InitializedEntity *, 3, llvm::PointerLikeTypeTraits<const clang::InitializedEntity *> > >::PointerIntPair' requested here return {Entity, LK_Extended}; Full log here: http://lab.llvm.org:8011/builders/clang-cmake-armv7-global-isel/builds/1330 http://lab.llvm.org:8011/builders/clang-cmake-armv7-full/builds/1394 llvm-svn: 337255
* Harden/relax clang/test/CodeGen/opt-record-MIR.c testRoman Lebedev2018-07-171-2/+3
| | | | | | | | | | | | | | | | | | Summary: If the build path is short, `Line` field can end up fitting on the same line as `File`, but the `{{.*}}` would consume it. Keeping in mind rL293149, i think we can fix it, while keeping it working when there are and there are not any quotations. At least this fixes this test for me. Reviewers: anemet, aaron.ballman, hfinkel Reviewed By: anemet Subscribers: cfe-commits, llvm-commits Differential Revision: https://reviews.llvm.org/D49348 llvm-svn: 337249
* [Driver] Add -fno-digraphsJacob Bandes-Storch2018-07-174-2/+28
| | | | | | | | | | | | | | Summary: Add a flag `-fno-digraphs` to disable digraphs in the lexer, similar to `-fno-operator-names` which disables alternative names for C++ operators. Reviewers: rsmith Reviewed By: rsmith Subscribers: rsmith, cfe-commits Differential Revision: https://reviews.llvm.org/D48266 llvm-svn: 337232
* [analyzer] Fix size_t in tests.Artem Dergachev2018-07-171-1/+2
| | | | | | Should fix a buildbot. No functional change intended. llvm-svn: 337231
* [CFG] [analyzer] Allow elidable copies to have more than one arguments.Artem Dergachev2018-07-172-1/+23
| | | | | | | | | | Copy-constructors and move-constructors may have default arguments. It is incorrect to assert that they only have one argument, i.e. the reference to the object being copied or moved. Remove the assertion. Differential Revision: https://reviews.llvm.org/D49215 llvm-svn: 337229
* [analyzer] pr37802: Fix symbolic-pointer-to-boolean casts during load.Artem Dergachev2018-07-173-1/+114
| | | | | | | | | The canonical representation of pointer &SymRegion{$x} casted to boolean is "$x != 0", not "$x". Assertion added in r337227 catches that. Differential Revision: https://reviews.llvm.org/D48232 llvm-svn: 337228
* [analyzer] Assert that nonloc::SymbolVal always wraps a non-Loc-type symbol.Artem Dergachev2018-07-172-3/+6
| | | | | | | | | | | | | | | In the current SVal hierarchy there are multiple ways of representing certain values but few are actually used and expected to be seen by the code. In particular, a value of a symbolic pointer is always represented by a loc::MemRegionVal that wraps a SymbolicRegion that wraps the pointer symbol and never by a nonloc::SymbolVal that wraps that symbol directly. Assert the aforementioned fact. Fix one minor violation of it. Differential Revision: https://reviews.llvm.org/D48205 llvm-svn: 337227
* Restructure checking for, and warning on, lifetime extension.Richard Smith2018-07-1723-240/+483
| | | | | | | | | | This change implements C++ DR1696, which makes initialization of a reference member of a class from a temporary object ill-formed. The standard wording here is imprecise, but we interpret it as meaning that any time a mem-initializer would result in lifetime extension, the program is ill-formed. llvm-svn: 337226
* [analyzer] Make checkEndFunction() give access to the return statement.Reka Kovacs2018-07-1613-26/+35
| | | | | | Differential Revision: https://reviews.llvm.org/D49387 llvm-svn: 337215
* [ASTMatchers] Quickfix for tests.George Karpenkov2018-07-161-6/+6
| | | | llvm-svn: 337214
* [analyzer] Bugfix for an overly eager suppression for null pointer return ↵George Karpenkov2018-07-162-39/+83
| | | | | | | | | | | | | from macros. Only suppress those cases where the null which came from the macro is relevant to the bug, and was not overwritten in between. rdar://41497323 Differential Revision: https://reviews.llvm.org/D48856 llvm-svn: 337213
* [analyzer] Fix GCDAntipatternChecker to only fire when the semaphore is ↵George Karpenkov2018-07-162-1/+13
| | | | | | | | | | | | initialized to zero Initializing a semaphore with a different constant most likely signals a different intent rdar://41802552 Differential Revision: https://reviews.llvm.org/D48911 llvm-svn: 337212
* [analyzer] Provide a symmetric method for generating a ↵George Karpenkov2018-07-161-0/+9
| | | | | | | | PathDiagnosticLocation from Decl Differential Revision: https://reviews.llvm.org/D49166 llvm-svn: 337211
* [ASTMatchers] Introduce Objective-C matchers `hasReceiver` and ↵George Karpenkov2018-07-164-0/+91
| | | | | | | | `isInstanceMessage` for ObjCMessageExpr Differential Revision: https://reviews.llvm.org/D49333 llvm-svn: 337209
* [OPENMP] Fix checks for declare target link entries.Alexey Bataev2018-07-163-16/+43
| | | | | | | | If the declare target link entries are created but not used, the compiler will produce an error message. Patch improves handling of such situations + improves checks for possibly lost declare target variables. llvm-svn: 337207
* [OPENMP] Fix syntactic errors in error messages.Alexey Bataev2018-07-162-3/+3
| | | | | | Fixed spelling of the offloading error messages. llvm-svn: 337196
* [OPENMP, NVPTX] Globalize only captured variables.Alexey Bataev2018-07-162-19/+21
| | | | | | | Sometimes we can try to globalize non-variable declarations, which may lead to compiler crash. llvm-svn: 337191
* Restore "[ThinLTO] Ensure we always select the same function copy to import"Teresa Johnson2018-07-161-3/+2
| | | | | | | This reverts commit r337082, restoring r337051, since the LLVM side patch has been restored. llvm-svn: 337185
* [ASTImporter] Changed constant int to unsigned int in test code.Balazs Keri2018-07-161-2/+2
| | | | llvm-svn: 337172
* [analyzer] Fix the Z3 backend always generating unsigned APSIntMikhail R. Gadelha2018-07-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In `toAPSInt`, the Z3 backend was not checking the variable `Int`'s type and was always generating unsigned `APSInt`s. This was found by accident when I removed: ``` llvm::APSInt ConvertedLHS, ConvertedRHS; QualType LTy, RTy; std::tie(ConvertedLHS, LTy) = fixAPSInt(*LHS); std::tie(ConvertedRHS, RTy) = fixAPSInt(*RHS); - doIntTypePromotion<llvm::APSInt, Z3ConstraintManager::castAPSInt>( - ConvertedLHS, LTy, ConvertedRHS, RTy); return BVF.evalAPSInt(BSE->getOpcode(), ConvertedLHS, ConvertedRHS); ``` And the `BasicValueFactory` started to complain about different `signedness`. Reviewers: george.karpenkov, NoQ, ddcc Reviewed By: ddcc Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D49305 llvm-svn: 337169
* [analyzer] Fix constraint being dropped when analyzing a program without ↵Mikhail R. Gadelha2018-07-167-39/+36
| | | | | | | | | | | | | | | | | | | | | | | taint tracking enabled Summary: This patch removes the constraint dropping when taint tracking is disabled. It also voids the crash reported in D28953 by treating a SymSymExpr with non pointer symbols as an opaque expression. Updated the regressions and verifying the big projects now; I'll update here when they're done. Based on the discussion on the mailing list and the patches by @ddcc. Reviewers: george.karpenkov, NoQ, ddcc, baloghadamsoftware Reviewed By: george.karpenkov Subscribers: delcypher, llvm-commits, rnkovacs, xazax.hun, szepet, a.sidorin, ddcc Differential Revision: https://reviews.llvm.org/D48650 llvm-svn: 337167
* [ASTImporter] Import implicit methods of existing class.Balazs Keri2018-07-162-2/+135
| | | | | | | | | | | | | | | | | | | | Summary: When an already existing class is encountered during import, check if it has implicit methods that are missing in the existing one, and import these. The to-be-imported code may use the same class in different way than the existing (before the import) code. This may result in that there are implicit methods that are not generated for the existing code. Reviewers: a.sidorin, a_sidorin Reviewed By: a_sidorin Subscribers: a_sidorin, martong, cfe-commits Differential Revision: https://reviews.llvm.org/D49245 llvm-svn: 337162
* [Sema] Reword warning for constant captures that are not requiredBenjamin Kramer2018-07-162-8/+8
| | | | | | | | | This is one of the darker corners of C++, make it clear that this is about constants and rephrase it a bit. Before: lambda capture 'i' is not required to be captured for this use After: lambda capture of constant 'i' is not required for this use llvm-svn: 337152
* [Analyzer] Mark `SymbolData` parts of iterator position as live in program ↵Adam Balogh2018-07-161-21/+33
| | | | | | | | | | | | | | state maps Marking a symbolic expression as live is non-recursive. In our checkers we either use conjured symbols or conjured symbols plus/minus integers to represent abstract position of iterators, so in this latter case we also must mark the `SymbolData` part of these symbolic expressions as live to prevent them from getting reaped. Differential Revision: https://reviews.llvm.org/D48764 llvm-svn: 337151
OpenPOWER on IntegriCloud