summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
* [CodeGen] Propagate dllexport to thunksShoaib Meenai2017-07-242-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under Windows Itanium, we need to export virtual and non-virtual thunks if the functions being thunked are exported. These thunks would previously inherit their dllexport attribute from the declaration, but r298330 changed declarations to not have dllexport attributes. We therefore need to add the dllexport attribute to the definition ourselves now. This is consistent with MinGW GCC's behavior. This redoes r306770 but limits the logic to Itanium. MicrosoftCXXABI's setThunkLinkage ensures that thunks aren't exported under that ABI, so I'm handling this in ItaniumCXXABI's setThunkLinkage for symmetry. We need to export these thunks because they can be referenced outside the library they're defined in. For example, if a child class without a key function inherits from a parent class with a key function, the parent's thunks will only be defined in the library with the key function, but the construction vtable for the parent in the child might be emitted outside the library (since the child doesn't have a key function), and it needs to reference the parent's thunks. We don't need to mark these thunks as imported since any references to them will occur in data, so the compiler can't generate the IAT load sequence anyway. Instead, we rely on the linker generating import thunks for the thunks. Differential Revision: https://reviews.llvm.org/D34972 llvm-svn: 308899
* AArch64 & ARM: move TargetInfo functions from .h to .cpp file. NFC.Tim Northover2017-07-244-1100/+1294
| | | | | | | Most of them are virtual anyway, and the few remaining ones can move to the .cpp for consistency. llvm-svn: 308898
* Work around an MSVC2017 update 3 codegen bug.Nico Weber2017-07-241-0/+15
| | | | | | | | | | | C2017 update 3 produces a clang that crashes when compiling clang. Disabling optimizations for StmtProfiler::VisitCXXOperatorCallExpr() makes the crash go away. Patch from Bruce Dawson <brucedawson@chromium.org>! https://reviews.llvm.org/D35757 llvm-svn: 308897
* [OPENMP] Fix the restrictions for in_reduction clause.Alexey Bataev2017-07-242-38/+61
| | | | | | | This patch allows to use in_reduction clause even if the innermost directive is not taskgroup. llvm-svn: 308883
* [clang-format] Fix comment levels between '} else {' and PPDirective.Krasimir Georgiev2017-07-244-11/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a regression exposed by r307795 and rL308725 in which the level of a comment line between '} else {' and a preprocessor directive is incorrectly set as the level of the '} else {' line. For example, this : ``` int f(int i) { if (i) { ++i; } else { // comment #ifdef A --i; #endif } } ``` was formatted as: ``` int f(int i) { if (i) { ++i; } else { // comment #ifdef A --i; #endif } } ``` Reviewers: djasper, klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D35794 llvm-svn: 308882
* [mips] Add support for -m(no-)extern-data.Simon Dardis2017-07-243-0/+32
| | | | | | | | | | | Add support for -m(no-)extern-data when using -mgpopt in the driver. It is enabled by default in the backend. Reviewers: atanasyan, slthakur Differential Revision: https://reviews.llvm.org/D35550 llvm-svn: 308879
* [X86][InlineAsm][Ms Compatibility]Prefer variable name over a register when ↵Coby Tayree2017-07-241-0/+12
| | | | | | | | | | | | | | | | | | | | | the two collides On MS-style, the following snippet: int eax; __asm mov eax, ebx should yield loading of ebx, into the location pointed by the variable eax This patch sees to it. Currently, a reg-to-reg move would have been invoked. llvm: D34739 Differential Revision: https://reviews.llvm.org/D34740 llvm-svn: 308867
* [Driver] Fuchsia defaults to -fno-math-errnoPetr Hosek2017-07-232-0/+3
| | | | | | | | Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D35747 llvm-svn: 308855
* Remove Driver::UseStdLib.Nico Weber2017-07-233-7/+2
| | | | | | | | | All but one place are checking options::OPT_nostdlib instead of looking at this field, so convert that one other place to doing that as well. No behavior change. llvm-svn: 308848
* [Modules] Rework r274270. Let Clang targets depend on intrinsics_gen.NAKAMURA Takumi2017-07-231-0/+7
| | | | | | | | | This gets rid of almost LLVM targets unconditionally depending on intrinsic_gen. Clang's modules still have weird dependencies and hard to remove intrinsics_gen in better way. Then, it'd be better to give whole clang targets depend on intrinsic_gen. llvm-svn: 308844
* clang/module.modulemap: Split out Clang_ToolingCore from Clang_Tooling.NAKAMURA Takumi2017-07-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | It cuts clangFormat's dependencies out of; Clang_Analysis Clang_C Clang_Diagnostics Clang_Driver Clang_Frontend Clang_Sema Clang_Serialization Clang_StaticAnalyzer_Core Clang_Tooling -> Clang_ToolingCore Now, the module Clang_Format depends on; Clang_AST Clang_Basic Clang_ToolingCore llvm-svn: 308832
* [Bash-autocompletion] Fixed typo and add '-' after -WnoYuka Takahashi2017-07-222-3/+3
| | | | | | | | Summary: -Wno-<warning> was autocompleted as -Wno<warning>, so fixed this typo. Differential Revision: https://reviews.llvm.org/D35762 llvm-svn: 308824
* [NFC, documentation] Prefer the term expansion instead of macro instantiation Faisal Vali2017-07-221-2/+2
| | | | | | | | | ... in the few remaining places where this was not corrected. llvm-svn: 308823
* [index] Set SymbolSubKind::Accessor[GS]etter on class methodsBen Langmuir2017-07-212-15/+21
| | | | | | | | | We have the same relation between class properties and getter/setters that we have for instance properties, so set the same symbol sub-kind. rdar://problem/32376404 llvm-svn: 308800
* Remove Bitrig: Clang ChangesErich Keane2017-07-2117-393/+3
| | | | | | | | Bitrig code has been merged back to OpenBSD, thus the OS has been abandoned. Differential Revision: https://reviews.llvm.org/D35708 llvm-svn: 308797
* Break up Targets.cpp into a header/impl pair per target type[NFCI]Erich Keane2017-07-2147-9599/+10925
| | | | | | | | | | | | | | | | Targets.cpp is getting unwieldy, and even minor changes cause the entire thing to cause recompilation for everyone. This patch bites the bullet and breaks it up into a number of files. I tended to keep function definitions in the class declaration unless it caused additional includes to be necessary. In those cases, I pulled it over into the .cpp file. Content is copy/paste for the most part, besides includes/format/etc. Differential Revision: https://reviews.llvm.org/D35701 llvm-svn: 308791
* Inline variable into assert to fix unused warning.Richard Trieu2017-07-211-4/+2
| | | | llvm-svn: 308783
* [Hexagon] Attempt to fix selfhost botsKrzysztof Parzyszek2017-07-211-1/+1
| | | | | | | The codegen testcase was checking for specific value names. Make it ignore the names instead as they are irrelevant. llvm-svn: 308782
* Fix tblgen errorRichard Trieu2017-07-211-0/+1
| | | | | | Add Heading string to attribute documentation. llvm-svn: 308777
* [OPENMP] Fix build problem, NFC.Alexey Bataev2017-07-211-5/+3
| | | | llvm-svn: 308773
* [OPENMP] Add ast-print tests for in_reduction clause, NFC.Alexey Bataev2017-07-212-8/+16
| | | | llvm-svn: 308771
* Complex Long Double classification In RegCall calling conventionErich Keane2017-07-212-15/+38
| | | | | | | | | | | | | This change is part of the RegCall calling convention support for LLVM. Existing RegCall implementation was extended to include correct handling of Complex Long Double type. Complex long double types should be returned/passed in memory and not register stack. This patch implements this behavior. Patch by: eandrews Differential Revision: https://reviews.llvm.org/D35259 llvm-svn: 308769
* [OPENMP] Initial support for 'in_reduction' clause.Alexey Bataev2017-07-2120-22/+1775
| | | | | | | Parsing/sema analysis for 'in_reduction' clause for task-based directives. llvm-svn: 308768
* [Hexagon] Add inline-asm constraint 'a' for modifier register classKrzysztof Parzyszek2017-07-212-0/+9
| | | | | | | For example asm ("memw(%0++%1) = %2" : : "r"(addr),"a"(mod),"r"(val) : "memory") llvm-svn: 308763
* [OPENMP] Simplify analysis of data-sharing attributes.Alexey Bataev2017-07-214-94/+53
| | | | llvm-svn: 308759
* Test commitAndrey Kasaurov2017-07-211-1/+1
| | | | llvm-svn: 308744
* Test commitNikolay Haustov2017-07-211-1/+1
| | | | llvm-svn: 308741
* [clang-diff] Get rid of unused variable warnings in ASTDiff.cppAlex Lorenz2017-07-211-6/+4
| | | | llvm-svn: 308737
* Clang's tests should depend on clang-diffAlex Lorenz2017-07-211-0/+1
| | | | llvm-svn: 308735
* Fix another compiler error from r308731Alex Lorenz2017-07-211-1/+1
| | | | | | | std::pair in emplace back couldn't be constructed because SNodeId has an explicit constructor. Not sure how this even compiled on my machine before. llvm-svn: 308734
* Fix tuple construction compiler error from r308731Alex Lorenz2017-07-211-1/+1
| | | | llvm-svn: 308733
* [clang-diff] Add initial implementationAlex Lorenz2017-07-219-0/+1426
| | | | | | | | | | | | | | This is the first commit for the "Clang-based C/C++ diff tool" GSoC project. ASTDiff is a new library that computes a structural AST diff between two ASTs using the gumtree algorithm. Clang-diff is a new Clang tool that will show the structural code changes between different ASTs. Patch by Johannes Altmanninger! Differential Revision: https://reviews.llvm.org/D34329 llvm-svn: 308731
* [clang-format] Fix comment levels between '}' and PPDirectiveKrasimir Georgiev2017-07-212-1/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes a regression exposed by r307795 in which the level of a comment line between '}' and a preprocessor directive is incorrectly set as the level of the line before the '}'. In effect, this: ``` int f(int i) { int j = i; return i + j; } // comment #ifdef A #endif ``` was formatted as: ``` int f(int i) { int j = i; return i + j; } // comment #ifdef A #endif ``` Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D35485 llvm-svn: 308725
* Fixed failing assert in code completion.Ilya Biryukov2017-07-212-4/+14
| | | | | | | | | | | | | | | | Summary: The code was accessing uninstantiated default argument. This resulted in failing assertion at ParmVarDecl::getDefaultArg(). Reviewers: erikjv, klimek, bkramer, krasimir Reviewed By: krasimir Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D35682 llvm-svn: 308722
* [mips] Add `short_call` to the set of `long_call/far/near` attributesSimon Atanasyan2017-07-214-9/+20
| | | | | | | | MIPS gcc supports `long_call/far/near` attributes only, but other targets have the `short_call` attribut, so let's support it for MIPS for consistency. llvm-svn: 308719
* Fix tblgen error.Richard Trieu2017-07-212-3/+24
| | | | | | | | tblgen couldn't determing a unique name between "long_call" and "far", so it errored out when generating documentation. Copy the documentation, and give an explicit header for "long_call". llvm-svn: 308714
* [Driver] Consider -fno-sanitize=... state when filtering out ↵Petr Hosek2017-07-212-1/+13
| | | | | | | | | | | | | | | | -fsanitize-coverage=... The driver ignores -fsanitize-coverage=... flags when also given -fsanitize=... flags for sanitizer flavors that don't support the coverage runtime. This logic failed to account for subsequent -fno-sanitize=... flags that disable the sanitizer flavors that conflict with -fsanitize-coverage=... flags. Patch by Roland McGrath Differential Revision: https://reviews.llvm.org/D35603 llvm-svn: 308707
* [CMake] Use ABI version 2 for C++ library in FuchsiaPetr Hosek2017-07-211-0/+1
| | | | | | | | | Fuchsia has always been using ABI version 2 but I forgot this option when setting up the cache file for runtimes build. Differential Revision: https://reviews.llvm.org/D35705 llvm-svn: 308705
* [clang-format] Put '/**' and '*/' on own lines in multiline jsdocsKrasimir Georgiev2017-07-205-3/+205
| | | | | | | | | | | | Reviewers: mprobst Reviewed By: mprobst Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D35683 llvm-svn: 308684
* [mips] Add support for -m(no-)local-sdataSimon Dardis2017-07-203-0/+32
| | | | | | | | | | | Teach the driver to support -mlocal-sdata. The backend already matches GCC's default behaviour. Reviewers: atanasyan, slthakur Differential Revision: https://reviews.llvm.org/D35549 llvm-svn: 308683
* [NVPTX] Add lowering of i128 params.Artem Belevich2017-07-202-4/+4
| | | | | | | | | | | | | | | | | The patch adds support of i128 params lowering. The changes are quite trivial to support i128 as a "special case" of integer type. With this patch, we lower i128 params the same way as aggregates of size 16 bytes: .param .b8 _ [16]. Currently, NVPTX can't deal with the 128 bit integers: * in some cases because of failed assertions like ValVTs.size() == OutVals.size() && "Bad return value decomposition" * in other cases emitting PTX with .i128 or .u128 types (which are not valid [1]) [1] http://docs.nvidia.com/cuda/parallel-thread-execution/index.html#fundamental-types Differential Revision: https://reviews.llvm.org/D34555 Patch by: Denys Zariaiev (denys.zariaiev@gmail.com) llvm-svn: 308675
* [CodeGen][mips] Support `long_call/far/near` attributesSimon Atanasyan2017-07-2010-45/+176
| | | | | | | | | | | This patch adds support for the `long_call`, `far`, and `near` attributes for MIPS targets. The `long_call` and `far` attributes are synonyms. All these attributes override `-mlong-calls` / `-mno-long-calls` command line options for particular function. Differential revision: https://reviews.llvm.org/D35479 llvm-svn: 308667
* [clang] Fix handling of "%zd" in scanfAlexander Shaposhnikov2017-07-203-9/+40
| | | | | | | | | | | | | This diff addresses FIXMEs in lib/Analysis/ScanfFormatString.cpp for the case of ssize_t format specifier and adds tests. In particular, this change enables Clang to emit a warning on incorrect using of "%zd"/"%zn". Test plan: make check-all Differential revision: https://reviews.llvm.org/D35652 llvm-svn: 308662
* [Docs] Regenerate the command line option reference.Craig Topper2017-07-201-6/+48
| | | | llvm-svn: 308641
* [OPENMP] Fix DSA processing for member declaration.Alexey Bataev2017-07-2054-139/+147
| | | | | | | | If the member declaration is captured in the OMPCapturedExprDecl, we may loose data-sharing attribute info for this declaration. Patch fixes this bug. llvm-svn: 308629
* Reland "[mips] Teach the driver to accept -m(no-)gpopt."Simon Dardis2017-07-206-0/+66
| | | | | | | | | | | | | | This patch teaches the driver to pass -mgpopt by default to the backend when it is supported, i.e. we are using -mno-abicalls. Reviewers: atanasyan, slthakur Differential Revision: https://reviews.llvm.org/D35548 This version fixes a logic error that generated warnings incorrectly and gets rid of spurious arguments to the backend when -mgpopt is not used. llvm-svn: 308619
* [vfs] Assert that the status is known in equivalent().Benjamin Kramer2017-07-201-0/+1
| | | | | | Otherwise we'd silently compare uninitialized data. llvm-svn: 308604
* clang/module.modulemap: Clang_Diagnostics: Activate "Sema/SemaDiagnostic.h".NAKAMURA Takumi2017-07-201-2/+1
| | | | | | It seems issues were resolved. llvm-svn: 308593
* Revert "[StaticAnalyzer] Completely unrolling specific loops with known ↵Peter Szecsi2017-07-2010-461/+4
| | | | | | | | | | bound option" Revert r308561 and r308558. Clang-ppc64be-linux seems to crash while running the test cases. llvm-svn: 308592
* clang/module.modulemap: Split out Clang_RewriteFrontend from Clang_Rewrite.NAKAMURA Takumi2017-07-201-1/+2
| | | | | FIXME: Both Rewrite(Core) and RewriteFrontend don't cover just under clang/Rewrite. There's no file, though. llvm-svn: 308587
OpenPOWER on IntegriCloud