summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang][Driver][ARM] Favor -mfpu over default CPU featuresAlexandros Lamprineas2019-07-141-1/+5
| | | | | | | | | | | | | | | | When processing the command line options march, mcpu and mfpu, we store the implied target features on a vector. The change D62998 introduced a temporary vector, where the processed features get accumulated. When calling DecodeARMFeaturesFromCPU, which sets the default features for the specified CPU, we certainly don't want to override the features that have been explicitly specified on the command line. Therefore, the default features should appear first in the final vector. This problem became evident once I added the missing (unhandled) target features in ARM::getExtensionFeatures. Differential Revision: https://reviews.llvm.org/D63936 llvm-svn: 366027
* [Driver] Simplify AddLibgccFangrui Song2019-07-141-9/+3
| | | | llvm-svn: 366013
* [Driver] Simplify -lgcc & -lgcc_sFangrui Song2019-07-141-17/+13
| | | | | | | gcc defaults to -shared-libgcc in C++ mode. Letting getLibGccType() return SharedLibGcc simplifies the logic. llvm-svn: 366012
* Remove extra ';' to silent compiler warning.Michael Liao2019-07-131-2/+3
| | | | | | - Plus extra style formatting. llvm-svn: 366010
* [CMake][Fuchsia] Define asan+noexcept multilibPetr Hosek2019-07-131-0/+5
| | | | | | | | | | | | | | | | | | Using noexcept multilib with -fno-exceptions can lead to significant space savings when statically linking libc++abi because we don't need all the unwinding and demangling code. When compiling with ASan, we already get a lot of overhead from the instrumentation itself, when statically linking libc++abi, that overhead is even larger. Having the noexcept variant for ASan can help significantly, we've seen more than 50% size reduction in our system image, which offsets the cost of having to build another multilib. Differential Revision: https://reviews.llvm.org/D64140 llvm-svn: 365994
* This reverts commit 632a36bfcfc8273c1861f04ff6758d863c47c784.Sylvestre Ledru2019-07-132-0/+8
| | | | | | | | | | | | Some targets such as Python 2.7.16 still use VERSION in their builds. Without VERSION defined, the source code has syntax errors. Reverting as it will probably break many other things. Noticed by Sterling Augustine llvm-svn: 365992
* Initialize the non-trivial C union bits I added to RecordDeclBitfieldsAkira Hatanaka2019-07-131-0/+3
| | | | | | | | | | in r365985 These bits weren't being initialized in the RecordDecl's constructor, which probably caused test/Modules/stress1.cpp to fail on a couple of bots. llvm-svn: 365989
* [Sema] Diagnose default-initialization, destruction, and copying ofAkira Hatanaka2019-07-137-86/+371
| | | | | | | | | | | | | | | | | | | | | | | | | | | non-trivial C union types This patch diagnoses uses of non-trivial C unions and structs/unions containing non-trivial C unions in the following contexts, which require default-initialization, destruction, or copying of the union objects, instead of disallowing fields of non-trivial types in C unions, which is what we currently do: - function parameters. - function returns. - assignments. - compound literals. - block captures except capturing of `__block` variables by non-escaping blocks. - local and global variable definitions. - lvalue-to-rvalue conversions of volatile types. See the discussion in https://reviews.llvm.org/D62988 for more background. rdar://problem/50679094 Differential Revision: https://reviews.llvm.org/D63753 llvm-svn: 365985
* Re-land [JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from ↵Sam McCall2019-07-121-4/+46
| | | | | | | | parsed commands. Use //net/dir like other test cases for windows compatibility llvm-svn: 365975
* [DirectoryWatcher][NFC] Silence warnings in release buildJan Korous2019-07-121-1/+4
| | | | llvm-svn: 365968
* [DirectoryWatcher][linux] Fix use of uninitialized valueJan Korous2019-07-121-2/+2
| | | | llvm-svn: 365966
* Remove __VERSION__Sylvestre Ledru2019-07-122-8/+0
| | | | | | | | | | | | | | | | | | | | Summary: It has been introduced in 2011 for gcc compat: https://github.com/llvm-mirror/clang/commit/ad1a4c6e89594e704775ddb6b036ac982fd68cad it is probably time to remove it Reviewers: rnk, dexonsmith Reviewed By: rnk Subscribers: dschuff, aheejin, fedor.sergeev, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64062 llvm-svn: 365962
* Revert driver: Don't warn about assembler flags being unused when not assemblingReid Kleckner2019-07-121-12/+0
| | | | | | | | | | | This reverts r365703 (git commit 101c1afdfd1c88f05da94c6fd317b489bb704f40) and r365714. This broke some autoconf-style assembler flags checks in the Linux build: https://github.com/ClangBuiltLinux/linux/issues/598 llvm-svn: 365956
* Reland [clang] DirectoryWatcherJan Korous2019-07-127-0/+710
| | | | | | | | | | This reverts commit f561227d133224d2d6a5a016abe4be051fa75501. - DirectoryWatcher - Fix the build for platforms that don't have DW implementated. - Fix the threading dependencies (thanks to compnerd). llvm-svn: 365954
* Revert "Reland [clang] DirectoryWatcher"Jan Korous2019-07-127-710/+0
| | | | | | This reverts commit fdcb7f47e783933e0af8a5fae91132269a208268. llvm-svn: 365948
* Reland [clang] DirectoryWatcherJan Korous2019-07-127-0/+710
| | | | | | | | This reverts commit abce8c457dd3de6b156756e547cc0eefb7653c79. + Fix the build for platforms that don't have DW implementated. llvm-svn: 365947
* [WebAssembly] Make pthread imply bulk-memory, mutable-globalsThomas Lively2019-07-121-1/+15
| | | | | | | | | | | | | | | | | Summary: This paves the way for using passive segments in pthread builds, which will make separate memory files unnecessary. Mutable globals are also necessary for the upcoming implementation of TLS. Reviewers: aheejin, dschuff Subscribers: sbc100, jgravelle-google, sunfish, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64586 llvm-svn: 365935
* [SystemZ] Add support for new cpu architecture - arch13Ulrich Weigand2019-07-125-2/+431
| | | | | | | | | | | | | | | | | This patch series adds support for the next-generation arch13 CPU architecture to the SystemZ backend. This includes: - Basic support for the new processor and its features. - Support for low-level builtins mapped to new LLVM intrinsics. - New high-level intrinsics in vecintrin.h. - Indicate support by defining __VEC__ == 10303. Note: No currently available Z system supports the arch13 architecture. Once new systems become available, the official system name will be added as supported -march name. llvm-svn: 365933
* CodeGet: Init 32bit pointers with 0xFFFFFFFFVitaly Buka2019-07-121-18/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Patch makes D63967 effective for 32bit platforms and improves pattern initialization there. It cuts size of 32bit binary compiled with -ftrivial-auto-var-init=pattern by 2% (3% with -Os). Binary size change on CTMark, (with -fuse-ld=lld -Wl,--icf=all, similar results with default linker options) ``` master patch diff Os pattern 7.915580e+05 7.698424e+05 -0.028387 O3 pattern 9.953688e+05 9.752952e+05 -0.019325 ``` Zero vs Pattern on master ``` zero pattern diff Os 7.689712e+05 7.915580e+05 0.031380 O3 9.744796e+05 9.953688e+05 0.021133 ``` Zero vs Pattern with the patch ``` zero pattern diff Os 7.689712e+05 7.698424e+05 0.000789 O3 9.744796e+05 9.752952e+05 0.000742 ``` Reviewers: pcc, eugenis, glider, jfb Reviewed By: jfb Subscribers: hubert.reinterpretcast, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64597 llvm-svn: 365921
* Dump actual line numbers when dumping the AST to JSON.Aaron Ballman2019-07-121-10/+19
| | | | | | The "line" attribute is now the physical line within the source file for the location. A "presumedLine" attribute is printed when the presumed line number does not match the given source line number. We continue to not print repeated line information in subsequent source locations, but we track presumed and actual lines separately. llvm-svn: 365919
* Revert "[JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from ↵Russell Gallop2019-07-121-46/+4
| | | | | | | | | | parsed commands." New test is failing on Windows bot This reverts commit 9c0391b36a76f8e3949588de3f44b7314c2318bf. llvm-svn: 365906
* Delete dead storesFangrui Song2019-07-124-6/+2
| | | | llvm-svn: 365901
* Dump floating-point values as strings when dumping to JSON.Aaron Ballman2019-07-121-1/+3
| | | | | | This fixes a bug where we would have an invalid JSON attribute (e.g., "value": inf). It also increases the precision of the values because they're not represented as approximate doubles with the host architecture's floating-point model. llvm-svn: 365900
* [Driver] Delete dead codeFangrui Song2019-07-122-7/+1
| | | | llvm-svn: 365898
* [JSONCompilationDatabase] Strip distcc/ccache/gomacc wrappers from parsed ↵Sam McCall2019-07-121-4/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commands. Summary: It's common to use compiler wrappers by setting CC="gomacc clang++". This results in both args appearing in compile_commands.json, and clang's driver can't handle this. This patch attempts to recognize this pattern (by looking for well-known wrappers) and dropping argv0 in this case. It conservatively ignores other cases for now: - wrappers with unknown names - wrappers that accept -flags - wrappers where the compiler to use is implied (usually cc or gcc) This is done at the JSONCompilationDatabase level rather than somewhere more fundamental, as (hopefully) this isn't a general conceptual problem, but a messy aspect of the nature of the ecosystem around compile_commands.json. i.e. compilation databases more tightly tied to the build system should not have this problem. Reviewers: phosek, klimek Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D64297 llvm-svn: 365887
* [Driver] Delete --no-add-needed for RHEL7 or newerFangrui Song2019-07-121-3/+0
| | | | | | | | This is really not needed. gcc driver doesn't add this option. BTW, since binutils 2.22, --no-copy-dt-needed-entries (new name of --no-add-needed) is the default. llvm-svn: 365877
* [X86][PowerPC] Support -mlong-double-128Fangrui Song2019-07-125-12/+23
| | | | | | | | | | | | | | | This patch makes the driver option -mlong-double-128 available for X86 and PowerPC. The CC1 option -mlong-double-128 is available on all targets for users to test on unsupported targets. On PowerPC, -mlong-double-128 uses the IBM extended double format because we don't support -mabi=ieeelongdouble yet (D64283). Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D64277 llvm-svn: 365866
* [PowerPC] Default to -fomit-frame-pointer when optimization is enabledFangrui Song2019-07-121-3/+3
| | | | | | | NetBSD, Linux, CloudABI and Hurd already omit frame pointer for PowerPC. Make it do so for other platforms. llvm-svn: 365862
* [analyzer] exploded-graph-rewriter: Improve source location dumps.Artem Dergachev2019-07-122-27/+15
| | | | | | | | - Correctly display macro expansion and spelling locations. - Use the same procedure to display location context call site locations. - Display statement IDs for program points. llvm-svn: 365861
* [Driver] Refactor interaction between -f(no-)?omit-frame-pointer and ↵Fangrui Song2019-07-121-31/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -m(no-)?omit-leaf-frame-pointer Use a tri-state enum to represent shouldUseFramePointer() and shouldUseLeafFramePointer(). This simplifies the logic and fixes PR9825: -fno-omit-frame-pointer doesn't imply -mno-omit-leaf-frame-pointer. and PR24003: /Oy- /O2 should not omit leaf frame pointer: this matches MSVC x86-32. (/Oy- is a no-op on MSVC x86-64.) and: when CC1 option -mdisable-fp-elim if absent, -momit-leaf-frame-pointer can also be omitted. The new behavior matches GCC: -fomit-frame-pointer wins over -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer loses out to -momit-leaf-frame-pointer The behavior makes lots of sense. We have 4 states: - 00) leaf retained, non-leaf retained - 01) leaf retained, non-leaf omitted (this is invalid) - 10) leaf omitted, non-leaf retained (what -momit-leaf-frame-pointer was designed for) - 11) leaf omitted, non-leaf omitted "omit" options taking precedence over "no-omit" options is the only way to make 3 valid states representable with -f(no-)?omit-frame-pointer and -m(no-)?omit-leaf-pointer. Reviewed By: ychen Differential Revision: https://reviews.llvm.org/D64294 llvm-svn: 365860
* Re-Revert Devirtualize destructor of final class.Jordan Rupprecht2019-07-121-27/+3
| | | | | | | | | | This reverts r365509 (git commit d088720edad9c29ee0d622b5d69092e18a9ac0bd) This is a second revert[1] due to failures in internal test cases (shared offline) found during more thorough testing. [1] Original patch commited as r364100, reverted as r364359, recommitted as r365509 llvm-svn: 365850
* [NewPM] Port SancovLeonard Chan2019-07-111-7/+40
| | | | | | | | | | | | | | | | | This patch contains a port of SanitizerCoverage to the new pass manager. This one's a bit hefty. Changes: - Split SanitizerCoverageModule into 2 SanitizerCoverage for passing over functions and ModuleSanitizerCoverage for passing over modules. - ModuleSanitizerCoverage exists for adding 2 module level calls to initialization functions but only if there's a function that was instrumented by sancov. - Added legacy and new PM wrapper classes that own instances of the 2 new classes. - Update llvm tests and add clang tests. Differential Revision: https://reviews.llvm.org/D62888 llvm-svn: 365838
* [OPENMP]Improve handling of analysis of unsupported VLAs in reductions.Alexey Bataev2019-07-111-4/+8
| | | | | | | | | Fixed the processing of the unsupported VLAs in the reduction clauses. Used targetDiag if the diagnostics can be delayed and emit it immediately if the target does not support VLAs and we're parsing target directive with the reduction clauses. llvm-svn: 365821
* Revert "[CGDebugInfo] Simplify EmitFunctionDecl parameters, NFC"Vedant Kumar2019-07-112-18/+14
| | | | | | This reverts commit 1af41074445229fea66b99710a850e5f42ecfa95. llvm-svn: 365814
* [CGDebugInfo] Simplify EmitFunctionDecl parameters, NFCVedant Kumar2019-07-112-14/+18
| | | | | | | | | Replace a `llvm::Function *` parameter with a bool, which seems harder to set to the wrong value by accident. Differential Revision: https://reviews.llvm.org/D64540 llvm-svn: 365809
* [Driver] -noprofilelib flagPetr Hosek2019-07-111-0/+3
| | | | | | | | | | This flag is analoguous to other flags like -nostdlib or -nolibc and could be used to disable linking of profile runtime library. This is useful in certain environments like kernel, where profile instrumentation is still desirable, but we cannot use the standard runtime library. llvm-svn: 365808
* [HIP] Add GPU arch gfx1010, gfx1011, and gfx1012Yaxun Liu2019-07-113-0/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D64364 llvm-svn: 365799
* [CodeGen] NVPTX: Switch from atomic.load.add.f32 to atomicrmw faddBenjamin Kramer2019-07-111-15/+3
| | | | llvm-svn: 365798
* Fix a few 'no newline at end of file' warnings that Xcode emitsNico Weber2019-07-111-1/+1
| | | | | | | (Xcode even has a snazzy "Fix" button, but clicking that inserts two newlines. So close!) llvm-svn: 365789
* [OPENMP]Initial fix PR42392: Improve -Wuninitialized warnings for OpenMP ↵Alexey Bataev2019-07-113-0/+67
| | | | | | | | | | | | | | | | | | | | | | | programs. Summary: Some OpenMP clauses rely on the values of the variables. If the variable is not initialized and used in OpenMP clauses that depend on the variables values, it should be reported that the uninitialized variable is used in the OpenMP clause expression. This patch adds initial processing for uninitialized variables in OpenMP constructs. Currently, it checks for use of the uninitialized variables in the structured blocks. Reviewers: NoQ, Szelethus, dcoughlin, xazax.hun, a.sidorin, george.karpenkov, szepet Subscribers: rnkovacs, guansong, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64356 llvm-svn: 365786
* Added mapping for pointers captured in Lambdas in OpenMP target regions,Alexey Bataev2019-07-111-9/+19
| | | | | | | | | | | | | | | | | | | by David Truby. Summary: This adds a zero length array section mapping for each pointer captured by a lambda that is used in a target region, as per section 2.19.7.1 of the OpenMP 5 specification. Reviewers: ABataev Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64558 llvm-svn: 365777
* [CGDebugInfo] Fix -femit-debug-entry-values crash on os_log_helpersVedant Kumar2019-07-111-3/+6
| | | | | | | | | | | | An os_log_helper FunctionDecl may not have a body. Ignore these for the purposes of debug entry value emission. Fixes an assertion failure seen in a stage2 build of clang: Assertion failed: (FD->hasBody() && "Functions must have body here"), function analyzeParametersModification llvm-svn: 365716
* NFC: Pass DataLayout into isBytewiseValueVitaly Buka2019-07-101-3/+5
| | | | | | | | | | | | | | | | | | Summary: We will need to handle IntToPtr which I will submit in a separate patch as it's not going to be NFC. Reviewers: eugenis, pcc Reviewed By: eugenis Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63940 llvm-svn: 365709
* NFC: Convert large lambda into methodVitaly Buka2019-07-102-79/+87
| | | | | | | | | | | | | | Reviewers: pcc, eugenis Reviewed By: eugenis Subscribers: cfe-commits, lldb-commits Tags: #clang, #lldb Differential Revision: https://reviews.llvm.org/D63854 llvm-svn: 365708
* driver: Don't warn about assembler flags being unused when not assemblingNico Weber2019-07-101-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang currently warns when passing flags for the assembler (e.g. -Wa,-mbig-obj) to an invocation that doesn't run the assembler (e.g. -E). At first sight, that makes sense -- the flag really is unused. But many other flags don't have an effect if no assembler runs (e.g. -fno-integrated-as, -ffunction-sections, and many others), and those currently don't warn. So this seems more like a side effect of how CollectArgsForIntegratedAssembler() is implemented than like an intentional feature. Since it's a bit inconvenient when debugging builds and adding -E, always call CollectArgsForIntegratedAssembler() to make sure assembler args always get claimed. Currently, this affects only these flags: -mincremental-linker-compatible, -mimplicit-it= (on ARM), -Wa, -Xassembler It does have the side effect that assembler options now need to be valid even if -E is passed. Previously, `-Wa,-mbig-obj` would error for non-coff output only if the assembler ran, now it always errors. This too makes assembler flags more consistent with all the other flags and seems like a progression. Fixes PR42066. Differential Revision: https://reviews.llvm.org/D64527 llvm-svn: 365703
* [clang-scan-deps] Dependency directives source minimizer:Alex Lorenz2019-07-101-1/+8
| | | | | | | | | | | | single quotes are not digit separators after a valid character literal prefix The single quote character can act as a c++ digit separator. However, the minimizer shouldn't treat it as such when it's actually following a valid character literal prefix, like L, U, u, or u8. Differential Revision: https://reviews.llvm.org/D64525 llvm-svn: 365700
* [Concepts] Concept definitions (D40381)Saar Raz2019-07-1018-10/+270
| | | | | | | First in a series of patches to land C++2a Concepts support. This patch adds AST and parsing support for concept-declarations. llvm-svn: 365699
* Update libc++ include path detection to use VFS on LinuxJulie Hockett2019-07-101-6/+7
| | | | | | | | | | The DetectLibcxxIncludePath function had been using llvm::sys::fs::directory_iterator, and this updates it to use llvm::vfs::directory_iterator. Differential Revision: https://reviews.llvm.org/D64381 llvm-svn: 365682
* [X86] Change the IR sequence for _mm_storeh_pi and _mm_storel_pi to perform ↵Craig Topper2019-07-102-18/+10
| | | | | | | | the store as a <2 x float> instead of i64. This is similar to what we do for loadl_pi and loadh_pi. llvm-svn: 365669
* [clang] Preserve names of addrspacecast'ed values.Vyacheslav Zakharin2019-07-101-1/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D63846 llvm-svn: 365666
OpenPOWER on IntegriCloud