]> granicus.if.org Git - clang/log
clang
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

11 years agodocs: Test commit (sphinx autoupdating).
Daniel Dunbar [Wed, 12 Dec 2012 23:33:24 +0000 (23:33 +0000)]
docs: Test commit (sphinx autoupdating).

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

11 years agodocs: Initial Sphinx setup for Clang.
Sean Silva [Wed, 12 Dec 2012 23:02:30 +0000 (23:02 +0000)]
docs: Initial Sphinx setup for Clang.

I don't think this will be visible just yet on <clang.llvm.org/docs/>
since I don't think that the necessary server-side setup has taken
place.

Don't shoot me over the theme. I don't want to duplicate LLVM's theme
into the clang repo at the moment, so I just used one of Sphinx's
default themes.

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

11 years ago[arcmt] When capturing ARC errors, have a sanity check to make sure
Argyrios Kyrtzidis [Wed, 12 Dec 2012 22:48:28 +0000 (22:48 +0000)]
[arcmt] When capturing ARC errors, have a sanity check to make sure
the diagnostic has a valid location.

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

11 years ago[objc] For the ARC error that is emitted when a synthesized property implementation
Argyrios Kyrtzidis [Wed, 12 Dec 2012 22:48:25 +0000 (22:48 +0000)]
[objc] For the ARC error that is emitted when a synthesized property implementation
has inconsistent ownership with the backing ivar, point the error location to the
ivar.

Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed.
Also provide the location of @synthesize via a note.

This also fixes the problem where an auto-synthesized property would emit an error without
any location.

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

11 years ago[ms-inline asm] Test case for r170037.
Chad Rosier [Wed, 12 Dec 2012 22:46:23 +0000 (22:46 +0000)]
[ms-inline asm] Test case for r170037.

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

11 years agoRewrite calls to bitcast unprototyped functions when emitting a definition.
John McCall [Wed, 12 Dec 2012 22:21:47 +0000 (22:21 +0000)]
Rewrite calls to bitcast unprototyped functions when emitting a definition.

My variadics patch, r169588, changed these calls to typically be
bitcasts rather than calls to a supposedly variadic function.
This totally subverted a hack where we intentionally dropped
excess arguments from such calls in order to appease the inliner
and a "warning" from the optimizer.  This patch extends the hack
to also work with bitcasts, as well as teaching it to rewrite
invokes.

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

11 years ago[driver] Don't warn about an unused -flto option.
Chad Rosier [Wed, 12 Dec 2012 20:06:31 +0000 (20:06 +0000)]
[driver] Don't warn about an unused -flto option.
rdar://12851905

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

11 years ago[analyzer] Don't crash running destructors for multidimensional arrays.
Jordan Rose [Wed, 12 Dec 2012 19:13:44 +0000 (19:13 +0000)]
[analyzer] Don't crash running destructors for multidimensional arrays.

We don't handle array destructors correctly yet, but we now apply the same
hack (explicitly destroy the first element, implicitly invalidate the rest)
for multidimensional arrays that we already use for linear arrays.

<rdar://problem/12858542>

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

11 years agoMarking the objc_autoreleaseReturnValue and objc_retainAutoreleaseReturnValue
Chad Rosier [Wed, 12 Dec 2012 17:52:21 +0000 (17:52 +0000)]
Marking the objc_autoreleaseReturnValue and objc_retainAutoreleaseReturnValue
call sites as tail calls unconditionally.  While it's theoretically true that
this is just an optimization, it's an optimization that we very much want to
happen even at -O0, or else ARC applications become substantially harder to
debug.  See r169796 for the llvm/fast-isel side of things.
rdar://12553082

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

11 years agoPR14581: Make SourceLocation::printToString work, or it will always return an empty...
Benjamin Kramer [Wed, 12 Dec 2012 14:17:17 +0000 (14:17 +0000)]
PR14581: Make SourceLocation::printToString work, or it will always return an empty string.

No test case, this is debugging code.

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

11 years agoSpeeds up parsing of global declarations in cases where the warning
Manuel Klimek [Wed, 12 Dec 2012 13:26:54 +0000 (13:26 +0000)]
Speeds up parsing of global declarations in cases where the warning
is switched of by about 0.8% (tested with int i<N>).

Additionally, this puts computing the diagnostic class into the hot
path more when parsing, in preparation for upcoming optimizations
in this area.

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

11 years agoclang/lib/Driver/Driver.cpp: Split COMPILER_PATH according to llvm::sys::PathSeparato...
NAKAMURA Takumi [Wed, 12 Dec 2012 06:22:22 +0000 (06:22 +0000)]
clang/lib/Driver/Driver.cpp: Split COMPILER_PATH according to llvm::sys::PathSeparator, that is ';' in Win32 hosts.

Thanks to Bogon Kim!

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

11 years agoDon't warn about disabled macro expansion if we see the name of a function-like macro...
Richard Smith [Wed, 12 Dec 2012 02:46:14 +0000 (02:46 +0000)]
Don't warn about disabled macro expansion if we see the name of a function-like macro which isn't immediately followed by '('. FreeBSD's stdio.h #defines foo(x) to (foo)(x), apparently.

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

11 years ago[libclang] Make sure tokens from preprocessor directives are annotated as such,
Argyrios Kyrtzidis [Wed, 12 Dec 2012 01:05:25 +0000 (01:05 +0000)]
[libclang] Make sure tokens from preprocessor directives are annotated as such,
even if the directive is inside a declaration.

Fixes rdar://11548788 & http://llvm.org/PR12970

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

11 years agoFix line ending is tests. No functional change.
Richard Trieu [Wed, 12 Dec 2012 00:52:15 +0000 (00:52 +0000)]
Fix line ending is tests.  No functional change.

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

11 years agoclang/test: Suppress two tests on win32 for now, since, not sure, in r169829 to r169831.
NAKAMURA Takumi [Wed, 12 Dec 2012 00:51:38 +0000 (00:51 +0000)]
clang/test: Suppress two tests on win32 for now, since, not sure, in r169829 to r169831.

"ansi-escape-sequences" is easy convenient to exclude win32. Please be patient.

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

11 years agoTry to fix Win32 failures
Douglas Gregor [Tue, 11 Dec 2012 22:31:46 +0000 (22:31 +0000)]
Try to fix Win32 failures

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

11 years agoDon't use 'touch' in this test; it may be the cause of Windows-related failures.
Douglas Gregor [Tue, 11 Dec 2012 22:25:26 +0000 (22:25 +0000)]
Don't use 'touch' in this test; it may be the cause of Windows-related failures.

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

11 years agoUse @import rather than @__experimental_modules_import, since the
Douglas Gregor [Tue, 11 Dec 2012 22:11:52 +0000 (22:11 +0000)]
Use @import rather than @__experimental_modules_import, since the
latter is rather a mess to type.

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

11 years agoAdd SPIR32/SPIR64 targets to Clang
Guy Benyei [Tue, 11 Dec 2012 21:38:14 +0000 (21:38 +0000)]
Add SPIR32/SPIR64 targets to Clang

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

11 years agoAdd -fslp-vectorize to enable bb-vectorize
Hal Finkel [Tue, 11 Dec 2012 19:59:32 +0000 (19:59 +0000)]
Add -fslp-vectorize to enable bb-vectorize

Add -fslp-vectorize (with -ftree-slp-vectorize as an alias for gcc compatibility)
to provide a way to enable the basic-block vectorization pass. This uses the same
acronym as gcc, superword-level parallelism (SLP), also common in the literature,
to refer to basic-block vectorization.

Nadav suggested this as a follow-up to the adding of -fvectorize.

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

11 years agoobjective-C blocks: Check for record type when deciding if
Fariborz Jahanian [Tue, 11 Dec 2012 19:58:01 +0000 (19:58 +0000)]
objective-C blocks: Check for record type when deciding if
byref variable requires extended layout info. to prevent
a crash involving arrays declared __block. // rdar://12787751

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