Граф коммитов

13279 Коммитов

Автор SHA1 Сообщение Дата
Nick Lewycky 995e26b052 Remove elements from Sema.UndefinedInternals as functions are defined. Also
filter the elements before emitting them into a PCH. No user-visible
functionality change, except that PCH files may be smaller?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174034 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 03:23:57 +00:00
Richard Smith f2705196d8 Clarify the diagnostic for -Wnested-anon-types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174032 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 03:11:12 +00:00
Tanya Lattner 7564bcca9f Add OpenCL error that a kernel function must have void return type. Includes a test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173963 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 19:48:52 +00:00
Anna Zaks ac3a3e7a40 [analyzer] Make shallow mode more shallow.
Redefine the shallow mode to inline all functions for which we have a
definite definition (ipa=inlining). However, only inline functions that
are up to 4 basic blocks large and cut the max exploded nodes generated
per top level function in half.

This makes shallow faster and allows us to keep inlining small
functions. For example, we would keep inlining wrapper functions and
constructors/destructors.

With the new shallow, it takes 104s to analyze sqlite3, whereas
the deep mode is 658s and previous shallow is 209s.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173958 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 19:12:39 +00:00
Anna Zaks 6bbe1442a5 [analyzer] Use analyzer config for max-inlinable-size option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173957 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 19:12:36 +00:00
Anna Zaks 86ff12c8a8 [analyzer] Move report false positive suppression to report visitors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173956 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 19:12:34 +00:00
Anna Zaks ce32890df0 [analyzer] Remove further references to analyzer-ipa.
Thanks Jordan!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173955 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 19:12:26 +00:00
Jordan Rose baa7ca1142 [analyzer] Model trivial copy/move ctors with an aggregate bind.
This is faster for the analyzer to process than inlining the constructor
and performing a member-wise copy, and it also solves the problem of
warning when a partially-initialized POD struct is copied.

Before:
  CGPoint p;
  p.x = 0;
  CGPoint p2 = p; <-- assigned value is garbage or undefined

After:
  CGPoint p;
  p.x = 0;
  CGPoint p2 = p; // no-warning

This matches our behavior in C, where we don't see a field-by-field copy.

<rdar://problem/12305288>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173951 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 18:16:06 +00:00
James Dennett 19e448df80 Documentation: fix link to ExecuteAction(), which was previously typoed as
"ExecutionAction()".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173948 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 17:53:07 +00:00
Dmitri Gribenko 5bd1e5ba00 Comment parsing: resolve more named character references
This reimplements r173850 with a better approach:
(1) use a TableGen-generated matcher instead of doing a linear search;
(2) avoid allocations for new strings by converting code points to string
    iterals with TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173931 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 14:29:28 +00:00
Dmitri Gribenko cb5620c9b2 Move UTF conversion routines from clang/lib/Basic to llvm/lib/Support
This is required to use them in TableGen.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173924 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 12:06:08 +00:00
Richard Smith 7586a6e6b7 Semantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
an attribute for consistency with our other noreturn mechanisms.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173898 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 05:45:05 +00:00
Douglas Gregor e28f6abf58 Unresolved lookups can have using declarations that refer to
unresolved using declarations. Fixes PR14768 / <rdar://problem/13030296>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173883 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 02:10:08 +00:00
Jordan Rose 74c2498bb9 Don't warn about Unicode characters in -E mode.
People use the C preprocessor for things other than C files. Some of them
have Unicode characters. We shouldn't warn about Unicode characters
appearing outside of identifiers in this case.

There's not currently a way for the preprocessor to tell if it's in -E mode,
so I added a new flag, derived from the PreprocessorOutputOptions. This is
only used by the Unicode warnings for now, but could conceivably be used by
other warnings or even behavioral differences later.

<rdar://problem/13107323>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173881 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 01:52:57 +00:00
David Blaikie 1d87fbaeea Provide a fixit for constexpr non-static data members.
If the member has an initializer, assume it was probably intended to be static
and suggest/recover with that.

If the member doesn't have an initializer, assume it was probably intended to
be const instead of constexpr and suggest that.

(if the attempt to apply these changes fails, don't make any suggestion &
produce the same diagnostic experience as before. The only case where this can
come up that I know of is with a mutable constexpr with an initializer, since
mutable is incompatible with static (but it's already incompatible with
const anyway))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173873 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 01:22:18 +00:00
Daniel Dunbar 59fd63581d [Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173866 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 00:34:26 +00:00
Daniel Dunbar d09436c724 [Frontend] Remove actual ImplicitExternC member variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173860 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 00:20:43 +00:00
Daniel Dunbar ef84554239 [Frontend] Add an ExternCSystem include entry group.
- The only group where it makes sense for the "ExternC" bit is System, so this
   simplifies having to have the extra isCXXAware (or ImplicitExternC, depending
   on what code you talk to) bit caried around.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173859 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-30 00:19:24 +00:00
Fariborz Jahanian 658a115c8e [Doc parsing] Patch to parse Doxygen-supported HTML character
references to their UTIF-8 encoding. Reviewed offline by Doug.
// rdar://12392215


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173850 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 23:42:26 +00:00
Chad Rosier 78d85b1c58 [ubsan] Implement the -fcatch-undefined-behavior flag using a trapping
implementation; this is much more inline with the original implementation
(i.e., pre-ubsan) and does not require run-time library support.

The trapping implementation can be invoked using either '-fcatch-undefined-behavior'
or '-fsanitize=undefined-trap -fsanitize-undefined-trap-on-error', with the latter
being preferred.  Eventually, the -fcatch-undefined-behavior' flag will be removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173848 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 23:31:22 +00:00
David Blaikie a367e9de80 Move -Wstatic-float-init fixit into a note & don't recover as if constexpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173841 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 22:26:08 +00:00
Daniel Jasper 32d28ee606 Move the token annotator into separate files.
No functional changes. Also removed experimental-warning from all of
clang-format's files, as it is no longer accurate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173830 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 21:01:14 +00:00
Chad Rosier a16355c318 [driver] Refactor the driver so that a failing commands doesn't prevent
subsequent commands from being executed.

The diagnostics generation isn't designed for this use case, so add a note to
fix this in the very near future.  For now, just generated the diagnostics for
the first failing command.
Part of rdar://12984531

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173825 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 20:15:05 +00:00
Daniel Jasper f1579605ad Allow all parameters on next line for function calls in Chrome.
The style guide only forbids this for function declarations. So,
now

someFunction(
    aaaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaa, aaaaaaaaaaaa);

Is allowed in Chromium mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173806 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 16:03:49 +00:00
Joey Gouly 98f988dc1b Add a diagnostic for an OpenCL kernel with a pointer pointer argument.
Also refactor the surrounding code a little.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173791 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 10:54:06 +00:00
Richard Smith a0109e2844 Produce a diagnostic if alignas is applied to an expression. Neither C11 nor
C++11 allows that.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173789 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 10:18:18 +00:00
Richard Smith d03de6aaa3 Downgrade 'attribute ignored when parsing type' from error to warning, to match
the diagnostic's warn_ name. Switch some places (notably C++11 attributes)
which really wanted an error over to a different diagnostic. Finally, suppress
the diagnostic entirely for __ptr32, __ptr64 and __w64, to avoid producing
diagnostics in important system headers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173788 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 10:02:16 +00:00
Richard Smith 4cd81c5bf5 Implement C++11 [dcl.align]p1 and C11 6.7.5/2 rules for alignas and _Alignas.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173779 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 09:02:09 +00:00
Richard Smith 8f3aacc8c4 Propagate the spelling list index for an attribute across template instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173768 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 04:21:28 +00:00
Richard Smith 33f04a208a Treat alignas and _Alignas as keyword attributes. This allows us to
pretty-print them properly (modulo the more general badness in alignment
attribute printing).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173752 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 01:48:07 +00:00
Richard Smith cda7968b38 Actually remove the hack which was blocking the Borland-style attributes from
working, and add the missing attribute spellings. This brings _pascal,
_fastcall, _stdcall and _cdecl to life in -fborland-extensions mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173749 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 01:38:41 +00:00
Richard Smith 5cd532ca0b Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelled
as a keyword. Rationalize existing attributes to use it as appropriate, and to
not lie about some __declspec attributes being GNU attributes. In passing,
remove a gross hack which was discarding attributes which we could handle. This
results in us actually respecting the __pascal keyword again.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173746 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 01:24:26 +00:00
John McCall a438b2d277 Abstract the behavior of when to use base-class tail padding.
For fun, I added a comedy "actually obey the C++11 POD rules" option
which nobody is allowed to use.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173744 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-29 01:14:22 +00:00
Richard Smith 3a2b7a18a4 Finish semantic analysis for [[carries_dependency]] attribute.
This required plumbing through a new flag to determine whether a ParmVarDecl is
actually a parameter of a function declaration (as opposed to a function
typedef etc, where the attribute is prohibited). Weirdly, this attribute (just
like [[noreturn]]) cannot be applied to a function type, just to a function
declaration (and its parameters).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173726 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 22:42:45 +00:00
Douglas Gregor bde67cfdf0 Undo my re-wording of the "ARC forbids Objective-C objects in ..."
error. Jordan is right.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173713 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 20:13:44 +00:00
Douglas Gregor 4581d45405 Forbid the use of objects in unions in Objective-C++ ARC. Fixes
<rdar://problem/13098104>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173708 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 19:08:09 +00:00
Douglas Gregor 20c6f2eae5 Enable the global module index by default. Introduce the
-fno-modules-global-index -cc1 option to allow one to disable the
index for performance testing purposes, but with a 10% win in
-fsyntax-only time, there is no reason a user would do this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173707 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 18:38:02 +00:00
Douglas Gregor 894719bf99 ASTReader and profiling statistics indicate that implementing a method
pool in the global module index is not worthwhile. Update comments to
limit the scope of the global module index to identifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173705 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 18:29:39 +00:00
Douglas Gregor 95fb36ebdd Add some more ASTReader statistics for global method pool lookups.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173702 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 17:54:36 +00:00
Douglas Gregor 531b47c22e Back out r173689. It doesn't matter when we're building with Clang anyway.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173693 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 17:26:34 +00:00
Douglas Gregor d3cf5fba33 Eliminate memory allocation from most invocations of
ModuleManager::visit() by keeping a free list of the two data
structures used to store state (a preallocated stack and a visitation
number vector). Improves -fsyntax-only performance for my modules test
case by 2.8%. Modules has pulled ahead by almost 10% with the global
module index.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173692 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 16:46:33 +00:00
Daniel Jasper d75ff6496b Don't put a function's return type on its own line in Google style.
This would be against the style guide:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Declarations_and_Definitions#Function_Declarations_and_Definitions

Not sure what to do as a last resort if the function signature does not
fit onto a single line in Google style ..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173690 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 15:40:20 +00:00
Douglas Gregor b7551f71a4 Note that SrcMgr::SLocEntry's are POD-like, so SmallVector can do a
better job with them. Shaves off 0.7% of -fparse-only time for a
modules test case. Sure makes you wonder...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173689 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 15:39:10 +00:00
Alexey Samsonov 3e335c1181 Print warning instead of error if optional ASan features are enabled w/o specifying -fsanitize=address
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173670 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 07:20:44 +00:00
Richard Smith c5f7d6aed5 Add a -pedantic warning: an anonymous union within an anonymous union is not
permitted in standard C++, despite being silently accepted by many (all?) major
C++ implementations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173643 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-28 00:54:05 +00:00
Jordan Rose bfec916e5f PR15067: Don't assert when a UCN appears in a C90 file.
Unfortunately, we can't accept the UCN as an extension because we're
required to treat it as two tokens for preprocessing purposes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173622 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-27 20:12:04 +00:00
Enea Zaffanella 9677eb864f Added ASTContext methods getIntPtrType and getUIntPtrType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173581 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 17:08:37 +00:00
Dmitri Gribenko 7d9f07732b Constify getOptionalExplicitTemplateArgs()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173575 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 15:24:56 +00:00
Dmitri Gribenko d615f88e3c Constify some getters of DesignatedInitExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173574 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 15:15:52 +00:00
Richard Trieu db55c04cb3 Give a more informative error message when the dot or arrow operator is used
on a type.  Currently, it gives a generic "expected unqualified-id" error.
The new error message is "cannot use (dot|arrow) operator on a type".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173556 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-26 02:31:38 +00:00