summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Emiting invariant.group.barrier for ctors bugfixPiotr Padlewski2015-10-021-10/+11
| | | | | | | | | | | | | Ensure that the vptr store in the most-derived constructor is not behind an invariant group barrier. Previously, the base-most vptr store would be the one behind no barrier, and that could result in the creator of the object thinking it had the base-most vtable. This bug caused clang call pure virtual functions when called from constructor body. http://reviews.llvm.org/D13373 llvm-svn: 249197
* [WebAssembly] Add a __builtin_wasm_resize_memory() intrinsic.Dan Gohman2015-10-021-0/+5
| | | | llvm-svn: 249179
* [WebAssembly] Add a __builtin_wasm_memory_size() intrinsic.Dan Gohman2015-10-021-0/+5
| | | | llvm-svn: 249176
* [Myriad]: Accept '-nostdlib' optionDouglas Katzman2015-10-021-17/+23
| | | | llvm-svn: 249166
* Module debugging: Don't emit forward declarations in module scopes.Adrian Prantl2015-10-021-0/+3
| | | | | | A forward declaration inside a module header does not belong to the module. llvm-svn: 249157
* Remove unused variable.Adrian Prantl2015-10-021-1/+0
| | | | llvm-svn: 249155
* [OpenMP] Capture global variables in target regions.Samuel Antao2015-10-023-3/+67
| | | | | | | | | All global variables that are not enclosed in a declare target region must be captured in the target region as local variables do. Currently, there is no support for declare target, so this patch adds support for capturing all the global variables used in a the target region. llvm-svn: 249154
* [OpenMP] Target directive host codegen.Samuel Antao2015-10-024-7/+391
| | | | | | | | | | | This patch implements the outlining for offloading functions for code annotated with the OpenMP target directive. It uses a temporary naming of the outlined functions that will have to be updated later on once target side codegen and registration of offloading libraries is implemented - the naming needs to be made unique in the produced library. llvm-svn: 249148
* [DarwinDriver] Reapply: Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes2015-10-021-9/+28
| | | | | | | | | | | | | | | | | | | | | | Reapply r248935. Usually, when using LTO with a clang installation newer than the system's one, there's a libLTO.dylib version mismatch and LTO fails. One solution to this is to make ld point to the right libLTO.dylib by changing DYLD_LIBRARY_PATH. However, ld64 supports specifying the complete path to the desired libLTO.dylib through the -lto_library option. This commit adds support for the clang driver to use this option whenever it's capable of finding a libLTO.dylib in clang's installed library directory. This way, we don't need to rely on DYLD_LIBRARY_PATH nor get caught by version mismatches. Differential Revision: http://reviews.llvm.org/D13117 rdar://problem/7363476 llvm-svn: 249143
* Revert "Add support for the new mips-mti-linux toolchain."Vasileios Kalintiris2015-10-026-254/+25
| | | | | | | This reverts commit r249137 because it broke the Windows buildbots and a Linux buildbot for LLD. llvm-svn: 249141
* Implement ACLE 2.0 macros of chapters 6.6 and 6.7 for [ARM] and [Aarch64] ↵Alexandros Lamprineas2015-10-022-6/+9
| | | | | | | | targets. Differential Revision: http://reviews.llvm.org/D12633 llvm-svn: 249140
* Fix bogus comment.Douglas Katzman2015-10-021-1/+1
| | | | llvm-svn: 249138
* Add support for the new mips-mti-linux toolchain.Vasileios Kalintiris2015-10-026-25/+254
| | | | | | | | | | | | | | | | | | | | Summary: This new toolchain uses primarily LLVM-based tools, eg. compiler-rt, lld, libcxx, etc. Because of this, it doesn't require neither an existing GCC installation nor a GNU environment. Ideally, in a follow-up patch we would like to add a new --{llvm|clang}-toolchain option (similar to --gcc-toolchain) in order to allow the use of this toolchain with independent Clang builds. For the time being, we use the --sysroot option just to test the correctness of the paths generated by the driver. Reviewers: atanasyan, dsanders, rsmith Subscribers: jfb, tberghammer, danalbert, srhines, dschuff, cfe-commits Differential Revision: http://reviews.llvm.org/D13340 llvm-svn: 249137
* Move functions declared in Stmt{ObjC,CXX}.h and OpenMPClause.h intoJames Y Knight2015-10-026-1258/+1334
| | | | | | | | | | | their associated .cpp file. Previous refactorings long long ago had split out the above categories of classes from Stmt.h into their own header files, but failed to also split the Stmt.cpp implementation file similarly. Do so for readability's sake. llvm-svn: 249131
* Be slightly more permissive when checking for type-erased blocks.Bob Wilson2015-10-021-1/+2
| | | | | | This is a patch from Doug that was inadvertently omitted from r241543. llvm-svn: 249116
* PR24921: checking explicitly-specified template arguments when matching aRichard Smith2015-10-021-6/+15
| | | | | | | partial specialization can perform conversions on the argument. Be sure we start again from the original argument when checking each possible template. llvm-svn: 249114
* Fix the SSE4 byte sign extension in a cleaner way, and more thoroughlyChandler Carruth2015-10-014-21/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | test that our intrinsics behave the same under -fsigned-char and -funsigned-char. This further testing uncovered that AVX-2 has a broken cmpgt for 8-bit elements, and has for a long time. This is fixed in the same way as SSE4 handles the case. The other ISA extensions currently work correctly because they use specific instruction intrinsics. As soon as they are rewritten in terms of generic IR, they will need to add these special casts. I've added the necessary testing to catch this however, so we shouldn't have to chase it down again. I considered changing the core typedef to be signed, but that seems like a bad idea. Notably, it would be an ABI break if anyone is reaching into the innards of the intrinsic headers and passing __v16qi on an API boundary. I can't be completely confident that this wouldn't happen due to a macro expanding in a lambda, etc., so it seems much better to leave it alone. It also matches GCC's behavior exactly. A fun side note is that for both GCC and Clang, -funsigned-char really does change the semantics of __v16qi. To observe this, consider: % cat x.cc #include <smmintrin.h> #include <iostream> int main() { __v16qi a = { 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; __v16qi b = _mm_set1_epi8(-1); std::cout << (int)(a / b)[0] << ", " << (int)(a / b)[1] << '\n'; } % clang++ -o x x.cc && ./x -1, 1 % clang++ -funsigned-char -o x x.cc && ./x 0, 1 However, while this may be surprising, both Clang and GCC agree. Differential Revision: http://reviews.llvm.org/D13324 llvm-svn: 249097
* Don't try to get a CXXRecordDecl from a non-class TemplateSpecializationType.Kaelyn Takata2015-10-011-0/+2
| | | | | | | | With -fms-extensions it is possible to have a non-class record that is a template specialization cause an assertion failure via the call to Type::getAsCXXRecordDecl. Fixes PR 24246. llvm-svn: 249090
* Don't adjust field offsets when using external record layout.Zachary Turner2015-10-011-4/+11
| | | | | | | | | | | This was already being done when injecting the VBPtr, but not when injecting the VFPtr. This fixes a number of tests in LLDB's test suite. Reviewed by: David Majnemer Differential Revision: http://reviews.llvm.org/D13276 llvm-svn: 249085
* Perform Objective-C lifetime adjustments before comparing deduced lambda ↵Douglas Gregor2015-10-013-11/+24
| | | | | | | | | | result types. Objective-C ARC lifetime qualifiers are dropped when canonicalizing function types. Perform the same adjustment before comparing the deduced result types of lambdas. Fixes rdar://problem/22344904. llvm-svn: 249065
* [analyzer] Add TK_EntireMemSpace invalidation trait.Devin Coughlin2015-10-011-22/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit supports Sean Eveson's work on loop widening. It is NFC for now. It adds a new TK_EntireMemSpace invalidation trait that, when applied to a MemSpaceRegion, indicates that the entire memory space should be invalidated. Clients can add this trait before invalidating. For example: RegionAndSymbolInvalidationTraits ITraits; ITraits.setTrait(MRMgr.getStackLocalsRegion(STC), RegionAndSymbolInvalidationTraits::TK_EntireMemSpace); This commit updates the existing logic invalidating global memspace regions for calls to additionally handle arbitrary memspaces. When generating initial clusters during cluster analysis we now add a cluster to the worklist if the memspace for its base is marked with TK_EntireMemSpace. This also moves the logic for invalidating globals from ClusterAnalysis to invalidateRegionsWorker so that it is not shared with removeDeadBindingsWorker. There are no explicit tests with this patch -- but when applied to Sean's patch for loop widening in http://reviews.llvm.org/D12358 and after updating his code to set the trait, the failing tests in that patch now pass. Differential Revision: http://reviews.llvm.org/D12993 llvm-svn: 249063
* Simplify Sema::DeduceFunctionTypeFromReturnExpr and eliminae a redundant check.Douglas Gregor2015-10-011-7/+2
| | | | | | NFC llvm-svn: 249060
* Teach -Wtautological-overlap-compare about enumsGeorge Burgess IV2015-10-011-38/+89
| | | | | | | | | Prior to this patch, -Wtautological-overlap-compare would only warn us if there was a sketchy logical comparison between variables and IntegerLiterals. This patch makes -Wtautological-overlap-compare aware of EnumConstantDecls, so it can apply the same logic to them. llvm-svn: 249053
* Module debugging: Also emit Objective-C interfaces forward declarationsAdrian Prantl2015-10-011-2/+3
| | | | | | in their module scope when building a clang module. llvm-svn: 249031
* Allow a ToolChain to compute the path of a compiler-rt's component.Vasileios Kalintiris2015-10-013-57/+44
| | | | | | | | | | | | | | | | Summary: This patch moves getCompilerRT() from the clang::driver::tools namespace to the ToolChain class. This is needed for multilib toolchains that need to place their libraries in Clang's resource directory with a layout that is different from the default one. Reviewers: atanasyan, rsmith Subscribers: tberghammer, danalbert, srhines, cfe-commits Differential Revision: http://reviews.llvm.org/D13339 llvm-svn: 249030
* [PowerPC] Define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros on all PPC coresHal Finkel2015-10-011-8/+6
| | | | | | | | | | | | We support all __sync_val_compare_and_swap_* builtins (only 64-bit on 64-bit targets) on all cores, and should define the corresponding __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* macros, just as GCC does. As it turns out, this is really important because they're needed to prevent a bad ODR violation with libstdc++'s std::shared_ptr (this is well explained in PR12730). We were doing this only for P8, but this is necessary on all PPC systems. llvm-svn: 249009
* Revert "Decorating virtual functions load with invariant.load" and fixRenato Golin2015-10-011-10/+1
| | | | | | | This reverts commit r248982 as it was breaking the ARM buildbots and the fix didn't work. This reverts commit r248984, the fix that didn't work. llvm-svn: 249005
* C++11 rangify for loops, NFC.Yaron Keren2015-10-011-29/+21
| | | | llvm-svn: 249001
* [clang-format] Add support of consecutive declarations alignmentDaniel Jasper2015-10-013-11/+146
| | | | | | | | | | | | | | | | | | | This allows clang-format to align identifiers in consecutive declarations. This is useful for increasing the readability of the code in the same way the alignment of assignations is. The code is a slightly modified version of the consecutive assignment alignment code. Currently only the identifiers are aligned, and there is no support of alignment of the pointer star or reference symbol. The patch also solve the issue of alignments not being possible due to the ColumnLimit for both the existing AlignConsecutiveAligments and the new AlignConsecutiveDeclarations. Patch by Beren Minor, thank you. Review: http://reviews.llvm.org/D12362 llvm-svn: 248999
* Decorating virtual functions load with invariant.loadPiotr Padlewski2015-10-011-1/+10
| | | | | | http://reviews.llvm.org/D13279 llvm-svn: 248982
* Patch over a really horrible bug in our vector builtins that showed upChandler Carruth2015-10-011-3/+18
| | | | | | | | | | | | | | | | | | | | | | | recently when we started using direct conversion to model sign extension. The __v16qi type we use for SSE v16i8 vectors is defined in terms of 'char' which may or may not be signed! This causes us to generate pmovsx and pmovzx depending on the setting of -funsigned-char. This patch just forms an explicitly signed type and uses that to formulate the sign extension. While this gets the correct behavior (which we now verify with the enhanced test) this is just the tip of the ice berg. Now that I know what to look for, I have found errors of this sort *throughout* our vector code. Fortunately, this is the only specific place where I know of users actively having their code miscompiled by Clang due to this, so I'm keeping the fix for those users minimal and targeted. I'll be sending a proper email for discussion of how to fix these systematically, what the implications are, and just how widely broken this is... From what I can tell, we have never shipped a correct set of builtin headers for x86 when users rely on -funsigned-char. Oops. llvm-svn: 248980
* createUniqueFile() is documented to create the file in the temporary ↵Cameron Esfahani2015-10-011-1/+6
| | | | | | | | | | | | | | | | directory unless it's supplied an absolute path. Make sure the output filepath supplied to createUniqueFile() in HTMLDiagnostics::ReportDiag() is absolute. Summary: Make sure the output filepath supplied to createUniqueFile() in HTMLDiagnostics::ReportDiag() is absolute. Reviewers: rsmith, akyrtzi Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D12774 llvm-svn: 248977
* Fix printing of parameterized Objective-C interfaces.Bob Wilson2015-10-011-1/+1
| | | | | | This change was accidentally omitted from Doug's change in r241541. llvm-svn: 248975
* Module debugging: Emit Objective-C interfaces in their module scope whenAdrian Prantl2015-10-011-2/+3
| | | | | | building a clang module. llvm-svn: 248974
* [Sema] Don't crash when friending an unqualified templated constructorDavid Majnemer2015-09-301-7/+23
| | | | | | | | | | Unqualified templated constructors cannot be friended and our lack of a diagnostic led to violated invariants. Instead, raise a diagnostic when processing the friend declaration. This fixes PR20251. llvm-svn: 248953
* [CUDA] fix codegen for __nvvm_atom_cas_*Jingyue Wu2015-09-301-1/+3
| | | | | | | | | | | | Summary: __nvvm_atom_cas_* returns the old value instead of whether the swap succeeds. Reviewers: eliben, tra Subscribers: jholewinski, llvm-commits Differential Revision: http://reviews.llvm.org/D13306 llvm-svn: 248951
* Don't inherit the "unavailable" attribute from an overridden superclass method.Douglas Gregor2015-09-301-3/+1
| | | | | | Fixes rdar://problem/22922259. llvm-svn: 248950
* Don't inherit availability information when implementing a protocol requirement.Douglas Gregor2015-09-302-25/+49
| | | | | | | | | | When an Objective-C method implements a protocol requirement, do not inherit any availability information from the protocol requirement. Rather, check that the implementation is not less available than the protocol requirement, as we do when overriding a method that has availability. Fixes rdar://problem/22734745. llvm-svn: 248949
* Revert "[DarwinDriver] Use -lto_library to specify the path for libLTO.dylib"Bruno Cardoso Lopes2015-09-301-28/+9
| | | | | | Revert r248932. Bots complaining about new warnings where they shouldn't. llvm-svn: 248935
* [DarwinDriver] Use -lto_library to specify the path for libLTO.dylibBruno Cardoso Lopes2015-09-301-9/+28
| | | | | | | | | | | | | | | | | | | | Usually, when using LTO with a clang installation newer than the system's one, there's a libLTO.dylib version mismatch and LTO fails. One solution to this is to make ld point to the right libLTO.dylib by changing DYLD_LIBRARY_PATH. However, ld64 supports specifying the complete path to the desired libLTO.dylib through the -lto_library option. This commit adds support for the clang driver to use this option whenever it's capable of finding a libLTO.dylib in clang's installed library directory. This way, we don't need to rely on DYLD_LIBRARY_PATH nor get caught by version mismatches. Differential Revision: http://reviews.llvm.org/D13117 rdar://problem/7363476 llvm-svn: 248932
* Don't correct non-class using declarations to class members.Kaelyn Takata2015-09-301-0/+4
| | | | | | | Such declarations would be invalid anyway, and trying to make the correction will lead to a crash. Fixes PR 24781. llvm-svn: 248928
* [Sema] Avoid crashing during this-> insertion recoveryReid Kleckner2015-09-301-8/+15
| | | | | | | | | We get into this bad state when someone defines a new member function for a class but forgets to add the declaration to the class body. Calling the new member function from a member function template of the class will crash during instantiation. llvm-svn: 248925
* Alias "-ggdbN" to "-gN" options, fixing some incompatibilities.Douglas Katzman2015-09-301-4/+2
| | | | | | | * assembling from a .s file mistook -ggdb0 for -g * -ggdb1 is supposed to mean basically -g1, not -gN for N>1 llvm-svn: 248912
* [OpenCL 2.0] Enable program scope variables, Section 6.5.1.Anastasia Stulova2015-09-304-28/+64
| | | | | | | | | | | | | | | | | | - Remove virtual SC_OpenCLWorkGroupLocal storage type specifier as it conflicts with static local variables now and prevents diagnosing static local address space variables correctly. - Allow static local and global variables (OpenCL2.0 s6.8 and s6.5.1). - Improve diagnostics of allowed ASes for variables in different scopes: (i) Global or static local variables have to be in global or constant ASes (OpenCL1.2 s6.5, OpenCL2.0 s6.5.1); (ii) Non-kernel function variables can't be declared in local or constant ASes (OpenCL1.1 s6.5.2 and s6.5.3). http://reviews.llvm.org/D13105 llvm-svn: 248906
* Fix FunctionParmPackExpr::Create() to take a ParmVarDecl* array.James Y Knight2015-09-302-10/+10
| | | | | | | | | | | | FunctionParmPackExpr actually stores an array of ParmVarDecl* (and accessors return that). But, the FunctionParmPackExpr::Create() constructor accepted an array of Decl *s instead. It was easy for this mismatch to occur without any obvious sign of something wrong, since both the store and the access used independent 'reinterpet_cast<XX>(this+1)' calls. llvm-svn: 248905
* [OpenCL] Add missing OpenCL LangOpts in address space compatibility checksAnastasia Stulova2015-09-301-7/+9
| | | | | | | | | and test checking broken (due to CL specific diagnostics) C functionality M test/Sema/address_spaces.c M lib/Sema/SemaExpr.cpp llvm-svn: 248902
* [OpenCL 2.0] This change adds extra diagnostics to atomic typesAnastasia Stulova2015-09-301-0/+22
| | | | | | | | | Applied restrictions from OpenCL v2.0 s6.13.11.8 that mainly disallow operations on atomic types (except for taking their address - &). The patch is taken from SPIR2.0 provisional branch, contributed by Guy Benyei! llvm-svn: 248896
* [OpenCL 2.0] Fix wrong atomic type detection in the diagnostics of allowed typesAnastasia Stulova2015-09-301-7/+9
| | | | llvm-svn: 248891
* [ARM][NEON] Use address space in vld([1234]|[234]lane) and ↵Jeroen Ketema2015-09-301-10/+20
| | | | | | | | | | | | | | | | | | | | | | | vst([1234]|[234]lane) instructions This is the clang commit associated with llvm r248887. This commit changes the interface of the vld[1234], vld[234]lane, and vst[1234], vst[234]lane ARM neon intrinsics and associates an address space with the pointer that these intrinsics take. This changes, e.g., <2 x i32> @llvm.arm.neon.vld1.v2i32(i8*, i32) to <2 x i32> @llvm.arm.neon.vld1.v2i32.p0i8(i8*, i32) This change ensures that address spaces are fully taken into account in the ARM target during lowering of interleaved loads and stores. Differential Revision: http://reviews.llvm.org/D13127 llvm-svn: 248888
* [OPENMP 4.1] Sema analysis for array sections in 'reduction' clause.Alexey Bataev2015-09-303-90/+136
| | | | | | OpenMP 4.1 allows to use array sections|subscript expressions in 'reduction' clauses. Added sema analysis, updated tests. llvm-svn: 248880
OpenPOWER on IntegriCloud