]> granicus.if.org Git - clang/log
clang
11 years agoFix the fvectorize testcase
Nadav Rotem [Tue, 18 Dec 2012 23:08:58 +0000 (23:08 +0000)]
Fix the fvectorize testcase

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

11 years agoHave clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing...
Ted Kremenek [Tue, 18 Dec 2012 23:07:30 +0000 (23:07 +0000)]
Have clang_getSpellingLocation() use the same logic as DiagnosticRenderer for plowing through macros.

This fixes a subtle bug reported in <rdar://problem/12584554> where a double-nested
macro could lead to an incorrect fixit location with live issues.

This fix also uncovers a bunch of subtle bugs in our indexer test cases which
are now fixed (mostly around source ranges for attributes).

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

11 years agoThis is the libclang patch providing minimal API to
Fariborz Jahanian [Tue, 18 Dec 2012 23:02:59 +0000 (23:02 +0000)]
This is the libclang patch providing minimal API to
use clang's formatter. Currently, formatter is used
to format declaration tags for xml comments. Since formatter
is in flux and its change will break several of the clang comment
tests, only a single tests is formatted using this facility.
Doug has reviewed and approved it for check-in.

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

11 years agoBe defensive when printing module import locations; the diagnostic printer needs...
Douglas Gregor [Tue, 18 Dec 2012 23:02:07 +0000 (23:02 +0000)]
Be defensive when printing module import locations; the diagnostic printer needs to be robust

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

11 years agoSimilar to 170440 - fix build warning with gcc
Eli Bendersky [Tue, 18 Dec 2012 22:22:16 +0000 (22:22 +0000)]
Similar to 170440 - fix build warning with gcc

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

11 years agoAdd tests to check recent changes to some builtins.
Bill Wendling [Tue, 18 Dec 2012 21:09:25 +0000 (21:09 +0000)]
Add tests to check recent changes to some builtins.

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

11 years agoBetter support for constructor initializers.
Daniel Jasper [Tue, 18 Dec 2012 21:05:13 +0000 (21:05 +0000)]
Better support for constructor initializers.

We used to format initializers like this (with a sort of hacky implementation):
Constructor()
    : Val1(A),
      Val2(B) {

and now format like this (with a somewhat better solution):
Constructor()
    : Val1(A), Val2(B) {

assuming this would not fit on a single line. Also added tests.

As a side effect we now first analyze whether an UnwrappedLine needs to be
split at all. If not, not splitting it is the best solution by definition. As
this should be a very common case in normal code, not exploring the entire
solution space can provide significant speedup.

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

11 years agoCodeGen: Expand creal and cimag into complex field loads
Meador Inge [Tue, 18 Dec 2012 20:58:04 +0000 (20:58 +0000)]
CodeGen: Expand creal and cimag into complex field loads

PR 14529 was opened because neither Clang or LLVM was expanding
calls to creal* or cimag* into instructions that just load the
respective complex field.  After some discussion, it was not
considered realistic to do this in LLVM because of the platform
specific way complex types are expanded.  Thus a way to solve
this in Clang was pursued.  GCC does a similar expansion.

This patch adds the feature to Clang by making the creal* and
cimag* functions library builtins and modifying the builtin code
generator to look for the new builtin types.

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

11 years agoMake the format scrambler understand line comments.
Daniel Jasper [Tue, 18 Dec 2012 19:56:56 +0000 (19:56 +0000)]
Make the format scrambler understand line comments.

This allows for writing tests including line comments easier and more readable.
We will need more of those tests in the future and also line comments are
useful to force line breaks in tests.

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

11 years agoCMake: Make sure to detect LibXml2 when Clang is built standalone
Douglas Gregor [Tue, 18 Dec 2012 19:39:40 +0000 (19:39 +0000)]
CMake: Make sure to detect LibXml2 when Clang is built standalone

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

11 years agoFix a compilation warning with gcc 4.6
Eli Bendersky [Tue, 18 Dec 2012 18:53:14 +0000 (18:53 +0000)]
Fix a compilation warning with gcc 4.6

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

11 years agoRe-commit r170428 changes with Linux style file endings.
Guy Benyei [Tue, 18 Dec 2012 14:38:23 +0000 (14:38 +0000)]
Re-commit r170428 changes with Linux style file endings.

Add OpenCL images as clang builtin types.

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

11 years agoRevert changes from r170428, as I accidentally changed the line endings of these...
Guy Benyei [Tue, 18 Dec 2012 14:30:41 +0000 (14:30 +0000)]
Revert changes from r170428, as I accidentally changed the line endings of these files to Windows style.

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

11 years agoAdd OpenCL images as clang builtin types.
Guy Benyei [Tue, 18 Dec 2012 12:30:03 +0000 (12:30 +0000)]
Add OpenCL images as clang builtin types.

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

11 years agoRemove obsolete FIXMEs.
David Chisnall [Tue, 18 Dec 2012 10:24:07 +0000 (10:24 +0000)]
Remove obsolete FIXMEs.

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

11 years agotest/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).
NAKAMURA Takumi [Tue, 18 Dec 2012 05:14:30 +0000 (05:14 +0000)]
test/Misc/dev-fd-fs.c: Mark this as XFAIL:freebsd (since r169831).

I don't want to suppress this to be excluded with the feature "dev-fd-fs". This should work also on freebsd.

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

11 years agoInline hasAtomicCopyHelperAPI.
Rafael Espindola [Tue, 18 Dec 2012 04:29:34 +0000 (04:29 +0000)]
Inline hasAtomicCopyHelperAPI.

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

11 years agoMerge storage classes even when contexts don't match.
Rafael Espindola [Tue, 18 Dec 2012 04:18:55 +0000 (04:18 +0000)]
Merge storage classes even when contexts don't match.

This fixes the storage class of extern decls that are merged with file level
statics. The patch also fixes the linkage computation so that they are
considered internal.

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

11 years agoNow that the uninitialized variable has been fixed in llvm, add this test back,
Rafael Espindola [Tue, 18 Dec 2012 03:54:29 +0000 (03:54 +0000)]
Now that the uninitialized variable has been fixed in llvm, add this test back,
but remove unneeded options and fix the comment.

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

11 years agoFix typo (thanks to Jordan for spotting it!).
Richard Smith [Tue, 18 Dec 2012 03:04:38 +0000 (03:04 +0000)]
Fix typo (thanks to Jordan for spotting it!).

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

11 years agoThe underlying type for an enum should be an integer type, not another enum.
Eli Friedman [Tue, 18 Dec 2012 02:37:32 +0000 (02:37 +0000)]
The underlying type for an enum should be an integer type, not another enum.
(This change only affects ObjC.)

<rdar://problem/12857117>.

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

11 years agodocs: Nuke AnalyzerRegions.rst.
Sean Silva [Tue, 18 Dec 2012 02:15:05 +0000 (02:15 +0000)]
docs: Nuke AnalyzerRegions.rst.

As per Ted's advice. It can be brought back from version control if
needed.

This also fixes a Sphinx warning.

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

11 years agoWhen warning about a missing prototype because a function declaration is missing...
Anders Carlsson [Tue, 18 Dec 2012 01:29:20 +0000 (01:29 +0000)]
When warning about a missing prototype because a function declaration is missing 'void', insert a fixit to add the void.

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

11 years agoMore conservative fix for <rdar://problem/12847524> (a crash printing diagnostic...
Eli Friedman [Tue, 18 Dec 2012 00:52:36 +0000 (00:52 +0000)]
More conservative fix for <rdar://problem/12847524> (a crash printing diagnostic ranges).
I'm not really happy with this fix, but I'm confident it's correct.

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

11 years agoUse the correct return type (size_t) for these builtins.
Bill Wendling [Tue, 18 Dec 2012 00:37:10 +0000 (00:37 +0000)]
Use the correct return type (size_t) for these builtins.
<rdar://problem/12646344>

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

11 years agoAdd an expected parameter for the size of the destination.
Bill Wendling [Tue, 18 Dec 2012 00:34:49 +0000 (00:34 +0000)]
Add an expected parameter for the size of the destination.
<rdar://problem/12622659>

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

11 years agoAdd support for passing the main file name down to the assembler
Eric Christopher [Tue, 18 Dec 2012 00:31:10 +0000 (00:31 +0000)]
Add support for passing the main file name down to the assembler
for location information.

Part of PR14624

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

11 years agoRein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
Richard Smith [Tue, 18 Dec 2012 00:22:45 +0000 (00:22 +0000)]
Rein ubsan's vptr sanitizer back a bit. Per core issue 453, binding a reference
to an object outside its lifetime does not have undefined behavior.

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

11 years agoFix isThisDeclarationADefinition for extern following tentative.
Rafael Espindola [Mon, 17 Dec 2012 22:23:47 +0000 (22:23 +0000)]
Fix isThisDeclarationADefinition for extern following tentative.

An extern declaration following a tentative definition should not itself be
considered a tentative definition.
Fixes pr14614.

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

11 years agoFix PR14625 by teaching the driver to detect PWD for assembly files.
Chandler Carruth [Mon, 17 Dec 2012 21:40:04 +0000 (21:40 +0000)]
Fix PR14625 by teaching the driver to detect PWD for assembly files.

This also requires adding support to -cc1as for passing the detecting
PWD down through LLVM's debug info (which in turn required the LLVM
change in r170371).

The test case is weak (we only test the driver behavior) because there
is currently to infrastructure for running cc1as in the test suite. So
those four lines are untested (much like all other lines in that file),
but we have a test for the same pattern using llvm-mc in the LLVM
repository.

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

11 years ago[c-index-test] Fix warnings about unused results from chdir().
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:19:56 +0000 (20:19 +0000)]
[c-index-test] Fix warnings about unused results from chdir().
Patch from Edwin Vane!

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

11 years agoJust use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:50 +0000 (20:10 +0000)]
Just use begin()/end() instead of "&Vector[0], &Vector[0]+Vector.size()".

No functionality change.

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

11 years agoDon't include the header outside the include guards, it defeats the purpose of the...
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:49 +0000 (20:10 +0000)]
Don't include the header outside the include guards, it defeats the purpose of the include guards.

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

11 years ago[parser] Push a semi token for recovery only when it is actually missing.
Argyrios Kyrtzidis [Mon, 17 Dec 2012 20:10:43 +0000 (20:10 +0000)]
[parser] Push a semi token for recovery only when it is actually missing.

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

11 years ago[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.
Anna Zaks [Mon, 17 Dec 2012 20:08:54 +0000 (20:08 +0000)]
[analyzer] Tweak the NumFunctionsAnalyzed stat so that it's more useful.

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

11 years ago[analyzer] Implement "do not inline large functions many times"
Anna Zaks [Mon, 17 Dec 2012 20:08:51 +0000 (20:08 +0000)]
[analyzer] Implement "do not inline large functions many times"
performance heuristic

After inlining a function with more than 13 basic blocks 32 times, we
are not going to inline it anymore. The idea is that inlining large
functions leads to drastic performance implications. Since the function
has already been inlined, we know that we've analyzed it in many
contexts.

The following metrics are used:
 - Large function is a function with more than 13 basic blocks (we
should switch to another metric, like cyclomatic complexity)
 - We consider that we've inlined a function many times if it's been
inlined 32 times. This number is configurable with -analyzer-config
max-times-inline-large=xx

This heuristic addresses a performance regression introduced with
inlining on one benchmark. The analyzer on this benchmark became 60
times slower with inlining turned on. The heuristic allows us to analyze
it in 24% of the time. The performance improvements on the other
benchmarks I've tested with are much lower - under 10%, which is
expected.

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

11 years agoReapply r170344, this time without forgetting to commit the header changes.
David Chisnall [Mon, 17 Dec 2012 18:54:24 +0000 (18:54 +0000)]
Reapply r170344, this time without forgetting to commit the header changes.

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

11 years agoRevert "Added support for new property helpers (GNUstep runtime)."
Benjamin Kramer [Mon, 17 Dec 2012 18:02:43 +0000 (18:02 +0000)]
Revert "Added support for new property helpers (GNUstep runtime)."

This reverts commit r170344. Doesn't even compile.

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

11 years agoAdded support for new property helpers (GNUstep runtime).
David Chisnall [Mon, 17 Dec 2012 15:59:29 +0000 (15:59 +0000)]
Added support for new property helpers (GNUstep runtime).

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

11 years agoAdd basic support for splitting before function calls if it can't be
Daniel Jasper [Mon, 17 Dec 2012 14:34:14 +0000 (14:34 +0000)]
Add basic support for splitting before function calls if it can't be
avoided.

This required a minor modification of the memoization as now the
"CurrentPenalty" depends on whether or not we break before the current
token. Therefore, the CurrentPenalty should not be memoized but added
after retrieving a value from memory. This should not affect the runtime
behavior.

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

11 years agotsan: correct llvm libc++ name
Dmitry Vyukov [Mon, 17 Dec 2012 13:07:35 +0000 (13:07 +0000)]
tsan: correct llvm libc++ name

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

11 years agoFix several formatting problems.
Daniel Jasper [Mon, 17 Dec 2012 11:29:41 +0000 (11:29 +0000)]
Fix several formatting problems.

More specifically:
- Improve formatting of static initializers.
- Fix formatting of lines comments in enums.
- Fix formmating of trailing line comments.

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

11 years agotsan: add __has_feature(thread_sanitizer)
Dmitry Vyukov [Mon, 17 Dec 2012 08:52:05 +0000 (08:52 +0000)]
tsan: add __has_feature(thread_sanitizer)

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

11 years agotsan: update docs
Dmitry Vyukov [Mon, 17 Dec 2012 07:16:54 +0000 (07:16 +0000)]
tsan: update docs

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

11 years agoClean up a small (messy) section of Clang's release notes for 3.2.
Chandler Carruth [Mon, 17 Dec 2012 06:24:36 +0000 (06:24 +0000)]
Clean up a small (messy) section of Clang's release notes for 3.2.

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

11 years agoThis patch fixes PR13624, which notes a 64-bit PowerPC ELF ABI
Bill Schmidt [Mon, 17 Dec 2012 04:20:17 +0000 (04:20 +0000)]
This patch fixes PR13624, which notes a 64-bit PowerPC ELF ABI
incompatibility with how complex values are returned.  It is sufficient
to flag all complex types as direct rather than indirect.

A new test case is provided that checks correct IR generation for the
various supported flavors of _Complex.

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

11 years agoIdentifierResolver: Remove an unnecessary include and an unused parameter.
Nico Weber [Mon, 17 Dec 2012 03:51:09 +0000 (03:51 +0000)]
IdentifierResolver: Remove an unnecessary include and an unused parameter.

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

11 years agoDocumentation: add a missing word
Dmitri Gribenko [Sun, 16 Dec 2012 19:55:39 +0000 (19:55 +0000)]
Documentation: add a missing word

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

11 years agoClang ReleaseNotes: add information about documentation comments support
Dmitri Gribenko [Sun, 16 Dec 2012 17:38:09 +0000 (17:38 +0000)]
Clang ReleaseNotes: add information about documentation comments support

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

11 years agoDocumentation: AutomaticReferenceCounting.rst: use CSS section numbering.
Dmitri Gribenko [Sun, 16 Dec 2012 11:25:45 +0000 (11:25 +0000)]
Documentation: AutomaticReferenceCounting.rst: use CSS section numbering.
This enables us to use the same document structure as in other files.

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

11 years agoDon't use SourceLineCache in getColumnNumber if LastLineNoResult is past the end...
Craig Topper [Sun, 16 Dec 2012 05:58:32 +0000 (05:58 +0000)]
Don't use SourceLineCache in getColumnNumber if LastLineNoResult is past the end of the cache. Fixes PR14570.

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

11 years agodocs: Fix completely broken adornment structure.
Sean Silva [Sun, 16 Dec 2012 00:23:40 +0000 (00:23 +0000)]
docs: Fix completely broken adornment structure.

The adornment:

===
Foo
===

is for titles, not sections.

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

11 years agoDocumentation: random cleanups. Use monospaced font where appropriate,
Dmitri Gribenko [Sat, 15 Dec 2012 21:10:51 +0000 (21:10 +0000)]
Documentation: random cleanups.  Use monospaced font where appropriate,
highlight console output with "code-block:: console", etc.

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

11 years agoDocumentation: convert InternalsManual.html to reST
Dmitri Gribenko [Sat, 15 Dec 2012 20:41:17 +0000 (20:41 +0000)]
Documentation: convert InternalsManual.html to reST

Patch by Anastasi Voitova with with small fixes by me.

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

11 years agoDocumentation: LanguageExtensions.rst: convert link to :doc: style and fix up
Dmitri Gribenko [Sat, 15 Dec 2012 14:25:25 +0000 (14:25 +0000)]
Documentation: LanguageExtensions.rst: convert link to :doc: style and fix up
heading underline.

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

11 years ago[ubsan] Emit branch weight metadata to hint towards common case.
Will Dietz [Sat, 15 Dec 2012 01:39:14 +0000 (01:39 +0000)]
[ubsan] Emit branch weight metadata to hint towards common case.

Results in better block placement that helps close the
performance gap when making ubsan checks recoverable.

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

11 years agoDocs: redirect "static analysis extensions" section to the analyzer site.
Jordan Rose [Sat, 15 Dec 2012 00:37:01 +0000 (00:37 +0000)]
Docs: redirect "static analysis extensions" section to the analyzer site.

The notes on the objc_method_family and ns_returns_retained-type attributes
have been moved to the Objective-C section, since both are used by ARC.
The notes on analyzer_noreturn are now only on the analyzer site.

The inadequacy of these docs was noticed months ago by Jonathan Sauer;
I'm only just now getting around to cleaning them up.

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

11 years agoRemove old description of analyzer internals from public docs.
Jordan Rose [Sat, 15 Dec 2012 00:36:53 +0000 (00:36 +0000)]
Remove old description of analyzer internals from public docs.

The file still exists in docs/analyzer/, but it won't be linked to from
clang.llvm.org or processed as part of the default Sphinx doc-build.
RegionStore has changed a lot from what Ted and Zhongxing describe here!

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

11 years agofixed line endings
Anton Yartsev [Fri, 14 Dec 2012 20:28:48 +0000 (20:28 +0000)]
fixed line endings

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

11 years agoadded post-statement callback to CXXNewExpr and pre-statement callback to CXXDeleteExpr
Anton Yartsev [Fri, 14 Dec 2012 19:48:34 +0000 (19:48 +0000)]
added post-statement callback to CXXNewExpr and pre-statement callback to CXXDeleteExpr

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

11 years agoDon't hit an assertion failure when calculating the __PRETTY_FUNCTION__
Argyrios Kyrtzidis [Fri, 14 Dec 2012 19:44:11 +0000 (19:44 +0000)]
Don't hit an assertion failure when calculating the __PRETTY_FUNCTION__
of a member function with parenthesized declarator.

Like this test case:

class Foo {
  const char *(baz)() {
    return __PRETTY_FUNCTION__;
  }
};

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

11 years ago[analyzer] Propagate the checker's state from checkBranchCondition
Anna Zaks [Fri, 14 Dec 2012 19:08:20 +0000 (19:08 +0000)]
[analyzer] Propagate the checker's state from checkBranchCondition

Fixes a bug, where we were dropping the state modifications from the
checkBranchCondition checker callback.

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

11 years ago[analyzer] Refactor: Store visited Decls instead of CallGraphNodes.
Anna Zaks [Fri, 14 Dec 2012 19:08:17 +0000 (19:08 +0000)]
[analyzer] Refactor: Store visited Decls instead of CallGraphNodes.

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

11 years agoStyle and Doc fix for CommonOptionsParser
Edwin Vane [Fri, 14 Dec 2012 18:58:25 +0000 (18:58 +0000)]
Style and Doc fix for CommonOptionsParser

- Renaming GetCompilations() and GetSourcePathList() to follow LLVM
  style.
- Updating docs to reflect name change.
- Also updating help text to not mention clang-check since this class
  can be used by any tool.

Reviewed By: Alexander Kornienko

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

11 years ago[preprocessor] For errors at a function macro invocation, also include
Argyrios Kyrtzidis [Fri, 14 Dec 2012 18:53:47 +0000 (18:53 +0000)]
[preprocessor] For errors at a function macro invocation, also include
a note about where the macro is defined.

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

11 years ago[CMake] Move libxml2 stuff from clang to llvm/cmake.
NAKAMURA Takumi [Fri, 14 Dec 2012 18:30:20 +0000 (18:30 +0000)]
[CMake] Move libxml2 stuff from clang to llvm/cmake.

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

11 years agoDon't require a space between the two ">" in "vector<id<protocol>>" in objc++11.
Nico Weber [Fri, 14 Dec 2012 18:22:38 +0000 (18:22 +0000)]
Don't require a space between the two ">" in "vector<id<protocol>>" in objc++11.

C++11 allowed writing "vector<vector<int>>" without a space between the two ">".
This change allows this for protocols in template lists too in -std=c++11 mode,
and improves the diagnostic in c++98 mode.

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

11 years agoTargets.cpp: [cygwin] Add the predefined macro "_X86_", according to newer version...
NAKAMURA Takumi [Fri, 14 Dec 2012 10:17:26 +0000 (10:17 +0000)]
Targets.cpp: [cygwin] Add the predefined macro "_X86_", according to newer version of cygwin/w32api.

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

11 years agoHave Sema::ActOnStartOfFunctionDef return the declaration that was passed it.
Argyrios Kyrtzidis [Fri, 14 Dec 2012 06:54:03 +0000 (06:54 +0000)]
Have Sema::ActOnStartOfFunctionDef return the declaration that was passed it.

This fixes the missing warning here:

struct S {
    template <typename T>
    void meth() {
        char arr[3];
        arr[4] = 0; // warning: array index 4 is past the end of the array
    }
};

template <typename T>
void func() {
    char arr[3];
    arr[4] = 0; // no warning
}

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

11 years agoRemove code from Sema::ActOnStartOfFunctionTemplateDef that duplicates what
Argyrios Kyrtzidis [Fri, 14 Dec 2012 06:53:58 +0000 (06:53 +0000)]
Remove code from Sema::ActOnStartOfFunctionTemplateDef that duplicates what
Sema::ActOnStartOfFunctionDef is already doing.

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

11 years agofix another spello
Nico Weber [Fri, 14 Dec 2012 02:41:18 +0000 (02:41 +0000)]
fix another spello

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

11 years agofix spello
Nico Weber [Fri, 14 Dec 2012 02:40:09 +0000 (02:40 +0000)]
fix spello

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

11 years agoclang/test/CodeGenCXX/lambda-expressions.cpp: Relax expression for -Asserts.
NAKAMURA Takumi [Fri, 14 Dec 2012 02:35:04 +0000 (02:35 +0000)]
clang/test/CodeGenCXX/lambda-expressions.cpp: Relax expression for -Asserts.

"entry:" is not met in -Asserts build.

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

11 years agoRefactor dump methods to make RegionBindingsRef printable in the debugger.
Ted Kremenek [Fri, 14 Dec 2012 01:23:13 +0000 (01:23 +0000)]
Refactor dump methods to make RegionBindingsRef printable in the debugger.

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

11 years agoMake the test less sensitive to the inline threshold.
Nadav Rotem [Fri, 14 Dec 2012 00:26:15 +0000 (00:26 +0000)]
Make the test less sensitive to the inline threshold.

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

11 years agoMake sure the __invoke function for lambdas returns properly. Per bug report on...
Eli Friedman [Thu, 13 Dec 2012 23:37:17 +0000 (23:37 +0000)]
Make sure the __invoke function for lambdas returns properly.  Per bug report on IRC>

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

11 years agoDebug Info: Emit vtables pointer members as artificial.
David Blaikie [Thu, 13 Dec 2012 22:29:06 +0000 (22:29 +0000)]
Debug Info: Emit vtables pointer members as artificial.

I wasn't sure where to put the test case for this, but this seemed like as good
a place as any. I had to reorder the tests here to make them legible while
still matching the order of metadata output in the IR file (for some reason
making it virtual changed the ordering).

Relevant commit to fix up LLVM to actually respect 'artificial' member
variables is coming once I write up a test case for it.

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

11 years ago[PCH] Make the new PCH format (control block) backwards compatible and
Argyrios Kyrtzidis [Thu, 13 Dec 2012 21:38:23 +0000 (21:38 +0000)]
[PCH] Make the new PCH format (control block) backwards compatible and
don't crash when loading a PCH with the older format.

The introduction of the control block broke compatibility with PCHs from
older versions. This patch allows loading (and rejecting) PCHs from an older
version and allows newer PCHs to be rejected from older clang versions as well.

rdar://12821386

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

11 years agoAdd support for current Ubuntu Quantal and the upcoming Raring.
Rafael Espindola [Thu, 13 Dec 2012 20:26:05 +0000 (20:26 +0000)]
Add support for current Ubuntu Quantal and the upcoming Raring.
Patch by Martin Nowack.

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

11 years agoRevert 170049 because it fails with an assertion on one of the spec2000 workloads.
Nadav Rotem [Thu, 13 Dec 2012 19:58:10 +0000 (19:58 +0000)]
Revert 170049 because it fails with an assertion on one of the spec2000 workloads.

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

11 years ago[analyzer] Fix doc error (wrong param name) in ObjCSuperCallChecker.
Jordan Rose [Thu, 13 Dec 2012 18:26:05 +0000 (18:26 +0000)]
[analyzer] Fix doc error (wrong param name) in ObjCSuperCallChecker.

Thanks for the -Wdocumentation catch, Dmitri!

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

11 years agoUpdate CMake build corresponding to r170135.
NAKAMURA Takumi [Thu, 13 Dec 2012 16:24:59 +0000 (16:24 +0000)]
Update CMake build corresponding to r170135.

Thanks to Saleem Abdulrasool, aka compnerd!

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

11 years agoDont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
Roman Divacky [Thu, 13 Dec 2012 16:09:42 +0000 (16:09 +0000)]
Dont use/link ARCMT, StaticAnalyzer and Rewriter to clang when the user
specifies not to. Dont build ASTMatchers with Rewriter disabled and
StaticAnalyzer when it's disabled.

Without all those three, the clang binary shrinks (x86_64) from ~36MB
to ~32MB (unstripped).

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

11 years agoDocumentation: add AutomaticReferenceCounting.rst to the toctree
Dmitri Gribenko [Thu, 13 Dec 2012 16:06:00 +0000 (16:06 +0000)]
Documentation: add AutomaticReferenceCounting.rst to the toctree

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

11 years agoDocumentation: convert AutomaticReferenceCounting.html to reST
Dmitri Gribenko [Thu, 13 Dec 2012 16:04:37 +0000 (16:04 +0000)]
Documentation: convert AutomaticReferenceCounting.html to reST

Patch by Anastasi Voitova with with small fixes by me.

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

11 years agoRename StmtDumper to ASTDumper.
Alexander Kornienko [Thu, 13 Dec 2012 13:59:55 +0000 (13:59 +0000)]
Rename StmtDumper to ASTDumper.
Patch contributed by Philip Craig!

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

11 years agoRemove little endian specification from SPIR data layout - SPIR doesn't define endian...
Guy Benyei [Thu, 13 Dec 2012 13:22:48 +0000 (13:22 +0000)]
Remove little endian specification from SPIR data layout - SPIR doesn't define endiannes in the data layout.

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

11 years agoPoint a hyperlink back to where it was before it got reStructured.
Richard Smith [Thu, 13 Dec 2012 07:29:23 +0000 (07:29 +0000)]
Point a hyperlink back to where it was before it got reStructured.

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

11 years agoubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads of
Richard Smith [Thu, 13 Dec 2012 07:11:50 +0000 (07:11 +0000)]
ubsan: Add -fsanitize=bool and -fsanitize=enum, which check for loads of
bit-patterns which are not valid values for enumerated or boolean types.
These checks are the ubsan analogue of !range metadata.

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

11 years agoSimplify. No functionality change.
Richard Smith [Thu, 13 Dec 2012 05:41:48 +0000 (05:41 +0000)]
Simplify. No functionality change.

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

11 years agoInitial support for FreeBSD on ARM.
Rafael Espindola [Thu, 13 Dec 2012 04:17:14 +0000 (04:17 +0000)]
Initial support for FreeBSD on ARM.
Patch by Andrew Turner.

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

11 years ago[analyzer] Generalize ObjCMissingSuperCallChecker.
Jordan Rose [Thu, 13 Dec 2012 03:06:45 +0000 (03:06 +0000)]
[analyzer] Generalize ObjCMissingSuperCallChecker.

We now check a few methods for UIResponder, NSResponder, and NSDocument.

Patch by Julian Mayer!

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

11 years agoUsing CanQualType::getAs<ArrayType> is unsafe; fix the code currently using it,
Eli Friedman [Thu, 13 Dec 2012 01:43:21 +0000 (01:43 +0000)]
Using CanQualType::getAs<ArrayType> is unsafe; fix the code currently using it,
and make sure additional uses don't get introduced.  <rdar://problem/12858424>.

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

11 years agodocs: More reST conversion.
Sean Silva [Thu, 13 Dec 2012 01:10:46 +0000 (01:10 +0000)]
docs: More reST conversion.

Sorry for the large commit, but it is much faster to convert in batches.

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

11 years ago[analyzer] Fix a self-init checker false positive.
Anna Zaks [Thu, 13 Dec 2012 00:42:19 +0000 (00:42 +0000)]
[analyzer] Fix a self-init checker false positive.

This is a Band-Aid fix to a false positive, where we complain about not
initializing self to [super init], where self is not coming from the
init method, but is coming from the caller to init.

The proper solution would be to associate the self and it's state with
the enclosing init.

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

11 years agoobjc: DOn't complain if a (SEL) expression is typecast
Fariborz Jahanian [Thu, 13 Dec 2012 00:42:06 +0000 (00:42 +0000)]
objc: DOn't complain if a (SEL) expression is typecast
to (SEL). Fixes // rdar://12859590

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

11 years agoAdd missing check for error return from DefaultLvalueConversion. Fixes <rdar://probl...
Eli Friedman [Thu, 13 Dec 2012 00:37:17 +0000 (00:37 +0000)]
Add missing check for error return from DefaultLvalueConversion.  Fixes <rdar://problem/12857416>.

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

11 years agoMore hacking on mapDiagnosticRanges to make it handle more cases.
Eli Friedman [Thu, 13 Dec 2012 00:14:59 +0000 (00:14 +0000)]
More hacking on mapDiagnosticRanges to make it handle more cases.
This still isn't quite right, but it fixes a crash.

I factored out findCommonParent because we need it on the result of
getImmediateExpansionRange: for a function macro, the beginning
and end of an expansion range can come out of different
macros/macro arguments, which means the resulting range is a complete
mess to handle consistently.

I also made some changes to how findCommonParent works; it works somewhat
better in some cases, and somewhat worse in others, but I think overall
it's a better balance.  I'm coming to the conclusion that mapDiagnosticRanges
isn't using the right algorithm, though: chasing the caret is fundamentally
more complicated than any algorithm which only considers one FileID for the
caret can handle because each SourceLocation doesn't really have a single parent.
We need to follow the same path of choosing expansion locations and spelling
locations which the caret used to come up with the correct range
in the general case.

Fixes <rdar://problem/12847524>.

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

11 years agodocs: Convert some docs to reST.
Sean Silva [Wed, 12 Dec 2012 23:44:55 +0000 (23:44 +0000)]
docs: Convert some docs to reST.

Converts:
    LanguageExtensions
    LibASTMatchers
    LibTooling
    PCHInternals
    ThreadSanitizer
    Tooling

Patch by Mykhailo Pustovit!
(with minor edits by Dmitri Gribenko and Sean Silva)

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

11 years agodocs: Another test commit (sphinx autoupdating).
Daniel Dunbar [Wed, 12 Dec 2012 23:35:03 +0000 (23:35 +0000)]
docs: Another test commit (sphinx autoupdating).

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