summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* [-cxx-abi microsoft] Correctly identify Win32 entry pointsDavid Majnemer2013-09-164-26/+69
| | | | | | | | | | | | | | | | | | | Summary: This fixes several issues with the original implementation: - Win32 entry points cannot be in namespaces - A Win32 entry point cannot be a function template, diagnose if we it. - Win32 entry points cannot be overloaded. - Win32 entry points implicitly return, similar to main. Reviewers: rnk, rsmith, whunt, timurrrr Reviewed By: rnk CC: cfe-commits, nrieck Differential Revision: http://llvm-reviews.chandlerc.com/D1683 llvm-svn: 190818
* Move the uninitialized field check to after all the field initializers are addedRichard Trieu2013-09-161-17/+39
| | | | | | to the CXXConstructorDecl so that information from the constructor can be used. llvm-svn: 190810
* Emit an error when attempting to generate IR for SEH __tryReid Kleckner2013-09-163-1/+7
| | | | | | | Currently we silently omit the code in the try and finally bodies, which is pretty bad. This way we fail loudly. llvm-svn: 190809
* Add some missing ProhibitAttributes calls to some declaration-like #pragmas.Richard Smith2013-09-161-0/+2
| | | | llvm-svn: 190806
* Pass additional information around the uninitialized field visitor.Richard Trieu2013-09-161-7/+12
| | | | llvm-svn: 190805
* When in pre-c++11 mode, treat _T("xxx") as a single string literal, repeat ↵Alexander Kornienko2013-09-165-31/+100
| | | | | | | | | | | | | | the _T() part around each fragment. This addresses http://llvm.org/PR17122 Reviewers: djasper Reviewed By: djasper CC: cfe-commits, klimek, rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D1640 llvm-svn: 190804
* Updated the way the ownership attributes are semantically diagnosed. Added ↵Aaron Ballman2013-09-161-59/+43
| | | | | | test cases for the semantics checks. llvm-svn: 190802
* Add error checking to reject neon_vector_type attribute on targets without NEON.Amara Emerson2013-09-162-3/+7
| | | | | | Patch by Artyom Skrobov. llvm-svn: 190801
* New message for cases when ownership is taken:Anton Yartsev2013-09-161-10/+23
| | | | | | | | "+method_name: cannot take ownership of memory allocated by 'new'." instead of the old "Memory allocated by 'new' should be deallocated by 'delete', not +method_name" llvm-svn: 190800
* Add a define for the ObjFW runtime ABI version.Benjamin Kramer2013-09-163-3/+22
| | | | | | | | | This removes __has_feature(objc_msg_lookup_stret), as it is not required anymore after this patch. Patch by Jonathan Schleifer! llvm-svn: 190791
* Handle PredefinedExpr with templates and lambdasWei Pan2013-09-162-37/+24
| | | | | | | | | | | Summary: - lambdas, blocks or captured statements in templates were not handled which causes codegen crashes. Differential Revision: http://llvm-reviews.chandlerc.com/D1628 llvm-svn: 190784
* Make F16C feature imply AVX. Matches GCC behavior.Craig Topper2013-09-161-1/+4
| | | | llvm-svn: 190776
* Prune "return" after llvm_unreachable(). It was redundant.NAKAMURA Takumi2013-09-161-1/+0
| | | | llvm-svn: 190774
* Make __has_extension(c_thread_local) work.Ed Schouten2013-09-141-0/+1
| | | | | | | | | | | Unlike C++11's "thread_local" keyword, C11's "_Thread_local" is in the reserved namespace, meaning we provide it unconditionally; it is marked as KEYALL in TokenKinds.def. This means that like all the other C11 keywords, we can expose its presence through __has_extension(). llvm-svn: 190755
* Avoid getting an argument of allocation function if it does not exist.Serge Pavlov2013-09-141-11/+12
| | | | | | | | This is a fix to PR12778: in erroneous code an allocation function can be declared with no arguments, quering the first argument in this case causes assertion violation. llvm-svn: 190751
* clang-format: Fix bug in style option AlwaysBreakTemplateDeclarations.Daniel Jasper2013-09-141-0/+3
| | | | | | | | | | | | | | | Before: template <template <typename> class Fooooooo, template <typename> class Baaaaaaar> struct C {}; After: template <template <typename> class Fooooooo, template <typename> class Baaaaaaar> struct C {}; llvm-svn: 190747
* Parse: Template specializations which aren't dependent needn't have their ↵David Majnemer2013-09-141-4/+5
| | | | | | | | | | | | | | | | parsing be delayed Summary: We should treat a non-dependent template specialization like it wasn't templated at all. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1554 llvm-svn: 190743
* Clean up some Triple usage in clang.Cameron Esfahani2013-09-147-18/+16
| | | | llvm-svn: 190737
* Add support for -ggnu-pubnames matching the llvm support.Eric Christopher2013-09-131-0/+6
| | | | llvm-svn: 190729
* Lex and ignore Microsoft's #pragma warning(...)Reid Kleckner2013-09-132-1/+165
| | | | | | | | | | | | | | | | | Summary: This fixes PR17145 and avoids unknown pragma warnings. This change does not attempt to map MSVC warning numbers to clang warning flags. Perhaps in the future we will implement a mapping for some common subset of Microsoft warnings, but for now we don't. Reviewers: rsmith CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1652 llvm-svn: 190726
* Part three of PR15721: if we have an invalid CXXDefaultInitExpr, don't crash ifRichard Smith2013-09-131-2/+6
| | | | | | we try to constant-evaluate it. Patch by Karthik Bhat, test by me. llvm-svn: 190722
* vector_size cannot be applied to Booleans. Updated the semantic checking ↵Aaron Ballman2013-09-131-2/+3
| | | | | | logic, as well as the comment and added a test case. Fixes PR12649 llvm-svn: 190721
* Switching the WeakRef attribute to using the new checkStringLiteralArgument ↵Aaron Ballman2013-09-131-50/+41
| | | | | | helper function. llvm-svn: 190719
* Update Atom Silvermont (SLM) support by adding enabled features.Preston Gurd2013-09-131-5/+9
| | | | llvm-svn: 190718
* DebugInfo: omit debug info for friendsDavid Blaikie2013-09-132-23/+0
| | | | | | | | | GCC ToT doesn't do this & it's worth about 3.2% on Clang's DWO file size with Clang. Some or all of this may be due to things like r190715 which could have source fixes/improvements, but it's not clear that's the case and that doesn't help other source bases. llvm-svn: 190716
* Remove unnecessary inclusion of Sema.hDavid Blaikie2013-09-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let me tell you a tale... Within some twisted maze of debug info I've ended up implementing an insane man's Include What You Use device. When the debugger emits debug info it really shouldn't, I find out why & then realize the code could be improved too. In this instance CIndexDiagnostics.cpp had a lot more debug info with Clang than GCC. Upon inspection a major culprit was all the debug info describing clang::Sema. This was emitted because clang::Sema is befriended by DiagnosticEngine which was rightly required, but GCC doesn't emit debug info for friends so it never emitted anything for Clang. Clang does emit debug info for friends (will be fixed/changed to reduce debug info size). But why didn't Clang just emit a declaration of Sema if this entire TU didn't require a definition? 1) Diagnostic.h did the right thing, only using a declaration of Sema and not including Sema.h at all. 2) Some other dependency of CIndexDiagnostics.cpp didn't do the right thing. ASTUnit.h, only needing a declaration, still included Sema.h (hence this commit which removes that include and adds the necessary includes to the cpp files that were relying on this) 3) -flimit-debug-info didn't save us because of EnterExpressionEvaluationContext, defined inline in Sema.h which fires the "requiresCompleteType" check/flag (since it uses nested types from Sema and calls Sema member functions) and thus, if debug info is ever emitted for the type, the whole type is emitted and not just a declaration. Improving -flimit-debug-info to account for this would be... hard. Modifying the code so that's not 'required to be complete' might be possible, but probably only by moving EnterExpressionEvaluationContext either into Sema, or out of Sema.h. That might be a bit too much of a contortion to be bothered with. Also, this is only one of the cases where emitting debug info for friends caused us to emit a lot more debug info (this change reduces Clang's DWO size by 0.93%, dropping friends entirely reduces debug info by 3.2%) - I haven't hunted down the other cases, but I assume they might be similar (Sema or something like it). IWYU or a similar tool might help us reduce build times a bit, but analyzing debug info to find these differences isn't worthwhile. I'll take the 3.2% win, provide this small improvement to the code itself, and move on. llvm-svn: 190715
* Updated the PCS calling convention to use the new checkStringLiteralArgument ↵Aaron Ballman2013-09-132-12/+11
| | | | | | helper function. llvm-svn: 190710
* As Aaron pointed out it's simpler to reject wide string availability attr ↵Benjamin Kramer2013-09-132-10/+3
| | | | | | messages in the parser. llvm-svn: 190706
* ASTContext.cpp: Fix a warning in r190684. [-Wcovered-switch-default]NAKAMURA Takumi2013-09-131-1/+2
| | | | llvm-svn: 190705
* Moving Cortex-R cores to armv7r archRenato Golin2013-09-131-3/+1
| | | | llvm-svn: 190704
* Add more Cortex CPUs and testsRenato Golin2013-09-134-9/+14
| | | | llvm-svn: 190703
* Fix Neon detection for Cortex-A class, plus adds some more CPUs to default ↵Renato Golin2013-09-131-5/+8
| | | | | | features llvm-svn: 190702
* Guard availability and thread safety attributes against wide strings.Benjamin Kramer2013-09-131-4/+10
| | | | | | Found by inspection. llvm-svn: 190701
* Unify handling of string literal arguments for attributes and add fixits.Benjamin Kramer2013-09-131-71/+69
| | | | | | | | | | | | | | | | | | | | | | This fixes a couple of latent crashes for invalid attributes and also adds a fixit hint to turn identifiers into string literals if one was expected. It then proceeds recovery as if the identifier was a literal. Diagnostic locations are also changed to point at the literal instead of the attribute if the error concerns the argument. PR17175. For example: hidden.c:1:40: error: 'visibility' attribute requires a string extern int x __attribute__((visibility(hidden))); ^ " " hidden.c:2:29: error: visibility does not match previous declaration extern int x __attribute__((visibility("default"))); ^ hidden.c:1:29: note: previous attribute is here extern int x __attribute__((visibility(hidden))); ^ llvm-svn: 190699
* [ARMv8] Change the naming of some options to be more consistent.Joey Gouly2013-09-131-2/+2
| | | | | | Clang side changes for LLVM r190692. llvm-svn: 190693
* A buildbot compiling with strict error on unused variables pointed out aDavid Tweed2013-09-131-1/+0
| | | | | | historical remnant in r190684; remove it. llvm-svn: 190687
* Certain multi-platform languages, such as OpenCL, have the concept ofDavid Tweed2013-09-135-7/+66
| | | | | | | | | | | | | | address spaces which is both (1) a "semantic" concept and (2) possibly a hardware level restriction. It is desirable to be able to discard/merge the LLVM-level address spaces on arguments for which there is no difference to the current backend while keeping track of the semantic address spaces in a funciton prototype. To do this enable addition of the address space into the name-mangling process. Add some tests to document this behaviour against inadvertent changes. Patch by Michele Scandale! llvm-svn: 190684
* clang-format: Detect braced lists in subscript expressions.Daniel Jasper2013-09-131-1/+1
| | | | | | | | | | Before (even with Style.Cpp11BracedListStyle): f(MyMap[{ composite, key }]); After: f(MyMap[{composite, key}]); llvm-svn: 190678
* [-cxx-abi microsoft] Mangle user defined entry points properlyDavid Majnemer2013-09-131-2/+25
| | | | | | | | | | | | | | | | Summary: Functions named "main", "wmain", "WinMain", "wWinMain", and "DllMain" are never mangled regardless of linkage, even when compiling for kernel mode. Depends on D1655 Reviewers: timurrrr, pcc, rnk, whunt CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1670 llvm-svn: 190675
* clang-format: Fix incorrect enum parsing / layouting.Daniel Jasper2013-09-136-46/+36
| | | | | | | | | | | | | | | Before: enum { Bar = Foo < int, int > ::value }; After: enum { Bar = Foo<int, int>::value }; llvm-svn: 190674
* [-cxx-abi microsoft] Mangle declarations inside extern "C"David Majnemer2013-09-131-33/+76
| | | | | | | | | | | | | | | Summary: This is a first step to getting extern "C" working properly inside clang. There are a number of quirks but mangling declarations inside such a function are a good first step. Reviewers: timurrrr, pcc, cdavis5x CC: cfe-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1655 llvm-svn: 190671
* Refactor the uninitialized field visitor. Also moved the calls to the visitorRichard Trieu2013-09-131-54/+69
| | | | | | | later in the code so that the expressions will have addition processing first. This catches a few additional cases of uninitialized uses of class fields. llvm-svn: 190657
* Fix two incorrect comments.Jordan Rose2013-09-131-2/+2
| | | | | | Patch by Jared Grubb! llvm-svn: 190652
* [analyzer] Run post-stmt checks for DeclStmt.Jordan Rose2013-09-131-1/+4
| | | | | | | | | No tests because no in-tree checkers use this, but that shouldn't stop out-of-tree checkers. Found by Aemon Cannon! llvm-svn: 190650
* Restore the sqrt -> llvm.sqrt mapping in fast-math modeHal Finkel2013-09-121-6/+13
| | | | | | | | | | | | | | | This restores the sqrt -> llvm.sqrt mapping, but only in fast-math mode (specifically, when the UnsafeFPMath or NoNaNsFPMath CodeGen options are enabled). The @llvm.sqrt* intrinsics have slightly different semantics from the libm call, specifically, they are undefined when given a non-zero negative number (the libm calls will always return NaN for any negative number). This mapping was removed in r100613, and replaced with a TODO, but at that time the fast-math flags were not yet implemented. Now that we have these, restoring this mapping is important because it will enable autovectorization of sqrt calls in loops (at least in fast-math mode). llvm-svn: 190646
* PR13657 (and duplicates):Richard Smith2013-09-125-92/+602
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a comma occurs in a default argument or default initializer within a class, disambiguate whether it is part of the initializer or whether it ends the initializer. The way this works (which I will be proposing for standardization) is to treat the comma as ending the default argument or default initializer if the following token sequence matches the syntactic constraints of a parameter-declaration-clause or init-declarator-list (respectively). This is both consistent with the disambiguation rules elsewhere (where entities are treated as declarations if they can be), and should have no regressions over our old behavior. I think it might also disambiguate all cases correctly, but I don't have a proof of that. There is an annoyance here: because we're performing a tentative parse in a situation where we may not have seen declarations of all relevant entities (if the comma is part of the initializer, lookup may find entites declared later in the class), we need to turn off typo-correction and diagnostics during the tentative parse, and in the rare case that we decide the comma is part of the initializer, we need to revert all token annotations we performed while disambiguating. Any diagnostics that occur outside of the immediate context of the tentative parse (for instance, if we trigger the implicit instantiation of a class template) are *not* suppressed, mirroring the usual rules for a SFINAE context. llvm-svn: 190639
* Fix regression from r190427.Eli Friedman2013-09-121-1/+1
| | | | | | <rdar://problem/14970968> llvm-svn: 190635
* PR16054: Slight strengthening for -Wsometimes-uninitialized: if we use aRichard Smith2013-09-122-11/+59
| | | | | | | | | | | variable uninitialized every time we reach its (reachable) declaration, or every time we call the surrounding function, promote the warning from -Wmaybe-uninitialized to -Wsometimes-uninitialized. This is still slightly weaker than desired: we should, in general, warn if a use is uninitialized the first time it is evaluated. llvm-svn: 190623
* Move the execution code from Compilation::ExecuteCommand to Command::ExecuteHans Wennborg2013-09-122-11/+15
| | | | | | | | | | | | | | I think it makes sense that a Command knows how to execute itself. There's no functionality change but i rewrote the code to avoid the manual memory management of Argv. My motivation for this is that I plan to subclass Command to build fall-back functionality into clang-cl. Differential Revision: http://llvm-reviews.chandlerc.com/D1654 llvm-svn: 190621
* Move Compilation::PrintJob and PrintDiagnosticJob into Job::Print.Hans Wennborg2013-09-125-141/+106
| | | | | | | | | | | | | | | | | This moves the code to Job.cpp, which seems like a more natural fit, and replaces the "is this a JobList? is this a Command?" logic with a virtual function call. It also removes the code duplication between PrintJob and PrintDiagnosticJob and simplifies the code a little. There's no functionality change here, except that the Executable is now always printed within quotes, whereas it would previously not be quoted in crash reports, which I think was a bug. Differential Revision: http://llvm-reviews.chandlerc.com/D1653 llvm-svn: 190620
OpenPOWER on IntegriCloud