]> granicus.if.org Git - clang/log
clang
11 years agoFixes PR14801 - preprocessor directives shouldn't be indented
Manuel Klimek [Sat, 5 Jan 2013 22:14:16 +0000 (22:14 +0000)]
Fixes PR14801 - preprocessor directives shouldn't be indented

Uses indent 0 for macros for now and resets the indent state to the
level prior to the preprocessor directive.

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

11 years agoFixes a breakage in dejagnu++ test suite where it included
Fariborz Jahanian [Sat, 5 Jan 2013 21:54:55 +0000 (21:54 +0000)]
Fixes a breakage in dejagnu++ test suite where it included
<objc/Protocol.h>. Caused by my recent changes for
various builtin declarations of objc_msgSendSuper
variety. // rdar://12489098

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

11 years agoMake checking for 'protected' access in debug info more legible.
David Blaikie [Sat, 5 Jan 2013 21:41:59 +0000 (21:41 +0000)]
Make checking for 'protected' access in debug info more legible.

Based on code review feedback for r171604 from Chandler Carruth &
Eric Christopher. Enabled by improvements to LLVM made in r171636.

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

11 years agoFixes PR14811: Crash when formatting some macros
Manuel Klimek [Sat, 5 Jan 2013 21:34:55 +0000 (21:34 +0000)]
Fixes PR14811: Crash when formatting some macros

A preprocessor directive cannot be started while we're parsing one.

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

11 years agoPR14573: Unnamed parameters in debug info, Part 2
David Blaikie [Sat, 5 Jan 2013 20:03:07 +0000 (20:03 +0000)]
PR14573: Unnamed parameters in debug info, Part 2

Catch some cases I'd missed in r171605 related to unnamed parameters of record
type. This resolves all remaining cases of PR14573 suppression in the GDB 7.5
test suite. Fix to the test suite to follow.

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

11 years agoFileCheck-ize test/CodeGen/inline.c.
David Blaikie [Sat, 5 Jan 2013 18:22:42 +0000 (18:22 +0000)]
FileCheck-ize test/CodeGen/inline.c.

A rather egregious example of the grep-style checking of old that I randomly
came across.

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

11 years agoCompanion patch to r171621 which changed the interface for creating TTI
Chandler Carruth [Sat, 5 Jan 2013 11:45:12 +0000 (11:45 +0000)]
Companion patch to r171621 which changed the interface for creating TTI
passes to a create-pass function instead of a direct constructor call.

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

11 years agoFix set-xcode-analyzer to only modify the ExecPath for the analyzer when using -...
Ted Kremenek [Sat, 5 Jan 2013 07:31:54 +0000 (07:31 +0000)]
Fix set-xcode-analyzer to only modify the ExecPath for the analyzer when using --use-xcode-clang.

Turns out that the ExecPath for the ObjC migrator would also get set.

Fixes <rdar://problem/12961769>.

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

11 years agoEmit debug info for unnamed parameters.
David Blaikie [Sat, 5 Jan 2013 05:58:35 +0000 (05:58 +0000)]
Emit debug info for unnamed parameters.

LLVM ignores this data for now - patch for that to follow.

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

11 years agoChange test/CodeGenCXX/debug-info-method.cpp an IR (rather than asm) test.
David Blaikie [Sat, 5 Jan 2013 05:48:08 +0000 (05:48 +0000)]
Change test/CodeGenCXX/debug-info-method.cpp an IR (rather than asm) test.

Referring back to the original commit (r115090) which was a frontend only test
I adjusted this test to verify the frontend change that was made, to emit the
protected access value in the flags metadata field.

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

11 years agoFileCheck-ize test/CodeGenCXX/debug-info-method.cpp
David Blaikie [Sat, 5 Jan 2013 05:39:21 +0000 (05:39 +0000)]
FileCheck-ize test/CodeGenCXX/debug-info-method.cpp

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

11 years ago[mips] Fix data layout string. Add 64 to the list of native integer widths
Akira Hatanaka [Sat, 5 Jan 2013 02:04:34 +0000 (02:04 +0000)]
[mips] Fix data layout string. Add 64 to the list of native integer widths
and add stack alignment information.

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

11 years agoAssert that redeclarations have the same linkage.
Rafael Espindola [Sat, 5 Jan 2013 01:28:37 +0000 (01:28 +0000)]
Assert that redeclarations have the same linkage.

It is somewhat hard to test linkage, so I decided to try to add an assert. This
already found some interesting cases where there were different.

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

11 years agoIn my last patch initialize the destination to null (with a simple store) before...
Fariborz Jahanian [Sat, 5 Jan 2013 00:32:13 +0000 (00:32 +0000)]
In my last patch initialize the destination to null (with a simple store) before doing a storeStrong to it.
// rdar://12530881

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

11 years agoFix testing case for Release build (r171493)
Manman Ren [Sat, 5 Jan 2013 00:01:42 +0000 (00:01 +0000)]
Fix testing case for Release build (r171493)

rdar://11562117

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

11 years agoUpdate checker build to checker-270
Ted Kremenek [Fri, 4 Jan 2013 23:52:16 +0000 (23:52 +0000)]
Update checker build to checker-270

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

11 years agoVarious fixes to clang-format's macro handling.
Manuel Klimek [Fri, 4 Jan 2013 23:34:14 +0000 (23:34 +0000)]
Various fixes to clang-format's macro handling.

Some of this is still pretty rough (note the load of FIXMEs), but it is
strictly an improvement and fixes various bugs that were related to
macro processing but are also imporant in non-macro use cases.

Specific fixes:
- correctly puts espaced newlines at the end of the line
- fixes counting of white space before a token when escaped newlines are
  present
- fixes parsing of "trailing" tokens when eof() is hit
- puts macro parsing orthogonal to parsing other structure
- general support for parsing of macro definitions

Due to the fix to format trailing tokens, this change also includes a
bunch of fixes to the c-index tests.

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

11 years agoobjective-C arc: in copy helper function for
Fariborz Jahanian [Fri, 4 Jan 2013 23:32:24 +0000 (23:32 +0000)]
objective-C arc: in copy helper function for
__strong __block variables, perform objc_storeStrong on
source and destination instead of direct move. This
is done with -O0 and to improve some analysis.
// rdar://12530881

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

11 years agoFix indent and remove parameter with a matching default value.
Chad Rosier [Fri, 4 Jan 2013 22:40:33 +0000 (22:40 +0000)]
Fix indent and remove parameter with a matching default value.

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

11 years agoStyle fix: We don't use lowercase-and-underscored template parameter names.
Rafael Espindola [Fri, 4 Jan 2013 21:18:45 +0000 (21:18 +0000)]
Style fix: We don't use lowercase-and-underscored template parameter names.
Thanks for dgregor for noticing it.

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

11 years agoCorrectly format dereference and address of in array parameters.
Daniel Jasper [Fri, 4 Jan 2013 20:46:38 +0000 (20:46 +0000)]
Correctly format dereference and address of in array parameters.

Before: InvalidRegions[ &R] = 0;
After:  InvalidRegions[&R] = 0;

This fixes llvm.org/PR14793

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

11 years agoFix typo. Thanks to dgregor for noticing it.
Rafael Espindola [Fri, 4 Jan 2013 20:41:40 +0000 (20:41 +0000)]
Fix typo. Thanks to dgregor for noticing it.

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

11 years agoUnqualify the parameter type.
Rafael Espindola [Fri, 4 Jan 2013 20:34:32 +0000 (20:34 +0000)]
Unqualify the parameter type.
This fixes a regression from 168895.

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

11 years agorealpath'ify the mapping from header includes to module imports.
Douglas Gregor [Fri, 4 Jan 2013 19:44:26 +0000 (19:44 +0000)]
realpath'ify the mapping from header includes to module imports.

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

11 years agoUpdate CMakeLists.txt
Ted Kremenek [Fri, 4 Jan 2013 19:04:47 +0000 (19:04 +0000)]
Update CMakeLists.txt

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

11 years agoAdd __has_feature support to detect if clang supports the explicit "atomic" keyword...
Ted Kremenek [Fri, 4 Jan 2013 19:04:44 +0000 (19:04 +0000)]
Add __has_feature support to detect if clang supports the explicit "atomic" keyword for ObjC properties.

Fixes <rdar://problem/12953378>.

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

11 years agoRequire set-xcode-analyzer to run with Python 2.7 or later.
Ted Kremenek [Fri, 4 Jan 2013 19:04:42 +0000 (19:04 +0000)]
Require set-xcode-analyzer to run with Python 2.7 or later.

Addresses LLVM PR 11661.

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

11 years agoNSErrorChecker: remove quoting the parameter name in the diagnostic until we actually...
Ted Kremenek [Fri, 4 Jan 2013 19:04:40 +0000 (19:04 +0000)]
NSErrorChecker: remove quoting the parameter name in the diagnostic until we actually include it's name.

This is a possible regression of moving to using ImplicitNullDerefEvent.
Fixing this for real (including the parameter name) requires more
plumbing in ImplicitNullDerefEvent.  This is just a stop gap fix.

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

11 years agoTighten code. No functionality change.
Ted Kremenek [Fri, 4 Jan 2013 19:04:36 +0000 (19:04 +0000)]
Tighten code.  No functionality change.

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

11 years agoAdd the module name to the 'incomplete umbrella header' warning.
Douglas Gregor [Fri, 4 Jan 2013 18:58:28 +0000 (18:58 +0000)]
Add the module name to the 'incomplete umbrella header' warning.

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

11 years agoLet the formatter ignore UnwrappedLines containing errors.
Daniel Jasper [Fri, 4 Jan 2013 18:52:56 +0000 (18:52 +0000)]
Let the formatter ignore UnwrappedLines containing errors.

This prevents code like:

namespace {
class Foo {
  Foo(
  };
}  // comment

from causing segfaults (see llvm.org/PR14774).

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

11 years agoAdd file added in r171484 to CMakelists.txt.
Filipe Cabecinhas [Fri, 4 Jan 2013 18:52:29 +0000 (18:52 +0000)]
Add file added in r171484 to CMakelists.txt.

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

11 years agoDebug Info: fix the line location for cleanup code of a block function
Manman Ren [Fri, 4 Jan 2013 18:51:35 +0000 (18:51 +0000)]
Debug Info: fix the line location for cleanup code of a block function

The line information was changed when emitting debug information for all the
DeclRefExprs and we should change it back to get ready for PopClenupBlocks
called from FinishFunction.

rdar://11562117

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

11 years agoFix up various builtin declaration of objc_msgSend families
Fariborz Jahanian [Fri, 4 Jan 2013 18:45:40 +0000 (18:45 +0000)]
Fix up various builtin declaration of objc_msgSend families
to match those foung in objc.h an avoid spurious warnings.
// rdar://12489098

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

11 years ago[libclang] Introduce clang_getFileLocation.
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:13 +0000 (18:30 +0000)]
[libclang] Introduce clang_getFileLocation.

Uses of clang_getSpellingLocation should eventually move to calling
clang_getFileLocation, and clang_getSpellingLocation should do what
its name represents and actually point at the 'spelling' location, e.g.
inside a macro definition if the spelling of a token came from that.

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

11 years ago[arcmt] Allow removing an -autorelease of a variable initialized in the previous...
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:11 +0000 (18:30 +0000)]
[arcmt] Allow removing an -autorelease of a variable initialized in the previous statement.

rdar://11074996

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

11 years ago[arcmt] Adds brackets in case statements that "contain" initialization of retaining
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:08 +0000 (18:30 +0000)]
[arcmt] Adds brackets in case statements that "contain" initialization of retaining
variable, thus emitting the "switch case is in protected scope" error.

rdar://12952016

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

11 years agoMove the common source locations of CastStmt & DefaultStmt into their base class...
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:30:04 +0000 (18:30 +0000)]
Move the common source locations of CastStmt & DefaultStmt into their base class, SwitchCase.

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

11 years ago[arcmt] Don't error if an autoreleased variable is returned after the -autorelease.
Argyrios Kyrtzidis [Fri, 4 Jan 2013 18:29:59 +0000 (18:29 +0000)]
[arcmt] Don't error if an autoreleased variable is returned after the -autorelease.

rdar://12952025

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

11 years agoRemove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>
Douglas Gregor [Fri, 4 Jan 2013 18:22:19 +0000 (18:22 +0000)]
Remove -Wmodule-build; it was a dumb idea anyway. <rdar://problem/12957525>

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

11 years agoFix fieldNo usage for lambdas. No behavior change since the
Eric Christopher [Fri, 4 Jan 2013 17:59:07 +0000 (17:59 +0000)]
Fix fieldNo usage for lambdas. No behavior change since the
field number was 0 anyhow.

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

11 years agoWarn on unused auto variables.
Rafael Espindola [Thu, 3 Jan 2013 04:29:20 +0000 (04:29 +0000)]
Warn on unused auto variables.

To do so we have to wait until we know that the type of a variable has been
deduced. Sema::FinalizeDeclaration is the first callback that is used for
decl with or without initializers.

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

11 years agoUse early returns to reduce indentation.
Rafael Espindola [Thu, 3 Jan 2013 04:05:19 +0000 (04:05 +0000)]
Use early returns to reduce indentation.

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

11 years ago[arcmt] Rewrite uses of Block_copy/Block_release macros.
Argyrios Kyrtzidis [Thu, 3 Jan 2013 03:17:17 +0000 (03:17 +0000)]
[arcmt] Rewrite uses of Block_copy/Block_release macros.

  c = Block_copy(b);
  Block_release(c);
 ---->
  c = [b copy];
  <removed>

rdar://9408211

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

11 years agoFix capitalization of Objective-C in diagnostic.
Ted Kremenek [Thu, 3 Jan 2013 01:30:20 +0000 (01:30 +0000)]
Fix capitalization of Objective-C in diagnostic.

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

11 years agoMake MallocChecker debug output useful.
Ted Kremenek [Thu, 3 Jan 2013 01:30:12 +0000 (01:30 +0000)]
Make MallocChecker debug output useful.

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

11 years agoDon't assert/crash on reference variables in lambdas bound to a
Eli Friedman [Thu, 3 Jan 2013 00:39:26 +0000 (00:39 +0000)]
Don't assert/crash on reference variables in lambdas bound to a
static local variable from the parent scope.  PR14773.

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

11 years ago[analyzer] Rename callback EndPath -> EndFunction
Anna Zaks [Thu, 3 Jan 2013 00:25:29 +0000 (00:25 +0000)]
[analyzer] Rename callback EndPath -> EndFunction

This better reflects when callback is called and what the checkers
are relying on. (Both names meant the same pre-IPA.)

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

11 years agoAdd docs/README.txt to point to llvm/docs/README.txt.
Sean Silva [Wed, 2 Jan 2013 23:25:41 +0000 (23:25 +0000)]
Add docs/README.txt to point to llvm/docs/README.txt.

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

11 years agoanalyzer: add initial Sphinx configuration
Sean Silva [Wed, 2 Jan 2013 23:07:22 +0000 (23:07 +0000)]
analyzer: add initial Sphinx configuration

This is just the output of sphinx-quickstart. Now all that is needed
to begin converting the analyzer docs to reST is the server-side setup.

The analyzer folks have asked me to keep this segregated from the other
clang docs since the analyzer is a logically separate project (and has
its own separate web page) even though it resides in the clang tree.

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

11 years agoExclude docs/analyzer/ from the default Sphinx build.
Sean Silva [Wed, 2 Jan 2013 22:48:50 +0000 (22:48 +0000)]
Exclude docs/analyzer/ from the default Sphinx build.

This paves the way for converting the analyzer docs to Sphinx (by
setting up a nested Sphinx tree in this directory).

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

11 years ago[python bindings] Expose cursor.referenced (clang_getCursorReferenced).
Argyrios Kyrtzidis [Wed, 2 Jan 2013 22:31:57 +0000 (22:31 +0000)]
[python bindings] Expose cursor.referenced (clang_getCursorReferenced).

Patch by Matthew King!

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

11 years agohexagon-target-basic.c test: add REQUIRES line for hexagon target
Dmitri Gribenko [Wed, 2 Jan 2013 22:30:14 +0000 (22:30 +0000)]
hexagon-target-basic.c test: add REQUIRES line for hexagon target

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

11 years agoDiagnosticIds: Fix offset/ID calculation, no impact outside this code.
Argyrios Kyrtzidis [Wed, 2 Jan 2013 22:26:07 +0000 (22:26 +0000)]
DiagnosticIds: Fix offset/ID calculation, no impact outside this code.

Patch by Will Dietz:

Minor touchup so the values of Offset/ID reflect their intention.
Previously, the sum (Offset+ID) was correct, but Offset/ID
individually were wrong.

Caught by investigating unsigned overflow reported by -fsanitize=integer.

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

11 years agodocs: Mark ReleaseNotes as "In-Progress"
Sean Silva [Wed, 2 Jan 2013 22:05:33 +0000 (22:05 +0000)]
docs: Mark ReleaseNotes as "In-Progress"

Even though we do have a `.. warning::` directive on the page, hopefully
having "In-Progress" in the title will help to condition people's
expectations a bit for when they run into the extremely bare-bones
release notes.

Also, when release season comes around again, maybe this will get
people's attention and avoid confusion about what is going into the
upcoming release, and what is for changes to trunk for the next version.

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

11 years agodocs: Take advantage of extra level of headings.
Sean Silva [Wed, 2 Jan 2013 21:50:48 +0000 (21:50 +0000)]
docs: Take advantage of extra level of headings.

The way Sphinx treats the "top-level" adornments is weird. It usually
uses the first top-level adornment as the page title, even if the
top-level adornment is just one "section" out of many (i.e. if the first
section is "Introduction", then it will make the page title be
"Introduction"). This behavior can be overriden by using an explicit
`..  title::` directive to set the title.

Since the Sphinx stylesheet that Clang is currently using ('haiku')
nicely puts the document title at the top of the page in the header,
this weird default behavior was resulting in a redundant "title" in the
body content. Getting rid of this redundant level of headings
effectively "exposes" one more level of heading from the stylesheet to
which now makes the real "sections" more distinct.

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

11 years agoCorrect Hexagon DataLayout string. Fixes bug 14744.
Anshuman Dasgupta [Wed, 2 Jan 2013 21:25:57 +0000 (21:25 +0000)]
Correct Hexagon DataLayout string. Fixes bug 14744.

Patch by Krzysztof Parzyszek!

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

11 years agoType safety attributes: add tests for enumerations (users are actually doing
Dmitri Gribenko [Wed, 2 Jan 2013 21:12:03 +0000 (21:12 +0000)]
Type safety attributes: add tests for enumerations (users are actually doing
this, ensure we don't regress)

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

11 years agodocs: Curb excessive table-of-contents depth.
Sean Silva [Wed, 2 Jan 2013 21:09:58 +0000 (21:09 +0000)]
docs: Curb excessive table-of-contents depth.

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

11 years agodocs: Reorganize landing page.
Sean Silva [Wed, 2 Jan 2013 21:03:11 +0000 (21:03 +0000)]
docs: Reorganize landing page.

Language extensions are highly relevant to using clang as a compiler, so
move LanguageExtensions up into `Using Clang as a Compiler` on the
landing page.

The other documents from the now-gone `Language Extensions and Specs`
section on the landing page nicely fit hierarchically under
LanguageExtensions.rst, so put them under LanguageExtensions.rst's
toctree instead of on the landing page.

Impetus from Jordan Rose.

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

11 years agodocs: Fix spelling error.
Sean Silva [Wed, 2 Jan 2013 20:22:14 +0000 (20:22 +0000)]
docs: Fix spelling error.

Spotted by Nikola Smiljanic.

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

11 years agoRemove the anonymous namespace from lib/Sema/TreeTransform.h
Argyrios Kyrtzidis [Wed, 2 Jan 2013 19:10:22 +0000 (19:10 +0000)]
Remove the anonymous namespace from lib/Sema/TreeTransform.h

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

11 years agoFixes multiple formatting bugs.
Manuel Klimek [Wed, 2 Jan 2013 18:33:23 +0000 (18:33 +0000)]
Fixes multiple formatting bugs.

Fixes:
- incorrect handling of multiple consecutive preprocessor directives
- crash when trying to right align the escpaed newline for a line that
  is longer than the column limit
- using only ColumnLimit-1 columns when layouting with escaped newlines
  inside preprocessor directives

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

11 years agoDon't allow line breaks after template parameters.
Daniel Jasper [Wed, 2 Jan 2013 18:30:06 +0000 (18:30 +0000)]
Don't allow line breaks after template parameters.

This fixes llvm.org/PR14786.

We will need to split there as a last resort, but that should be done
consistently independent of whether the type is a template type or not.

Before:
template <typename T>
aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<T>
                    ::aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
template <typename T>
aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaaaaa,
                    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

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

11 years agoFormat */& as binary operator if followed by a unary operator.
Daniel Jasper [Wed, 2 Jan 2013 17:21:36 +0000 (17:21 +0000)]
Format */& as binary operator if followed by a unary operator.

This fixes llvm.org/PR14687.
Also fixes segfault for lines starting with * or &.

Before:
a *~b;
*a = 1;  // <- this segfaulted

After:
a * ~b;
*a = 1;  // no segfault :-)

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

11 years agoFixes use of unescaped newlines when formatting preprocessor directives.
Manuel Klimek [Wed, 2 Jan 2013 16:30:12 +0000 (16:30 +0000)]
Fixes use of unescaped newlines when formatting preprocessor directives.

This is the first step towards handling preprocessor directives. This
patch only fixes the most pressing issue, namely correctly escaping
newlines for tokens within a sequence of a preprocessor directive.

The next step will be to fix incorrect format decisions on #define
directives.

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

11 years agoCorrectly format pointers and references in casts.
Daniel Jasper [Wed, 2 Jan 2013 15:46:59 +0000 (15:46 +0000)]
Correctly format pointers and references in casts.

This fixes llvm.org/PR14747.

Before: Type *A = (Type * ) P;
After:  Type *A = (Type *) P;

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

11 years agoUnderstand unary operators after "return" and "case".
Daniel Jasper [Wed, 2 Jan 2013 15:26:16 +0000 (15:26 +0000)]
Understand unary operators after "return" and "case".

This fixes llvm.org/PR14746.

Before: return - 1;
After:  return -1;

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

11 years agoPrefer splitting after "template <...>" and fix indentation.
Daniel Jasper [Wed, 2 Jan 2013 15:08:56 +0000 (15:08 +0000)]
Prefer splitting after "template <...>" and fix indentation.

This addresses llvm.org/PR14699

Before:
template <typename T>
    void looooooooooooooooooooooongFunction(int Param1, int Param2);
template <typename T> void looooooooooooooooooooongFunction(
    int Paaaaaaaaaaaaaaaaaaaaram1, int Paaaaaaaaaaaaaaaaaaaaram2);

After:
template <typename T>
void looooooooooooooooooooooongFunction(int Param1, int Param2);
template <typename T>
void looooooooooooooooooooongFunction(int Paaaaaaaaaaaaaaaaaaaaram1,
                                      int Paaaaaaaaaaaaaaaaaaaaram2);

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

11 years agoPrefer to break after operators over breaking after "(".
Daniel Jasper [Wed, 2 Jan 2013 14:40:02 +0000 (14:40 +0000)]
Prefer to break after operators over breaking after "(".

Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa && aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &&
                                 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

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

11 years agodocs: `3.2` -> `3.3`
Sean Silva [Wed, 2 Jan 2013 13:25:05 +0000 (13:25 +0000)]
docs: `3.2` -> `3.3`

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

11 years agodocs: Remove useless discussion.
Sean Silva [Wed, 2 Jan 2013 13:23:37 +0000 (13:23 +0000)]
docs: Remove useless discussion.

The linked Makefile is always up to date, so there's no point in having
a rotting list of libraries.

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

11 years agodocs: Fix up HTML links to proper reST links.
Sean Silva [Wed, 2 Jan 2013 13:07:47 +0000 (13:07 +0000)]
docs: Fix up HTML links to proper reST links.

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

11 years agodocs: clang-format is coming down the pike, mention it
Sean Silva [Wed, 2 Jan 2013 12:49:25 +0000 (12:49 +0000)]
docs: clang-format is coming down the pike, mention it

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

11 years agodocs: Reorganize landing page.
Sean Silva [Wed, 2 Jan 2013 12:41:24 +0000 (12:41 +0000)]
docs: Reorganize landing page.

I clustered the docs by some intuitive/fuzzy notion of "similarity", and
some reasonable categories seemed to materialize. I tried to give the
clusters useful names, but you may want to take a look at the landing
page (<http://clang.llvm.org/docs/> for the lazy) and share your
thoughts.

I have to say, this small change really gives the docs a whole new life!
It makes our documentation quite a bit easier to navigate and scope out.

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

11 years agoremove random spaces
Sean Silva [Wed, 2 Jan 2013 12:40:31 +0000 (12:40 +0000)]
remove random spaces

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

11 years agodocs: Change title.
Sean Silva [Wed, 2 Jan 2013 12:40:15 +0000 (12:40 +0000)]
docs: Change title.

The core of this page is a set of pros/cons for the different ways to
use clang as a library. The title should reflect that the page helps you
choose between alternatives.

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

11 years agodocs: Decrease toctree depth on landing page.
Sean Silva [Wed, 2 Jan 2013 12:39:50 +0000 (12:39 +0000)]
docs: Decrease toctree depth on landing page.

Having the table of contents there was making it hard to easily see at a
glance all the docs we have.

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

11 years agodocs: Sphinx conversion is "done"
Sean Silva [Wed, 2 Jan 2013 12:39:02 +0000 (12:39 +0000)]
docs: Sphinx conversion is "done"

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

11 years agos/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby ...
Richard Smith [Wed, 2 Jan 2013 12:01:23 +0000 (12:01 +0000)]
s/CXX0X/CXX11/g, except for __GNU_EXPERIMENTAL_CXX0X__, and update a few nearby 'C++0x' comments.

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

11 years agoRewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
Chandler Carruth [Wed, 2 Jan 2013 11:45:17 +0000 (11:45 +0000)]
Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to
reflect the migration in r171366.

Re-sort the #include lines to reflect the new paths.

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

11 years agos/CPlusPlus0x/CPlusPlus11/g
Richard Smith [Wed, 2 Jan 2013 11:42:31 +0000 (11:42 +0000)]
s/CPlusPlus0x/CPlusPlus11/g

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

11 years agoRe-sort #include lines using the llvm/utils/sort_includes.py script.
Chandler Carruth [Wed, 2 Jan 2013 10:28:36 +0000 (10:28 +0000)]
Re-sort #include lines using the llvm/utils/sort_includes.py script.

Removes a duplicate #include as well as cleaning up some sort order
regressions since I last ran the script over Clang.

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

11 years agoUnderstand * and & in ternary expressions.
Daniel Jasper [Wed, 2 Jan 2013 08:57:10 +0000 (08:57 +0000)]
Understand * and & in ternary expressions.

Before: "int a = b ? *c : * d;"
After: "int a = b ? *c : *d;

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

11 years agoDon't break after pointer or reference specifier.
Daniel Jasper [Wed, 2 Jan 2013 08:44:14 +0000 (08:44 +0000)]
Don't break after pointer or reference specifier.

This fixes llvm.org/PR14717.
Buggy format:
TypeSpecDecl *
    TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                         IdentifierInfo *II, Type *T) {

Now changed to:
TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC,
                                   SourceLocation L, IdentifierInfo *II,
                                   Type *T) {

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

11 years agoConvert an if that never happens to an assert.
Rafael Espindola [Wed, 2 Jan 2013 04:19:07 +0000 (04:19 +0000)]
Convert an if that never happens to an assert.

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

11 years agoSimplify vector splat code. No functionality change.
Benjamin Kramer [Tue, 1 Jan 2013 20:08:10 +0000 (20:08 +0000)]
Simplify vector splat code. No functionality change.

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

11 years agoUpdate the copyright coredits -- Happy new year 2013!
NAKAMURA Takumi [Tue, 1 Jan 2013 10:00:19 +0000 (10:00 +0000)]
Update the copyright coredits -- Happy new year 2013!

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

11 years agoSilence some warnings and allow passing down some feature flags to the linker.
Rafael Espindola [Mon, 31 Dec 2012 22:41:36 +0000 (22:41 +0000)]
Silence some warnings and allow passing down some feature flags to the linker.
Patch by Brad Smith.

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

11 years agoFix minor copy-pasto. No functionality change.
Nico Weber [Mon, 31 Dec 2012 02:59:14 +0000 (02:59 +0000)]
Fix minor copy-pasto. No functionality change.

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

11 years agoRemove some remnants of OwningExprResult / OwningStmtResult.
Nico Weber [Mon, 31 Dec 2012 00:28:03 +0000 (00:28 +0000)]
Remove some remnants of OwningExprResult / OwningStmtResult.

These got deleted late 2010 during the Actions/Sema unification.
No functionality change.

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

11 years agoSimplify. No functionality change.
Nico Weber [Sun, 30 Dec 2012 23:36:56 +0000 (23:36 +0000)]
Simplify. No functionality change.

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

11 years agoDon't warn on unused member functions that are extern because of a typedef.
Rafael Espindola [Sun, 30 Dec 2012 21:42:26 +0000 (21:42 +0000)]
Don't warn on unused member functions that are extern because of a typedef.

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

11 years agoFormatter: parse and format inline namespaces like regular namespaces
Dmitri Gribenko [Sun, 30 Dec 2012 21:27:25 +0000 (21:27 +0000)]
Formatter: parse and format inline namespaces like regular namespaces

This changes formatting from:

inline namespace X {
  class A {
  };
}

to:

inline namespace X {
class A {
};
}

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

11 years ago[ubsan] Recover by default, use -fno-sanitize-recover to disable.
Will Dietz [Sun, 30 Dec 2012 20:53:28 +0000 (20:53 +0000)]
[ubsan] Recover by default, use -fno-sanitize-recover to disable.

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

11 years agoUse hasCLanguageLinkage when warning about non C return types.
Rafael Espindola [Sun, 30 Dec 2012 20:40:41 +0000 (20:40 +0000)]
Use hasCLanguageLinkage when warning about non C return types.

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

11 years agoComment lexing: replace manual comparison with StringRef::find_first_of
Dmitri Gribenko [Sun, 30 Dec 2012 19:45:46 +0000 (19:45 +0000)]
Comment lexing: replace manual comparison with StringRef::find_first_of

This gives an about 1.8% improvement on Clang bootstrap with -Wdocumentation

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

11 years agoDon't get confused if a extern "C" builtin function is redeclared without
Rafael Espindola [Sun, 30 Dec 2012 17:23:09 +0000 (17:23 +0000)]
Don't get confused if a extern "C" builtin function is redeclared without
the extern "C".

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

11 years agoRemove the Function::getFnAttributes method in favor of using the AttributeSet
Bill Wendling [Sun, 30 Dec 2012 10:32:17 +0000 (10:32 +0000)]
Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.

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

11 years agoDon't warn for undefined but used decls that are external because of a typedef.
Rafael Espindola [Sat, 29 Dec 2012 23:43:00 +0000 (23:43 +0000)]
Don't warn for undefined but used decls that are external because of a typedef.

This fixes pr14736. It is fairly ugly, but I don't think we can do much better
as we have to wait at least until the end of the typedef to know if the
function will have external linkage or not.

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