]> granicus.if.org Git - clang/log
clang
11 years agoMicro-change: moved a brace for better readability
Alexander Kornienko [Thu, 31 Jan 2013 19:03:16 +0000 (19:03 +0000)]
Micro-change: moved a brace for better readability

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174075 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Thu, 31 Jan 2013 18:04:03 +0000 (18:04 +0000)]
Revert "[analyzer] Model trivial copy/move ctors with an aggregate bind."

It's causing hangs on our internal analyzer buildbot. Will restore after
investigating.

This reverts r173951 / baa7ca1142990e1ad6d4e9d2c73adb749ff50789.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174069 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/Index/skip-parsed-bodies/compile_commands.json: Mark it as XFAIL:mingw32...
NAKAMURA Takumi [Thu, 31 Jan 2013 16:01:13 +0000 (16:01 +0000)]
clang/test/Index/skip-parsed-bodies/compile_commands.json: Mark it as XFAIL:mingw32, for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174064 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoNever break inside something that was a preprocessor directive.
Manuel Klimek [Thu, 31 Jan 2013 15:58:48 +0000 (15:58 +0000)]
Never break inside something that was a preprocessor directive.

Just put it in one unwrapped line and let the formatter handle it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174063 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSeveral improvements to the formatting of static initializers.
Daniel Jasper [Thu, 31 Jan 2013 14:59:26 +0000 (14:59 +0000)]
Several improvements to the formatting of static initializers.

1. Never avoid bin packing in static initializers as this can
   lead to terrible results.
2. If an element has to be broken over multiple lines, break after
   the following comma.

This should be a step forward, but there are still many cases
especially with nested static initializers that we handle badly.
More patches will follow.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174061 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAttempt to fix Windows build breakage.
Evgeniy Stepanov [Thu, 31 Jan 2013 14:27:38 +0000 (14:27 +0000)]
Attempt to fix Windows build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174060 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove commonly useful code for AST testing into MatchVerfier.h.
Manuel Klimek [Thu, 31 Jan 2013 13:10:40 +0000 (13:10 +0000)]
Move commonly useful code for AST testing into MatchVerfier.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174057 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd support for AArch64 target.
Tim Northover [Thu, 31 Jan 2013 12:13:10 +0000 (12:13 +0000)]
Add support for AArch64 target.

In cooperation with the LLVM patch, this should implement all scalar front-end
parts of the C and C++ ABIs for AArch64.

This patch excludes the NEON support also reviewed due to an outbreak of
batshit insanity in our legal department. That will be committed soon bringing
the changes to precisely what has been approved.

Further reviews would be gratefully received.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174055 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r174043 and tweak the comment wording so I'm (hopefully) not confused by it...
Richard Smith [Thu, 31 Jan 2013 11:30:17 +0000 (11:30 +0000)]
Revert r174043 and tweak the comment wording so I'm (hopefully) not confused by it again!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174053 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded outer template parameter lists to friend type AST nodes.
Enea Zaffanella [Thu, 31 Jan 2013 09:54:08 +0000 (09:54 +0000)]
Added outer template parameter lists to friend type AST nodes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174050 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Run more optimizations after MemorySanitizer pass.
Evgeniy Stepanov [Thu, 31 Jan 2013 09:53:29 +0000 (09:53 +0000)]
[msan] Run more optimizations after MemorySanitizer pass.

MSan instrumentation is driven by the original code. We take every
incoming instruction and emit another instruction (or ten) next to
it, operating on the shadow values (but sometimes on the real values,
too). Two programs in one, essentially. There can be any kinds of
redundancies in the second one, so we just run whatever is normally
run at -O2, and then exclude some passes that do not help much with
benchmarks.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174049 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove incorrect warning signs from QualType::getUnqualifiedType(). These
Richard Smith [Thu, 31 Jan 2013 06:13:11 +0000 (06:13 +0000)]
Remove incorrect warning signs from QualType::getUnqualifiedType(). These
statements were only true for 65 CLs after they were introduced two years ago.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174043 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen we're emitting a constructor or destructor call from a delegating
Douglas Gregor [Thu, 31 Jan 2013 05:50:40 +0000 (05:50 +0000)]
When we're emitting a constructor or destructor call from a delegating
constructor, retrieve our VTT parameter directly. Fixes PR14588 /
<rdar://problem/12867962>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174042 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoImprove 'failed template argument deduction' diagnostic for the case where we
Richard Smith [Thu, 31 Jan 2013 05:19:49 +0000 (05:19 +0000)]
Improve 'failed template argument deduction' diagnostic for the case where we
have a direct mismatch between some component of the template and some
component of the argument. The diagnostic now says what the mismatch was, but
doesn't yet say which part of the template doesn't match.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174039 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen code completing in a statement, parenthesized expression, or
Douglas Gregor [Thu, 31 Jan 2013 05:03:46 +0000 (05:03 +0000)]
When code completing in a statement, parenthesized expression, or
Objective-C message receiver, the user is as likely to want to write a
type name as any other declaration, so give types the same priority as
other declarations. Fixes <rdar://problem/12480600>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174038 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow the computation of the base priority for a declaration code completion result...
Douglas Gregor [Thu, 31 Jan 2013 04:52:16 +0000 (04:52 +0000)]
Allow the computation of the base priority for a declaration code completion result to consider the completion context

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174037 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace "failed template argument deduction" diagnostic with something useful
Richard Smith [Thu, 31 Jan 2013 04:03:12 +0000 (04:03 +0000)]
Replace "failed template argument deduction" diagnostic with something useful
in the one case where we've already factored out a reason code.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174036 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove elements from Sema.UndefinedInternals as functions are defined. Also
Nick Lewycky [Thu, 31 Jan 2013 03:23:57 +0000 (03:23 +0000)]
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

11 years agoFix grammar in comment.
Nick Lewycky [Thu, 31 Jan 2013 03:15:20 +0000 (03:15 +0000)]
Fix grammar in comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174033 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoClarify the diagnostic for -Wnested-anon-types.
Richard Smith [Thu, 31 Jan 2013 03:11:12 +0000 (03:11 +0000)]
Clarify the diagnostic for -Wnested-anon-types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174032 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] If a lazy binding is undefined, pretend that it's unknown instead.
Jordan Rose [Thu, 31 Jan 2013 02:57:06 +0000 (02:57 +0000)]
[analyzer] If a lazy binding is undefined, pretend that it's unknown instead.

This is a hack to work around the fact that we don't track extents for our
default bindings:

  CGPoint p;
  p.x = 0.0;
  p.y = 0.0;
  rectParam.origin = p;
  use(rectParam.size); // warning: uninitialized value in rectParam.size.width

In this case, the default binding for 'p' gets copied into 'rectParam',
because the 'origin' field is at offset 0 within CGRect. From then on,
rectParam's old default binding (in this case a symbol) is lost.

This patch silences the warning by pretending that lazy bindings are never
made from uninitialized memory, but not only is that not true, the original
default binding is still getting overwritten (see FIXME test cases).
The long-term solution is tracked in <rdar://problem/12701038>

PR14765 and <rdar://problem/12875012>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174031 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen comparing two template template arguments in the template differ, consider
Richard Trieu [Thu, 31 Jan 2013 02:47:46 +0000 (02:47 +0000)]
When comparing two template template arguments in the template differ, consider
them the same if they are actually the same; having the same name isn't enough.

Similar to r174013, template template arguments were also mistakenly considered
the same when they had the same name but were in different namespaces.
In addition, when printing template template arguments, use the qualified name
if the regular name is the same.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174029 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix -Wcovered-switch-default and -Wunused-private-field warnings.
Richard Smith [Thu, 31 Jan 2013 02:04:38 +0000 (02:04 +0000)]
Fix -Wcovered-switch-default and -Wunused-private-field warnings.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174025 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd indents to AST dumping and removed parenthesis from AST nodes.
Richard Trieu [Thu, 31 Jan 2013 01:44:26 +0000 (01:44 +0000)]
Add indents to AST dumping and removed parenthesis from AST nodes.
Indents were given the color blue when outputting with color.
AST dumping now looks like this:

Node
|-Node
| `-Node
`-Node
  `-Node

Compared to the previous:

(Node
  (Node
    (Node))
  (Node
    (Node)))

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174022 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix ODR-use of a MemberExpr to check before marking a pure function used. Remove
Nick Lewycky [Thu, 31 Jan 2013 01:34:31 +0000 (01:34 +0000)]
Fix ODR-use of a MemberExpr to check before marking a pure function used. Remove
a workaround for this bug from the -Wundefined-internals warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174020 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Fix a bug in region store that lead to undefined value false
Anna Zaks [Thu, 31 Jan 2013 01:19:52 +0000 (01:19 +0000)]
[analyzer] Fix a bug in region store that lead to undefined value false
positives.

The includeSuffix was only set on the first iteration through the
function, resulting in invalid regions being produced by getLazyBinding
(ex: zoomRegion.y).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174016 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSometimes ld is just ld.
Matt Beaumont-Gay [Thu, 31 Jan 2013 01:15:55 +0000 (01:15 +0000)]
Sometimes ld is just ld.

Don't expect a character between the double-quotes and 'ld'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174015 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen comparing two templates in the template differ, consider them the
Douglas Gregor [Thu, 31 Jan 2013 01:08:35 +0000 (01:08 +0000)]
When comparing two templates in the template differ, consider them the
same if they are actually the same; having the same name isn't
enough. Fixes <rdar://problem/12931988>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174013 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake sure that the Attribute object represents one attribute only.
Bill Wendling [Thu, 31 Jan 2013 00:30:05 +0000 (00:30 +0000)]
Make sure that the Attribute object represents one attribute only.

Several places were still treating the Attribute object as respresenting
multiple attributes. Those places now use the AttributeSet to represent
multiple attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174004 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix unused variable warnings in -asserts build
Matt Beaumont-Gay [Thu, 31 Jan 2013 00:08:03 +0000 (00:08 +0000)]
Fix unused variable warnings in -asserts build

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173996 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReinstate r173952, this time limiting it to exactly the form
Douglas Gregor [Wed, 30 Jan 2013 23:10:17 +0000 (23:10 +0000)]
Reinstate r173952, this time limiting it to exactly the form

  #define X X

for which there is no point warning, ever.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173991 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDiagnostics: Clarify name of line-length-limiting constant in r173976.
Jordan Rose [Wed, 30 Jan 2013 22:14:15 +0000 (22:14 +0000)]
Diagnostics: Clarify name of line-length-limiting constant in r173976.

Thanks, Sean.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173981 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoChanged to static_cast, due to post-commit review.
Filipe Cabecinhas [Wed, 30 Jan 2013 22:03:24 +0000 (22:03 +0000)]
Changed to static_cast, due to post-commit review.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173980 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTableGen backends: use emitSourceFileHeader() to emit the warning about
Dmitri Gribenko [Wed, 30 Jan 2013 21:54:20 +0000 (21:54 +0000)]
TableGen backends: use emitSourceFileHeader() to emit the warning about
file contents being autogenerated

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173979 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCast to remove the narrowing conversion error in c++11.
Filipe Cabecinhas [Wed, 30 Jan 2013 21:50:21 +0000 (21:50 +0000)]
Cast to remove the narrowing conversion error in c++11.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173978 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDiagnostics: if a line is longer than 4096 characters, don't print it.
Jordan Rose [Wed, 30 Jan 2013 21:41:07 +0000 (21:41 +0000)]
Diagnostics: if a line is longer than 4096 characters, don't print it.

Specifically, don't print snippets, caret diagnostics, or ranges for
lines over 4096 characters. We copy the line around a few times in our
diagnostics machinery, and we have to print a caret line that's just as
long. This uses a lot of memory just to create a poor user experience as
we print out a line much too long for anyone to read...or spend extra
energy trying to fit it to -fmessage-length.

<rdar://problem/13106850>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173976 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert "[preprocessor] Don't warn about "disabled expansion of recursive macro""
Argyrios Kyrtzidis [Wed, 30 Jan 2013 20:42:17 +0000 (20:42 +0000)]
Revert "[preprocessor] Don't warn about "disabled expansion of recursive macro""

This reverts commit r173952

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173970 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHandle passing non-Qualtypes to %diff better. Instead of asserting, fall back
Richard Trieu [Wed, 30 Jan 2013 20:04:31 +0000 (20:04 +0000)]
Handle passing non-Qualtypes to %diff better.  Instead of asserting, fall back
to printing the default case.  This is a fix for PR15023.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173965 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd OpenCL error that a kernel function must have void return type. Includes a test...
Tanya Lattner [Wed, 30 Jan 2013 19:48:52 +0000 (19:48 +0000)]
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

11 years agoFix comment in test/Lexer/utf8-invalid.c for updates in r173959.
Jordan Rose [Wed, 30 Jan 2013 19:29:14 +0000 (19:29 +0000)]
Fix comment in test/Lexer/utf8-invalid.c for updates in r173959.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173961 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix r173881 to properly skip invalid UTF-8 characters in raw lexing and -E.
Jordan Rose [Wed, 30 Jan 2013 19:21:12 +0000 (19:21 +0000)]
Fix r173881 to properly skip invalid UTF-8 characters in raw lexing and -E.

This caused hangs as we processed the same invalid byte over and over.

<rdar://problem/13115651>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173959 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Make shallow mode more shallow.
Anna Zaks [Wed, 30 Jan 2013 19:12:39 +0000 (19:12 +0000)]
[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

11 years ago[analyzer] Use analyzer config for max-inlinable-size option.
Anna Zaks [Wed, 30 Jan 2013 19:12:36 +0000 (19:12 +0000)]
[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

11 years ago[analyzer] Move report false positive suppression to report visitors.
Anna Zaks [Wed, 30 Jan 2013 19:12:34 +0000 (19:12 +0000)]
[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

11 years ago[analyzer] Remove further references to analyzer-ipa.
Anna Zaks [Wed, 30 Jan 2013 19:12:26 +0000 (19:12 +0000)]
[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

11 years agoscan-build: When using Xcode 4.6, use build settings for doing proper build interposi...
Ted Kremenek [Wed, 30 Jan 2013 19:10:24 +0000 (19:10 +0000)]
scan-build: When using Xcode 4.6, use build settings for doing proper build interposition.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173954 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoHoist retrieval of Expr* into caller. No functionality change.
Ted Kremenek [Wed, 30 Jan 2013 19:10:21 +0000 (19:10 +0000)]
Hoist retrieval of Expr* into caller.  No functionality change.

Just makes the code a little cleaner, and easier to reason about.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173953 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[preprocessor] Don't warn about "disabled expansion of recursive macro"
Argyrios Kyrtzidis [Wed, 30 Jan 2013 18:55:52 +0000 (18:55 +0000)]
[preprocessor] Don't warn about "disabled expansion of recursive macro"
for "#define X X".

This is a pattern that, for example, stdbool.h uses.
rdar://12435773

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173952 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[analyzer] Model trivial copy/move ctors with an aggregate bind.
Jordan Rose [Wed, 30 Jan 2013 18:16:06 +0000 (18:16 +0000)]
[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

11 years agoDocumentation: fix escaping in JSON example
Dmitri Gribenko [Wed, 30 Jan 2013 17:58:39 +0000 (17:58 +0000)]
Documentation: fix escaping in JSON example

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173950 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocumentation: add a link to Bear, a tool to help with JSON DB
Dmitri Gribenko [Wed, 30 Jan 2013 17:58:14 +0000 (17:58 +0000)]
Documentation: add a link to Bear, a tool to help with JSON DB

Patch by Laszlo Nagy

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173949 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocumentation: fix link to ExecuteAction(), which was previously typoed as
James Dennett [Wed, 30 Jan 2013 17:53:07 +0000 (17:53 +0000)]
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

11 years agoComment parsing: fold named character references test into other HTML tests
Dmitri Gribenko [Wed, 30 Jan 2013 14:44:47 +0000 (14:44 +0000)]
Comment parsing: fold named character references test into other HTML tests

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173934 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoComment parsing: resolve more named character references
Dmitri Gribenko [Wed, 30 Jan 2013 14:29:28 +0000 (14:29 +0000)]
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

11 years agoRevert unintended change
Dmitri Gribenko [Wed, 30 Jan 2013 12:40:40 +0000 (12:40 +0000)]
Revert unintended change

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173927 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoIndex/special-html-characters.m: mark this as XFAIL for valgrind
Dmitri Gribenko [Wed, 30 Jan 2013 12:17:33 +0000 (12:17 +0000)]
Index/special-html-characters.m: mark this as XFAIL for valgrind

Fix is being discussed on cfe-dev.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173925 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove UTF conversion routines from clang/lib/Basic to llvm/lib/Support
Dmitri Gribenko [Wed, 30 Jan 2013 12:06:08 +0000 (12:06 +0000)]
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

11 years agoAlso promote fp16 types to double when they're anonymous variadic arguments.
Tim Northover [Wed, 30 Jan 2013 09:46:55 +0000 (09:46 +0000)]
Also promote fp16 types to double when they're anonymous variadic arguments.

__fp16 isn't covered by the standard, but this resolves the oddity that float
gets promoted when passed variadically, but not the smaller type. This is
required by the AArch64 ABI, and a sane action elsewhere.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173918 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDon't generate no-op replacements.
Daniel Jasper [Wed, 30 Jan 2013 09:46:12 +0000 (09:46 +0000)]
Don't generate no-op replacements.

No functional changes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173916 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd "instancetype" as a code completion result for the return type of
Douglas Gregor [Wed, 30 Jan 2013 07:11:43 +0000 (07:11 +0000)]
Add "instancetype" as a code completion result for the return type of
an Objective-C method. Fixes <rdar://problem/13069990>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173905 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThe instance methods of the root class of an Objective-C hieararchy
Douglas Gregor [Wed, 30 Jan 2013 06:58:39 +0000 (06:58 +0000)]
The instance methods of the root class of an Objective-C hieararchy
can be messaged via the metaclass. Provide code completions for this
case. Fixes <rdar://problem/12560296>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173903 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoC11: Provide the missing half of <stdalign.h>
Richard Smith [Wed, 30 Jan 2013 06:33:54 +0000 (06:33 +0000)]
C11: Provide the missing half of <stdalign.h>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173900 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix test failure from previous change.
Richard Smith [Wed, 30 Jan 2013 06:27:44 +0000 (06:27 +0000)]
Fix test failure from previous change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173899 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSemantic analysis and CodeGen support for C11's _Noreturn. This is modeled as
Richard Smith [Wed, 30 Jan 2013 05:45:05 +0000 (05:45 +0000)]
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

11 years agoDon't warn on fall-through from unreachable code.
Alexander Kornienko [Wed, 30 Jan 2013 03:49:44 +0000 (03:49 +0000)]
Don't warn on fall-through from unreachable code.

Summary:
A motivating example:
class ClassWithDtor {
public:
  ~ClassWithDtor() {}
};
void fallthrough3(int n) {
  switch (n) {
    case 2:
      do {
        ClassWithDtor temp;
        return;
      } while (0);  // This generates a chain of unreachable CFG blocks.
    case 3:
      break;
  }
}

Reviewers: rsmith, doug.gregor, alexfh

Reviewed By: alexfh

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D330

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173889 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUnresolved lookups can have using declarations that refer to
Douglas Gregor [Wed, 30 Jan 2013 02:10:08 +0000 (02:10 +0000)]
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

11 years agoDon't warn about Unicode characters in -E mode.
Jordan Rose [Wed, 30 Jan 2013 01:52:57 +0000 (01:52 +0000)]
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

11 years ago[Sema] Constrain test added in r173873 with expected-error-re
David Blaikie [Wed, 30 Jan 2013 01:43:36 +0000 (01:43 +0000)]
[Sema] Constrain test added in r173873 with expected-error-re

Suggested in post-commit review by Richard Smith.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173880 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoProvide a fixit for constexpr non-static data members.
David Blaikie [Wed, 30 Jan 2013 01:22:18 +0000 (01:22 +0000)]
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

11 years agoc: When checking on validity of sizeof passed as size of
Fariborz Jahanian [Wed, 30 Jan 2013 01:12:44 +0000 (01:12 +0000)]
c: When checking on validity of sizeof passed as size of
argument to be memset, check for its type to be complete
before calling Context.getTypeSize(PointeeTy) to prevent
crash. // rdar://13081751.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173872 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.
Daniel Dunbar [Wed, 30 Jan 2013 01:06:03 +0000 (01:06 +0000)]
[Frontend] Factor AddUnmappedPath() out of AddPath() and simplify.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173871 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Remove HeaderSearchOptions::Entry::IsInternal, which is unused.
Daniel Dunbar [Wed, 30 Jan 2013 00:34:26 +0000 (00:34 +0000)]
[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

11 years agoclang/test/Driver/asan-ld.c: Try not to mismatch temporary file, like "tmpkcfdld".
NAKAMURA Takumi [Wed, 30 Jan 2013 00:21:41 +0000 (00:21 +0000)]
clang/test/Driver/asan-ld.c: Try not to mismatch temporary file, like "tmpkcfdld".

If we had the regular expression "\b" in FileCheck like Perl...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173861 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Remove actual ImplicitExternC member variable.
Daniel Dunbar [Wed, 30 Jan 2013 00:20:43 +0000 (00:20 +0000)]
[Frontend] Remove actual ImplicitExternC member variable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173860 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Add an ExternCSystem include entry group.
Daniel Dunbar [Wed, 30 Jan 2013 00:19:24 +0000 (00:19 +0000)]
[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

11 years agoRemoved couple of html named character references in
Fariborz Jahanian [Wed, 30 Jan 2013 00:10:09 +0000 (00:10 +0000)]
Removed couple of html named character references in
my last patch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173856 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Make the include dir group independent from the "use sysroot" bit.
Daniel Dunbar [Tue, 29 Jan 2013 23:59:45 +0000 (23:59 +0000)]
[Frontend] Make the include dir group independent from the "use sysroot" bit.

 - This slightly decouples the path handling, since before the group sometimes
   dominated the "use sysroot" bit, but it was still passed in via the API.

 - No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173855 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Rename a member variable to clarify its intent.
Daniel Dunbar [Tue, 29 Jan 2013 23:59:43 +0000 (23:59 +0000)]
[Frontend] Rename a member variable to clarify its intent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173854 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Frontend] Factor out helper function, for clarity.
Daniel Dunbar [Tue, 29 Jan 2013 23:59:37 +0000 (23:59 +0000)]
[Frontend] Factor out helper function, for clarity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173853 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,
Chad Rosier [Tue, 29 Jan 2013 23:57:10 +0000 (23:57 +0000)]
[driver] Clear the FailureResultFiles when initializing clang diagnostics. Also,
minor cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173852 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[Doc parsing] Patch to parse Doxygen-supported HTML character
Fariborz Jahanian [Tue, 29 Jan 2013 23:42:26 +0000 (23:42 +0000)]
[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

11 years ago[ubsan] Implement the -fcatch-undefined-behavior flag using a trapping
Chad Rosier [Tue, 29 Jan 2013 23:31:22 +0000 (23:31 +0000)]
[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

11 years agoclang/test/Index/getcursor-preamble.m: Formatting.
NAKAMURA Takumi [Tue, 29 Jan 2013 23:03:22 +0000 (23:03 +0000)]
clang/test/Index/getcursor-preamble.m: Formatting.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173844 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoclang/test/Index/getcursor-preamble.m: Tweak for win32. env(1) is required to change...
NAKAMURA Takumi [Tue, 29 Jan 2013 23:03:16 +0000 (23:03 +0000)]
clang/test/Index/getcursor-preamble.m: Tweak for win32. env(1) is required to change variables locally.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173843 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove -Wstatic-float-init fixit into a note & don't recover as if constexpr
David Blaikie [Tue, 29 Jan 2013 22:26:08 +0000 (22:26 +0000)]
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

11 years agoDon't fixit/recover from -Wstatic-float-init when it's not an error.
David Blaikie [Tue, 29 Jan 2013 21:40:37 +0000 (21:40 +0000)]
Don't fixit/recover from -Wstatic-float-init when it's not an error.

Fix to change r173414 that lead to Clang changing const to constexpr even under
-Wno-static-float-init.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173835 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove the token annotator into separate files.
Daniel Jasper [Tue, 29 Jan 2013 21:01:14 +0000 (21:01 +0000)]
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

11 years ago[Preprocessor] When checking if we can concatenate two tokens, check
Argyrios Kyrtzidis [Tue, 29 Jan 2013 20:28:24 +0000 (20:28 +0000)]
[Preprocessor] When checking if we can concatenate two tokens, check
if they were already concatenated in source using the spelling locations
even if they came from a macro expansion.

This fixes an issue where a GUID passed as macro argument ends up
malformed after preprocessing because we added spaces inside it.

rdar://13016645

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173826 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[driver] Refactor the driver so that a failing commands doesn't prevent
Chad Rosier [Tue, 29 Jan 2013 20:15:05 +0000 (20:15 +0000)]
[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

11 years agoImprove formatting of code with comments.
Daniel Jasper [Tue, 29 Jan 2013 19:41:55 +0000 (19:41 +0000)]
Improve formatting of code with comments.

Before:
aaaaaaa(aaaaaa( // comment
                aaaaaaa));
<big mess>

After:
aaaaaaa(aaaaaa( // comment
    aaaaaaaa));
function(/* parameter 1 */ aaaaaaa,
         /* parameter 2 */ aaaaaaa,
         /* parameter 3 */ aaaaaaa,
         /* parameter 4 */ aaaaaaa);

(the latter example was only wrong in the one-arg-per-line mode, e.g. in
Google style).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173821 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMark a struct definition in an objc container with the TopLevelDeclInObjCContainer...
Argyrios Kyrtzidis [Tue, 29 Jan 2013 18:00:54 +0000 (18:00 +0000)]
Mark a struct definition in an objc container with the TopLevelDeclInObjCContainer bit.

Fixes accurately getting a cursor inside an objc container containing a struct definition,
from a PCH/preamble file.

rdar://12584613

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173811 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow all parameters on next line for function calls in Chrome.
Daniel Jasper [Tue, 29 Jan 2013 16:03:49 +0000 (16:03 +0000)]
Allow all parameters on next line for function calls in Chrome.

The style guide only forbids this for function declarations. So,
now

someFunction(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

Is allowed in Chromium mode.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173806 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSplit ">>" in "A<B<C> >" in Chromium style.
Daniel Jasper [Tue, 29 Jan 2013 15:19:38 +0000 (15:19 +0000)]
Split ">>" in "A<B<C> >" in Chromium style.

It needs to be compatible with C++03.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173805 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix uninitialized error caused by r173801.
Daniel Jasper [Tue, 29 Jan 2013 15:15:59 +0000 (15:15 +0000)]
Fix uninitialized error caused by r173801.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173803 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a crash in OpenCL code by using the proper (RHS) bit-width.
Joey Gouly [Tue, 29 Jan 2013 15:09:40 +0000 (15:09 +0000)]
Fix a crash in OpenCL code by using the proper (RHS) bit-width.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173802 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCalculate the split penalty upfront.
Daniel Jasper [Tue, 29 Jan 2013 15:03:01 +0000 (15:03 +0000)]
Calculate the split penalty upfront.

This is
a) More efficient.
b) Important as we move forward with further metrics for penalty.

No functional changes intended.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173801 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix a comment and reformat clang-format with clang-format
Daniel Jasper [Tue, 29 Jan 2013 11:27:30 +0000 (11:27 +0000)]
Fix a comment and reformat clang-format with clang-format

Not all changes might be ideal, but IMO all are acceptable.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173793 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoInitial support for multiple variable declarations.
Daniel Jasper [Tue, 29 Jan 2013 11:21:01 +0000 (11:21 +0000)]
Initial support for multiple variable declarations.

Before:
  SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(),
      aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa();
After:
  SomeType aaaaaaaaaaaaaaaaa = aaaaaa->aaaaaaaaaaaaaaaaa(),
           aaaaaaaaaaa = aaaaaa->aaaaaaaaaaa();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173792 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a diagnostic for an OpenCL kernel with a pointer pointer argument.
Joey Gouly [Tue, 29 Jan 2013 10:54:06 +0000 (10:54 +0000)]
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

11 years agoTest update missed in r173789.
Richard Smith [Tue, 29 Jan 2013 10:18:33 +0000 (10:18 +0000)]
Test update missed in r173789.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173790 91177308-0d34-0410-b5e6-96231b3b80d8