summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Only take NULL macros instead of all macros into account for -Wnull-conversion.Richard Trieu2016-01-091-2/+6
| | | | llvm-svn: 257240
* Exclude function calls for functions which have return type nullptr_t fromRichard Trieu2016-01-081-0/+4
| | | | | | | | | -Wnull-conversion warning. These functions are basically equivalent to other pointer returning fuctions which are already excluded by -Wnull-conversion. llvm-svn: 257231
* [modules] Make sure we always include the contents of private headers whenRichard Smith2016-01-081-9/+11
| | | | | | | | | | building a module. Prior to this change, the private header's content would only be included if the header were included by another header in the same module. If not (if the private header is only used by the .cc files of the module, or is included from outside the module via -Wno-private-header), a #include of that file would be silently ignored. llvm-svn: 257222
* [MS ABI] Complete and base constructor GlobalDecls must have the same nameDavid Majnemer2016-01-081-1/+14
| | | | | | | | | | | | | | | | | Clang got itself into the situation where we mangled the same constructor twice with two different constructor types. After one of the constructors were utilized, the tag used for one of the types changed from class to struct because a class template became complete. This resulted in one of the constructor types varying from the other constructor. Instead, force "base" constructor types to "complete" if the ABI doesn't have constructor variants. This will ensure that GlobalDecls for both variants will get the same mangled name. This fixes PR26029. llvm-svn: 257205
* Update code in buildCudaActions and BuildActions to latest idiom.Justin Lebar2016-01-081-18/+14
| | | | | | | | | | | | | | | Summary: Use llvm::any_of, llvm::find, etc. No functional changes. Reviewers: tra Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15936 llvm-svn: 257190
* [ThinLTO] Leverage new in-place renaming supportTeresa Johnson2016-01-082-51/+34
| | | | | | | | | | | | Due to the new in-place renaming support added in r257174, we no longer need to invoke ThinLTO global renaming from clang. It will be invoked on the module in the FunctionImport pass (by an immediately following llvm commit). As a result, we don't need to load the FunctionInfoIndex as early, so that is moved down into EmitAssemblyHelper::EmitAssembly. llvm-svn: 257179
* Driver: Use the new ELF lld linker for AMDGPUTom Stellard2016-01-082-5/+1
| | | | | | | | | | | | Summary: 'gnu-old' has been deprecated in favor or 'gnu'. Reviewers: arsenm, ruiu, rafael Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15953 llvm-svn: 257175
* clang-format: [JS] Prefer wrapping before the TypeScript return typeDaniel Jasper2016-01-081-1/+1
| | | | | | | | | | | | | | over wrapping before parameters. Before: function someFunc( args: string[]): {longReturnValue: string[]} {} After: function someFunc(args: string[]): {longReturnValue: string[]} {} llvm-svn: 257162
* clang-format: [JS] Add some Closure Compiler JSDoc tags to the defaultDaniel Jasper2016-01-081-0/+1
| | | | | | Google configuration so that they aren't line-wrapped. llvm-svn: 257159
* clang-format: [JS] Support more ES6 classes.Daniel Jasper2016-01-081-0/+2
| | | | | | | | | | | | | | | Before: foo = class { constructor() {} } ; After: foo = class { constructor() {} }; llvm-svn: 257154
* [PPC] Add long long/double support for vec_cts, vec_ctu and vec_ctfKyle Butt2016-01-081-4/+34
| | | | | | | | | | | Add long long/double support for vec_cts, vec_ctu and vec_ctf. Similar to this change in GCC: https://gcc.gnu.org/ml/gcc-patches/2014-08/msg02653.html Patch by Tim Shen. llvm-svn: 257135
* Turn off lldb debug tuning by default for FreeBSDDimitry Andric2016-01-071-3/+0
| | | | | | | | | | | | | | | Summary: This is the clang part of D15966. In rL256104, debugger tuning was added to the clang driver, and again the default for FreeBSD was set to lldb. The default needs to be gdb instead. Reviewers: emaste, probinson Subscribers: cfe-commits, emaste Differential Revision: http://reviews.llvm.org/D15967 llvm-svn: 257104
* Properly track that a character literal is UTF-8, and pretty print the ↵Aaron Ballman2016-01-076-1/+9
| | | | | | prefix properly. llvm-svn: 257097
* [PGO] Simplify coverage mapping loweringXinliang David Li2016-01-073-5/+21
| | | | | | | | | | | | | | | | Coverage mapping data may reference names of functions that are skipped by FE (e.g, unused inline functions). Since those functions are skipped, normal instr-prof function lowering pass won't put those names in the right section, so special handling is needed to walk through coverage mapping structure and recollect the references. With this patch, only names that are skipped are processed. This simplifies the lowering code and it no longer needs to make assumptions coverage mapping data layout. It should also be more efficient. llvm-svn: 257092
* clang-format: Fix corner case in one-per-line formatting.Daniel Jasper2016-01-071-1/+1
| | | | | | | | | | | | | | | | | | | Before (example is JS, but also applies to C++): return [ aaaa() .bbbbbbbb('A'), aaaa().bbbbbbbb('B'), aaaa().bbbbbbbb('C'), ]; After: return [ aaaa().bbbbbbbb('A'), aaaa().bbbbbbbb('B'), aaaa().bbbbbbbb('C'), ]; llvm-svn: 257079
* clang-format: Support weird lambda macros.Daniel Jasper2016-01-071-0/+12
| | | | | | | | | | Before: MACRO((AA & a) { return 1; }); After: MACRO((AA &a) { return 1; }); llvm-svn: 257062
* ARM: allow __thread on OS versions that have the required runtime support.Tim Northover2016-01-071-1/+18
| | | | llvm-svn: 257041
* Make sure we claim arguments that are going to be passed to a gcc tool,Eric Christopher2016-01-071-5/+6
| | | | | | even if they're not going to be used to avoid unused option warnings. llvm-svn: 257040
* clang-format: [JS] Support more ES6 imports.Daniel Jasper2016-01-071-8/+7
| | | | | | | | | | | Before: import a, {X, Y} from 'some/module.js'; After: import a, {X, Y} from 'some/module.js'; llvm-svn: 257038
* [WebAssembly] Add -m:e to the target triple.Dan Gohman2016-01-071-2/+2
| | | | llvm-svn: 257021
* [Sema] Teach overload resolution about unaddressable functions.George Burgess IV2016-01-072-4/+39
| | | | | | | | | | | | Given an expression like `(&Foo)();`, we perform overload resolution as if we are calling `Foo` directly. This causes problems if `Foo` is a function that can't have its address taken. This patch teaches overload resolution to ignore functions that can't have their address taken in such cases. Differential Revision: http://reviews.llvm.org/D15590 llvm-svn: 257016
* Replace a loop with the call that does the same thing.Eric Christopher2016-01-071-2/+1
| | | | llvm-svn: 257014
* [WebAssembly] Enable -fvisibility=hidden by default.Dan Gohman2016-01-072-0/+17
| | | | | | | This, along with many things in the WebAssembly target, is experimental. Feedback is welcome. llvm-svn: 257006
* [WebAssembly] Enable -ffunction-sections and -fdata-sections by default.Dan Gohman2016-01-071-3/+8
| | | | | | | These remain user-overridable with -fno-function-sections and -fno-data-sections. llvm-svn: 257005
* [WebAssembly] Only enable --gc-sections when optimizations are enabled.Dan Gohman2016-01-071-1/+2
| | | | | | | Also, revamp the wasm-toolchain.c test and add a test to ensure that a user-supplied --no-gc-sections comes after --gc-sections. llvm-svn: 257004
* Properly bind up any cleanups in an ExprWithCleanups afterJohn McCall2016-01-061-6/+5
| | | | | | | | | | instantiating a default argument expression. This was previously just working implicitly by reinstantiating in the current context, but caching means that we weren't registering cleanups in subsequent uses. llvm-svn: 256996
* PR26048, PR26050: put non-type template parameters and indirect field declsRichard Smith2016-01-062-3/+18
| | | | | | | | into IDNS_Tag in C++, because they conflict with redeclarations of tags. (This doesn't affect elaborated-type-specifier lookup, which looks for IDNS_Type in C++). llvm-svn: 256985
* Only instantiate a default argument once.John McCall2016-01-068-29/+47
| | | | | | | | | | | | | | | | | | | By storing the instantiated expression back in the ParmVarDecl, we remove the last need for separately storing the sub-expression of a CXXDefaultArgExpr. This makes PCH/Modules merging quite simple: CXXDefaultArgExpr records are serialized as references to the ParmVarDecl, and we ignore redundant attempts to overwrite the instantiated expression. This has some extremely marginal impact on user-facing semantics. However, the major effect is that it avoids IRGen errors about conflicting definitions due to lambdas in the argument being instantiated multiple times while sharing the same mangling. It should also slightly improve memory usage and module file size. rdar://23810407 llvm-svn: 256983
* Fix half of PR26048. We don't yet diagnose the case where the anonymous ↵Richard Smith2016-01-061-8/+7
| | | | | | union member is declared first and the tag name is declared second. llvm-svn: 256979
* [Hexagon] Treat -march and -mcpu as equivalentKrzysztof Parzyszek2016-01-061-7/+2
| | | | llvm-svn: 256977
* Improve conditional checking during template instantiation.Richard Trieu2016-01-061-3/+5
| | | | | | | | | | | | | When the condition in an if statement, while statement, or for loop is created during template instantiation, it calls MakeFullExpr with only the condition expression. However, when these conditions are created for non-templated code in the Parser, an additional SourceLocation is passed to MakeFullExpr. The impact of this was that non-dependent templated code could produce diagnostics that the same code outside templates would not. Adding the missing SourceLocation makes diagnostics consistent between templated and non-templated code. llvm-svn: 256976
* [WebAssembly] Add --gc-sections to the link line.Dan Gohman2016-01-061-0/+5
| | | | | | | | This will eventually be accompanied with a change to enable -ffunction-sections and -fdata-sections by default, which is currently delayed by some development process issues. llvm-svn: 256967
* Module debugging: Defer emitting tag types until their definitionAdrian Prantl2016-01-061-3/+16
| | | | | | | | | was visited and all decls have been merged. We only get a single chance to emit the types for virtual classes because CGDebugInfo::completeRequiredType() categorically doesn't complete them. llvm-svn: 256962
* Fix -Wdocumentation warning after r256933Nico Weber2016-01-061-1/+1
| | | | llvm-svn: 256960
* [Driver] Add support for -fno-builtin-foo options.Chad Rosier2016-01-0610-18/+94
| | | | | | | Addresses PR4941 and rdar://6756912. http://reviews.llvm.org/D15195 llvm-svn: 256937
* [Hexagon] Use back_inserter as target iterator in std::copyKrzysztof Parzyszek2016-01-061-1/+2
| | | | llvm-svn: 256934
* [OpenMP] Reapply rL256842: [OpenMP] Offloading descriptor registration and ↵Samuel Antao2016-01-067-41/+1024
| | | | | | | | | | | | device codegen. This patch attempts to fix the regressions identified when the patch was committed initially. Thanks to Michael Liao for identifying the fix in the offloading metadata generation related with side effects in evaluation of function arguments. llvm-svn: 256933
* [Analyzer] Change the default SA checkers for PS4Sean Eveson2016-01-061-8/+15
| | | | | | | | | | | | Summary: This patch removes security.*, unix.API and unix.Vfork from the default checkers for PS4. Reviewers: dcoughlin, zaks.anna Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15888 llvm-svn: 256926
* Add -fno-movt frontend option, to disable movt/movw on ARMDimitry Andric2016-01-061-2/+2
| | | | | | | | | | | | | | | | | Summary: In rL256641, @davide turned off movt generation by default for FreeBSD. This was because our ld is very old, and did not support the relocations for it. However, Ian Lepore added the support very recently, so we would like to revert rL256641, and replace it with a new `-fno-movt` frontend option. This way, it can be turned off when needed. Reviewers: dexonsmith, echristo, emaste, davide Subscribers: andrew, aemerson, rengolin, davide, cfe-commits, ahatanak, emaste Differential Revision: http://reviews.llvm.org/D15899 llvm-svn: 256920
* Change the set of actions built for external gcc tools.Eric Christopher2016-01-062-0/+9
| | | | | | | | A gcc tool has an "integrated" assembler (usually gas) that it will call to produce an object. Let it use that assembler so that we don't have to deal with assembly syntax incompatibilities. llvm-svn: 256919
* [modules] When a tag type that was imported from a module is referenced via anRichard Smith2016-01-061-10/+29
| | | | | | | elaborated-type-specifier, create a declaration of it to track that the current module makes it visible too. llvm-svn: 256907
* Avoid assert failure on some invalid cc1 options.Douglas Katzman2016-01-061-8/+19
| | | | | | | | Addressing review comment in D13221. Differential Revision: http://reviews.llvm.org/D15882 llvm-svn: 256897
* [analyzer] Fix false warning about memory leak for QApplication::postEventAnna Zaks2016-01-061-0/+10
| | | | | | | | | | | According to Qt documentation Qt takes care of memory allocated for QEvent: http://doc.qt.io/qt-4.8/qcoreapplication.html#postEvent A patch by Evgeniy Dushistov! Differential Revision: http://reviews.llvm.org/D14170 llvm-svn: 256887
* [analyzer] Suppress reports coming from std::__independent_bits_engineAnna Zaks2016-01-061-0/+10
| | | | | | | | | | | | | The analyzer reports a shift by a negative value in the constructor. The bug can be easily triggered by calling std::random_shuffle on a vector (<rdar://problem/19658126>). (The shift by a negative value is reported because __w0_ gets constrained to 63 by the conditions along the path:__w0_ < _WDt && __w0_ >= _WDt-1, where _WDt is 64. In normal execution, __w0_ is not 63, it is 1 and there is no overflow. The path is infeasible, but the analyzer does not know about that.) llvm-svn: 256886
* [analyzer] Don't report null dereferences on address_space annotated memoryAnna Zaks2016-01-061-20/+35
| | | | llvm-svn: 256885
* [Clang/Support/Windows/Unix] Command lines created by clang may exceed the ↵Oleg Ranevskyy2016-01-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | command length limit set by the OS Summary: LLVM part of the patch is D15831. When clang runs an external tool such as a linker it may create a command line that exceeds the length limit. Clang uses the llvm::sys::argumentsFitWithinSystemLimits function to check if command line length fits the OS limitation. There are two problems in this function that may cause exceeding of the limit: 1. It ignores the length of the program path in its calculations. On the other hand, clang adds the program path to the command line when it runs the program. 2. It assumes no space character is inserted after the last argument, which is not true for Windows. The flattenArgs function adds the trailing space for *each* argument. The result of this is that the terminating NULL character is not counted and may be placed beyond the length limit if the command line is exactly 32768 characters long. The WinAPI's CreateProcess does not find the NULL character and fails. Reviewers: rafael, asl Subscribers: asl, llvm-commits Differential Revision: http://reviews.llvm.org/D15832 llvm-svn: 256865
* [OpenMP] Revert rL256842: [OpenMP] Offloading descriptor registration and ↵Samuel Antao2016-01-057-1025/+41
| | | | | | | | device codegen. It was causing two regression, so I'm reverting until the cause is found. llvm-svn: 256858
* [PGO] Enable clang to pass compiler-rt profile support library to linker on ↵Nathan Slingerland2016-01-051-0/+2
| | | | | | | | | | | | | | Windows Summary: This change enables clang to automatically link binaries built with the -fprofile-instr-generate against the clang_rt.profile-i386.lib library. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15833 llvm-svn: 256855
* [OpenMP] Offloading descriptor registration and device codegen.Samuel Antao2016-01-057-41/+1025
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In order to offloading work properly two things need to be in place: - a descriptor with all the offloading information (device entry functions, and global variable) has to be created by the host and registered in the OpenMP offloading runtime library. - all the device functions need to be emitted for the device and a convention has to be in place so that the runtime library can easily map the host ID of an entry point with the actual function in the device. This patch adds support for these two things. However, only entry functions are being registered given that 'declare target' directive is not yet implemented. About offloading descriptor: The details of the descriptor are explained with more detail in http://goo.gl/L1rnKJ. Basically the descriptor will have fields that specify the number of devices, the pointers to where the device images begin and end (that will be defined by the linker), and also pointers to a the begin and end of table whose entries contain information about a specific entry point. Each entry has the type: ``` struct __tgt_offload_entry{ void *addr; char *name; int64_t size; }; ``` and will be implemented in a pre determined (ELF) section `.omp_offloading.entries` with 1-byte alignment, so that when all the objects are linked, the table is in that section with no padding in between entries (will be like a C array). The code generation ensures that all `__tgt_offload_entry` entries are emitted in the same order for both host and device so that the runtime can have the corresponding entries in both host and device in same index of the table, and efficiently implement the mapping. The resulting descriptor is registered/unregistered with the runtime library using the calls `__tgt_register_lib` and `__tgt_unregister_lib`. The registration is implemented in a high priority global initializer so that the registration happens always before any initializer (that can potentially include target regions) is run. The driver flag -omptargets= was created to specify a comma separated list of devices the user wants to support so that the new functionality can be exercised. Each device is specified with its triple. About target codegen: The target codegen is pretty much straightforward as it reuses completely the logic of the host version for the same target region. The tricky part is to identify the meaningful target regions in the device side. Unlike other programming models, like CUDA, there are no already outlined functions with attributes that mark what should be emitted or not. So, the information on what to emit is passed in the form of metadata in host bc file. This requires a new option to pass the host bc to the device frontend. Then everything is similar to what happens in CUDA: the global declarations emission is intercepted to check to see if it is an "interesting" declaration. The difference is that instead of checking an attribute, the metadata information in checked. Right now, there is only a form of metadata to pass information about the device entry points (target regions). A class `OffloadEntriesInfoManagerTy` was created to manage all the information and queries related with the metadata. The metadata looks like this: ``` !omp_offload.info = !{!0, !1, !2, !3, !4, !5, !6} !0 = !{i32 0, i32 52, i32 77426347, !"_ZN2S12r1Ei", i32 479, i32 13, i32 4} !1 = !{i32 0, i32 52, i32 77426347, !"_ZL7fstatici", i32 461, i32 11, i32 5} !2 = !{i32 0, i32 52, i32 77426347, !"_Z9ftemplateIiET_i", i32 444, i32 11, i32 6} !3 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 99, i32 11, i32 0} !4 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 272, i32 11, i32 3} !5 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 127, i32 11, i32 1} !6 = !{i32 0, i32 52, i32 77426347, !"_Z3fooi", i32 159, i32 11, i32 2} ``` The fields in each metadata entry are (in sequence): Entry 1) an ID of the type of metadata - right now only zero is used meaning "OpenMP target region". Entry 2) a unique ID of the device where the input source file that contain the target region lives. Entry 3) a unique ID of the file where the input source file that contain the target region lives. Entry 4) a mangled name of the function that encloses the target region. Entries 5) and 6) line and column number where the target region was found. Entry 7) is the order the entry was emitted. Entry 2) and 3) are required to distinguish files that have the same function name. Entry 4) is required to distinguish different instances of the same declaration (usually templated ones) Entries 5) and 6) are required to distinguish the particular target region in body of the function (it is possible that a given target region is not an entry point - if clause can evaluate always to zero - and therefore we need to identify the "interesting" target regions. ) This patch replaces http://reviews.llvm.org/D12306. Reviewers: ABataev, hfinkel, tra, rjmccall, sfantao Subscribers: FBrygidyn, piotr.rak, Hahnfeld, cfe-commits Differential Revision: http://reviews.llvm.org/D12614 llvm-svn: 256842
* clang-format: Fix corner case in "if it saves columns"-calculation.Daniel Jasper2016-01-051-1/+1
| | | | | | | | | | | | | | | Before: aaaa .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); After: aaaa.aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa( aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) .aaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa); llvm-svn: 256841
OpenPOWER on IntegriCloud