summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Make LookupResult be copyable to avoid decomposing an existing one andKaelyn Takata2014-11-111-6/+6
| | | | | | initializing a new one every time a copy is needed. llvm-svn: 221724
* Explicitly exclude keywords from the member validator.Kaelyn Takata2014-11-111-10/+9
| | | | | | Also simply and remove dead code from MemberExprTypoRecovery. llvm-svn: 221723
* Fix some formatting prior to refactoring the code.Kaelyn Takata2014-11-111-21/+23
| | | | llvm-svn: 221722
* Introduce -fsanitize-coverage=N flagKostya Serebryany2014-11-113-0/+32
| | | | | | | | | | | | | | | | | | | Summary: This change makes the asan-coverge (formerly -mllvm -asan-coverge) accessible via a clang flag. Companion patch to LLVM is http://reviews.llvm.org/D6152 Test Plan: regression tests, chromium Reviewers: samsonov Reviewed By: samsonov Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6153 llvm-svn: 221719
* Bundle conditions checked by UBSan with sanitizer kinds they implement.Alexey Samsonov2014-11-116-77/+79
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This change makes CodeGenFunction::EmitCheck() take several conditions that needs to be checked (all of them need to be true), together with sanitizer kinds these checks are for. This would allow to split one call into UBSan runtime into several calls in case different sanitizer kinds would have different recoverability settings. Tests should be fixed accordingly, I'm working on it. Test Plan: regression test suite. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D6219 llvm-svn: 221716
* Revert r221702 until I address Richard Trieu'sFariborz Jahanian2014-11-112-16/+1
| | | | | | comments. llvm-svn: 221714
* Revert "IR: MDNode => Value: Update for LLVM API change in r221375"Duncan P. N. Exon Smith2014-11-111-1/+1
| | | | | | | | This reverts commit r221376. The API change was reverted in r221711. llvm-svn: 221712
* PR16091 continued: Debug Info for member functions with undeduced return types.David Blaikie2014-11-111-13/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | So DWARF5 specs out auto deduced return types as DW_TAG_unspecified_type with DW_AT_name "auto", and GCC implements this somewhat, but it presents a few problems to do this with Clang. GCC's implementation only applies to member functions where the auto return type isn't deduced immediately (ie: member functions of templates or member functions defined out of line). In the common case of an inline deduced return type function, GCC emits the DW_AT_type as the deduced return type. Currently GDB doesn't seem to behave too well with this debug info - it treats the return type as 'void', even though the definition of the function has the correctly deduced return type (I guess it sees the return type the declaration has, doesn't understand it, and assumes void). This means the function's ABI might be broken (non-trivial return types, etc), etc. Clang, on the other hand doesn't track this particular case of a deducable return type that is deduced immediately versus one that is deduced 'later'. So if we implement the DWARF5 representation, all deducible return type functions would get adverse GDB behavior (including deduced return type lambda functions, inline deduced return type functions, etc). Also, we can't just do this for auto types that are not deduced - because Clang marks even the declaration's return type as deduced (& provides the underlying type) once a definition is seen that allows the deduction. So we have to ignore even deduced types - but we can't do that for auto variables (because this representation only applies to function declarations - variables and function definitions need the real type so the function can be called, etc) so we'd need to add an extra flag to the type unwrapping/creation code to indicate when we want to see through deduced types and when we don't. It's also not as simple as just checking at the top level when building a function type (for one thing, we reuse the function type building for building function pointer types which might also have 'auto' in them - but be the type of a variable instead) because the auto might be arbitrarily deeply nested ("auto &", "auto (*)()", etc...) So, with all that said, let's do the simple thing that works in existing debuggers for now and treat these functions the same way we do function templates and implicit special members: omit them from the member list, since they can't be correctly called anyway (without knowing the return type the ABI isn't know and a function call could put the arguments in the wrong place) so they're not much use to the user. At some point in the future, when GDB understands the DWARF5 representation better it might be worth plumbing through the extra type builder handling to avoid looking through AutoType for some callers, etc... llvm-svn: 221704
* Patch to warn when logical evaluation of operand evalutes to a true value;Fariborz Jahanian2014-11-112-1/+16
| | | | | | | That this is a c-only patch. c++ already has this warning. This addresses rdar://18716393 llvm-svn: 221702
* clang-format: Preserve trailing-comma logic even with comments.Daniel Jasper2014-11-111-14/+15
| | | | | | | | | | | | | | | Before: vector<int> SomeVector = {// aaa 1, 2, }; After: vector<int> SomeVector = { // aaa 1, 2, }; llvm-svn: 221699
* First half of CWG1962: decltype(__func__) should not be a reference type,Richard Smith2014-11-111-0/+2
| | | | | | because __func__ is supposed to act like a local static variable. llvm-svn: 221698
* This patch fixes a crash after rebuilding call AST ofFariborz Jahanian2014-11-111-0/+33
| | | | | | | | | | | | | an __unknown_anytype(...). In this case, we rebuild the vararg function type specially to convert the call expression to something that IRGen can handle. However, FunctionDecl as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and results in crash when accessing its params later on. This patch fixes the crash by rebuilding the FunctionDecl to match its new resolved type. rdar://15297105. (patch reapplied after lldb issue was fixed in r221660). llvm-svn: 221691
* CGOpenMPRuntime.h: Fix a couple of \param(s) introduced in r221663. ↵NAKAMURA Takumi2014-11-111-2/+2
| | | | | | [-Wdocumentation] llvm-svn: 221676
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-1113-21/+363
| | | | | | | | | For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 llvm-svn: 221663
* Fix parsing of fold-expressions within a cast expression. We parse theRichard Smith2014-11-111-5/+11
| | | | | | | parenthesized expression a bit differently in this case, just in case the commas have special meaning. llvm-svn: 221661
* InstrProf: Remove an unnecessary helper function (NFC)Justin Bogner2014-11-111-26/+12
| | | | | | | VisitSubStmtRBraceState is really just Visit, as long as VisitCompoundStatement handles braces correctly. llvm-svn: 221659
* CGExpr.cpp: Suppress a warning. [-Wunused-variable]NAKAMURA Takumi2014-11-111-0/+2
| | | | llvm-svn: 221655
* [Sanitizer] Refactor sanitizer options in LangOptions.Alexey Samsonov2014-11-119-27/+42
| | | | | | | | | | | | | | | | | | Get rid of ugly SanitizerOptions class thrust into LangOptions: * Make SanitizeAddressFieldPadding a regular language option, and rely on default behavior to initialize/reset it. * Make SanitizerBlacklistFile a regular member LangOptions. * Introduce the helper class "SanitizerSet" to represent the set of enabled sanitizers and make it a member of LangOptions. It is exactly the entity we want to cache and modify in CodeGenFunction, for instance. We'd also be able to reuse SanitizerSet in CodeGenOptions for storing the set of recoverable sanitizers, and in the Driver to represent the set of sanitizers turned on/off by the commandline flags. No functionality change. llvm-svn: 221653
* Move CodeGenOptions constructor out-of-line and add missing headers. NFC.Alexey Samsonov2014-11-112-0/+25
| | | | llvm-svn: 221646
* Propagate SanitizerKind into CodeGenFunction::EmitCheck() call.Alexey Samsonov2014-11-106-48/+85
| | | | | | | | | | | | | | | | Make sure CodeGenFunction::EmitCheck() knows which sanitizer it emits check for. Make CheckRecoverableKind enum an implementation detail and move it away from header. Currently CheckRecoverableKind is determined by the type of sanitizer ("unreachable" and "return" are unrecoverable, "vptr" is always-recoverable, all the rest are recoverable). This will change in future if we allow to specify which sanitizers are recoverable, and which are not by -fsanitize-recover= flag. No functionality change. llvm-svn: 221635
* Validate user headers even if -fmodules-validate-once-per-build-sessionBen Langmuir2014-11-101-3/+2
| | | | | | | | is enabled. Unlike system headers, we want to be more careful about modifications to user headers, because it's still easy to edit a header while you're building. llvm-svn: 221634
* AArch64: set all processor features from -arch if nothing else presentTim Northover2014-11-101-0/+6
| | | | | | | | | | Darwin's "-arch arm64" option implies full Cyclone CPU, for both architectural and tuning purposes. So if neither of the explicit options have been given, forward that on to the proper invocation. rdar://problem/18906227 llvm-svn: 221631
* Improve diagnostics if _Noreturn is placed after a function declarator. ↵Richard Smith2014-11-101-1/+22
| | | | | | (This sometimes happens when a macro is used that expands to either the GNU noreturn attribute or _Noreturn.) llvm-svn: 221630
* Update fold-expression mangling to match cxx-abi-dev discussion.Richard Smith2014-11-101-5/+3
| | | | llvm-svn: 221623
* clang-format: Fix pointer formatting.Daniel Jasper2014-11-101-0/+1
| | | | | | | | | Before: void f(Bar* a = nullptr, Bar * b); After: void f(Bar* a = nullptr, Bar* b); llvm-svn: 221609
* clang-format: [Java] Never treat @interface as annotation.Nico Weber2014-11-102-1/+5
| | | | | | | | | '@' followed by any keyword can't be an annotation, but @interface is currently the only combination of '@' and a keyword that's allowed, so limit it to this case. `@interface Foo` without a leading `public` was misformatted prior to this patch. llvm-svn: 221607
* [Tooling] Restore current directory after processing each file.Alexander Kornienko2014-11-101-2/+17
| | | | | | | | | | | | | | | | | | Summary: If we actually change directory before processing a file, we need to restore it afterwards. This was broken in r216620. Added a comment for the changes in r216620. Reviewers: klimek Reviewed By: klimek Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D6162 llvm-svn: 221600
* Updated the wording for a diagnostic to be more grammatically correct, and ↵Aaron Ballman2014-11-082-2/+7
| | | | | | use a %select. Also ensure that nested namespace definitions are diagnosed properly. Both changes are motivated by post-commit feedback from r221580. llvm-svn: 221581
* [c++1z] Support for attributes on namespaces and enumerators.Aaron Ballman2014-11-082-9/+20
| | | | llvm-svn: 221580
* [c++1z] Support for u8 character literals.Richard Smith2014-11-087-9/+31
| | | | llvm-svn: 221576
* [c++1z] Implement nested-namespace-definitions.Richard Smith2014-11-081-19/+18
| | | | | | | | | | | | | This allows 'namespace A::B { ... }' as a shorthand for 'namespace A { namespace B { ... } }'. We already supported this correctly for error recovery; promote that support to a full implementation. This is not the right implementation: we do not maintain source fidelity because we desugar the nested namespace definition in the parser. This is tricky to avoid, since the definition genuinely does inject one named entity per level in the namespace name. llvm-svn: 221574
* [c++1z] N4295: fold-expressions.Richard Smith2014-11-0814-7/+405
| | | | | | | | | | | | | | | | This is a new form of expression of the form: (expr op ... op expr) where one of the exprs is a parameter pack. It expands into (expr1 op (expr2onwards op ... op expr)) (and likewise if the pack is on the right). The non-pack operand can be omitted; in that case, an empty pack gives a fallback value or an error, depending on the operator. llvm-svn: 221573
* Check module signature when the module has already been loadedBen Langmuir2014-11-081-7/+13
| | | | | | | | | | We may need to verify the signature on subsequent imports as well, just like we verify the size/modtime: @import A; @import B; // imports A @import C; // imports A llvm-svn: 221569
* Fix unintended fallthrough in ASTReaderBen Langmuir2014-11-081-0/+2
| | | | llvm-svn: 221567
* [Objective-C Sema]. Issue availability/deprecated warning when Fariborz Jahanian2014-11-071-1/+5
| | | | | | | there is a uinque method found when message is sent to receiver of 'id' type. // rdar://18848183 llvm-svn: 221562
* ARM ABI: simplify decisions on whether args can be expanded.Tim Northover2014-11-071-35/+21
| | | | | | | | | | | | Homogeneous aggregates on AAPCS_VFP ARM need to be passed *without* being flattened (e.g. [2 x float] rather than "float, float") for various weird ABI reasons. However, this isn't the case for anything else; further, we know at the ABIArgInfo::getDirect callsites whether this flattening is allowed. So, we can get more unified ARM code, with a simpler Clang, by just using that knowledge directly. llvm-svn: 221559
* Introduce a SanitizerKind enum to LangOptions.Alexey Samsonov2014-11-0718-237/+241
| | | | | | | | | | | | | Use the bitmask to store the set of enabled sanitizers instead of a bitfield. On the negative side, it makes syntax for querying the set of enabled sanitizers a bit more clunky. On the positive side, we will be able to use SanitizerKind to eventually implement the new semantics for -fsanitize-recover= flag, that would allow us to make some sanitizers recoverable, and some non-recoverable. No functionality change. llvm-svn: 221558
* Fix style.Michael J. Spencer2014-11-071-4/+3
| | | | llvm-svn: 221546
* Fix clash of gcc toolchains in hexagon driver regression tests.Samuel Antao2014-11-073-10/+15
| | | | | | If clang was configured with a custom gcc toolchain (either by using GCC_INSTALL_PREFIX in cmake or the equivalent configure command), the path to the custom gcc toolchain path takes precedence to the one specified by -ccc-install-dir. This causes several regression tests to fail as they will be using an unexpected path. Adding the switch --gcc-toolchain="" in each test command is not enough as the hexagon toolchain implementation in the driver is not evaluating this argument. This commit modifies the hexagon toolchain to take the --gcc-toolchain="" argument into account when deciding the toolchain path, similarly to what is already done for other targets toolchains. Additionally, the faulty regression tests are modified in order to --gcc-toolchain="" be passed to the commands. llvm-svn: 221535
* Revert r221404 which caused lldb to not displayFariborz Jahanian2014-11-071-33/+0
| | | | | | vararg expressions. llvm-svn: 221533
* CodeGen, Itanium: Properly dllimport RTTI dataDavid Majnemer2014-11-071-1/+10
| | | | | | | | | | We would blindly assume that RTTI data should have the same linkage as the vtable because we didn't think the RTTI data was external. This oversight stemmed because we didn't take dllimport into account. This fixes PR21512. llvm-svn: 221511
* Return a DIDescriptor from CGDebugInfo::getDeclarationOrDefinition...Frederic Riss2014-11-062-5/+5
| | | | | | | ... instead of a DIScope that might wrap something that's not actually a DIScope (eg. a DIGlobalVariable); llvm-svn: 221481
* Remove references to the cortex-a9-mp CPU.Charlie Turner2014-11-063-5/+4
| | | | | | | | | | This CPU definition is redundant. The Cortex-A9 is defined as supporting multiprocessing extensions. Remove references to this CPU. This CPU was recently removed from LLVM. See http://reviews.llvm.org/D6057 Change-Id: I62ae7cc656fcae54fbaefc4b6976e77e694a8678 llvm-svn: 221458
* Don't manually insert L prefixes.Rafael Espindola2014-11-061-180/+122
| | | | | | Simply marking the symbol private conveys the desire to hide them to LLVM. llvm-svn: 221451
* [X86] Slightly refactor default features for AMD bdver cpus (NFC). Also add ↵Andrea Di Biagio2014-11-061-12/+7
| | | | | | | | | | | | | | | | | | | missing checks to test for target features. This patch simplifies how default target features are set for AMD bdver2 and bdver1. In particular, method 'getDefaultFeatures' now implements a fallthrough from case 'CK_BDVER2' to case 'CK_BDVER1'. That is because 'bdver2' has the same features available in bdver1 plus BMI, FMA, F16C and TBM. This patch also adds missing checks for predefined macros in test predefined-arch-macros.c. In the case of BTVER2, the test now also checks for F16C, BMI and PCLMUL. In the case of BDVER3 and BDVER4, the test now also checks for the presence of FSGSBASE. Differential Revision: http://reviews.llvm.org/D6134 llvm-svn: 221449
* Fix for exception specification mismatch in explicit instantiation.Alexey Bataev2014-11-061-0/+23
| | | | | | | According to C++ standard if an exception-specification is specified in an explicit instantiation directive, it shall be compatible with the exception-specifications of other declarations of that function. This patch adds checks for this. Differential Revision: http://reviews.llvm.org/D5822 llvm-svn: 221448
* [X86] Use fallthroughs to reduce the number of calls to setFeatureEnabled ↵Craig Topper2014-11-061-98/+45
| | | | | | for different CPUs. llvm-svn: 221437
* Patch for small addition to availability attribute.Fariborz Jahanian2014-11-051-0/+13
| | | | | | | | | This is to accept "NA" in place of vesion number for availability attribute. Used on introduced=NA to mean unavailable and deprecated=NA to mean nothing (not deprecated). rdar://18804883 llvm-svn: 221417
* Thread Safety Analysis: move warnings on range-based for loops out of betaDeLesley Hutchins2014-11-051-11/+9
| | | | | | and into -Wthread-safety. llvm-svn: 221410
* This patch fixes a crash after rebuilding call AST ofFariborz Jahanian2014-11-051-0/+33
| | | | | | | | | | | | | an __unknown_anytype(...). In this case, we rebuild the vararg function type specially to convert the call expression to something that IRGen can handle. However, FunctionDecl as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and results in crash when accessing its params later on. This patch fixes the crash by rebuilding the FunctionDecl to match its new resolved type. rdar://15297105. John McCall, please review post-commit. llvm-svn: 221404
OpenPOWER on IntegriCloud