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

41835 Коммитов

Автор SHA1 Сообщение Дата
Daniel Jasper f39c8859b0 Don't try to align builder-type continuations on assignments.
Before:
int aaaa = aaaaa().aaaaa() // force break
           .aaaaa();
After:
int aaaa = aaaaa().aaaaa() // force break
    .aaaaa();

The other indent is just wrong and confusing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173273 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 16:58:21 +00:00
Dmitri Gribenko b76d9718ca Constify some getters in RedeclarableTemplateDecl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173272 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 16:52:57 +00:00
Dmitri Gribenko e4ea879fe7 Remove uneeded casts
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173269 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 15:56:07 +00:00
Daniel Jasper 13cb7c2c46 Don't try to do a hanging ident after assignments.
Before:
bool aaaa = aaaaaaaaaaa(
                aaaaaaaaaaaaaaaaa);

After:
bool aaaa = aaaaaaaaaaa(
    aaaaaaaaaaaaaaaaa);

The other indentation was a nice attempt but doesn't work in many cases.
Not sure what the right long term solution is as the "After: " is still
not nice. We either need to figure out what to do in the cases where it
"doesn't work" or come up with a third solution, e.g. falling back to:

bool aaaa =
    aaaaaaaaaaa(
        aaaaaaaaaaaaaaaaa);

which should always work and nicely highlight the structure.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173268 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 15:55:19 +00:00
Manuel Klimek 7ccbc2156b Fix handling of macro definitions.
Now correctly formats:
 #define A (1)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173264 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 14:37:36 +00:00
Manuel Klimek a32a7fda31 Fixes layouting regression and invalid-read.
Layouting would prevent breaking before + in
a[b + c] = d;
Regression detected by code review.

Also fixes an invalid-read found by the valgrind bot.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173262 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 14:08:21 +00:00
Daniel Jasper 20d3583857 Fix the formatting of pointer/reference types in range-based for loops.
Before: for (int & a : Values) {}
After:  for (int &a : Values) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173259 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 12:58:14 +00:00
Daniel Jasper 7006e7ebc0 Removing the penalty for breaking after "=".
Having seen more cases, this actually was not a good thing to do in the
first place. We can still improve on what we do now, but breaking after
the "=" is good in many cases.

Before:
aaaaaaaaaaaaa = aa->aaaaaaaaaaaaaaaaaaaa(
                    aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

After:
aaaaaaaaaaaaa =
    aa->aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaa));

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173257 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 12:27:43 +00:00
Daniel Jasper 4bfc65aab5 Fix another regression for pointer types.
Before: if (int * a = &b) ...
After:  if (int *a = &b) ...

Also changed all the existing tests to test the expressions in question
both in a declaration and in an expression context.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173256 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 12:10:53 +00:00
Joey Gouly 19dbb20ac4 Add a new LangOpt NativeHalfType. This option allows for native half/fp16
operations (as opposed to storage only half/fp16).

Also add some semantic checks for OpenCL half types.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173254 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 11:56:20 +00:00
Daniel Jasper 218b6dfaee Fix regression in formatting pointer types.
We will need a more principled solution, but we should not leave this
unfixed until we come up with one.

Before: void f() { int * a; }
After:  void f() { int *a; }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173252 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 11:15:14 +00:00
Manuel Klimek 836b58f564 Fixes incorrect handling of the declaration context stack.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173250 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 11:03:04 +00:00
Manuel Klimek 092a2c7373 Fix segfaults in the formatter.
Also: expletive deleted.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173247 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 10:09:28 +00:00
Daniel Jasper 8f4bd7a20f Add option to allow putting all parameters onto the next line.
This only affects styles where BinPackParameters is false.

With AllowAllParametersOnNextLine:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaaaa);

Without it:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaa,
                                         aaaaaaaaaa,
                                         aaaaaaaaaa,
                                         aaaaaaaaaaa,
                                         aaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173246 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 10:08:28 +00:00
Manuel Klimek 70b03f4eda Allow us to better guess the context of an unwrapped line.
This gives us the ability to guess better defaults for whether a *
between identifiers is a pointer dereference or binary operator.

Now correctly formats:
void f(a *b);
void f() { f(a * b); }

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173243 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 09:32:48 +00:00
Bill Wendling 69652660e7 Explicitly cast away the const-ness instead of doing it implicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173241 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 08:58:23 +00:00
Bill Wendling ccdfdd7937 Explicitly cast away the const-ness instead of doing it implicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173232 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 08:25:41 +00:00
Bill Wendling 89530e4572 Remove the last of uses that use the Attribute object as a collection of attributes.
Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173229 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 06:15:10 +00:00
Nick Lewycky 3edf387e43 Make __attribute__((nonnull)) use the general expression evaluator to search for
nulls instead of limiting itself to the language-defined "null pointer
constant".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173227 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 05:08:29 +00:00
NAKAMURA Takumi d069c3d9cb clang/test/Driver/output-file-is-dir.c: This requires shell due to 'cd'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173218 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 01:25:23 +00:00
Daniel Dunbar 6ea3a2a6fa [Driver] Don't remove non-regular files that were outputs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173215 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 01:08:23 +00:00
James Dennett 18f43a6213 Documentation cleanup: fixing documentation for FrontendAction.
* Fix a typo, s/BeginSourceAction/BeginSourceFile/, so that the documentation
  for FrontendAction::BeginSourceFileAction links correctly to BeginSourceFile;
* Add some basic \file documentation for FrontendAction.h;
* More use of "\brief" instead of repeating the name of the entity being
  documented;
* Stop using Doxygen-style "///" comments in FrontendAction.cpp, as they were
  polluting the documentation for BeginSourceFile;
* Drop incorrect "\see" markup that broke Doxygen's formatting;
* Other minor documentation fixes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173213 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 00:45:44 +00:00
Bill Wendling 909b6ded6b Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173211 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-23 00:21:06 +00:00
Douglas Gregor 3cc6277a3d Fix compilation on Linux, which defines PATH_MAX in a weird place,
from Saleem Abdulrasool!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173208 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 23:49:45 +00:00
Chad Rosier bce9205e43 Add a triple, per Ben's suggestion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173198 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 21:39:58 +00:00
Chad Rosier bd00bdb4f7 Second attempt to fix ppc bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173193 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 20:57:10 +00:00
Chad Rosier 80d38eb7f2 Add x86 requirement to hopefully fix ppc bots.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173190 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 20:16:41 +00:00
Adhemerval Zanella b0fc94ceaf PowerPC: fix __builtin_eh_return_data_regno return
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173188 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 20:02:45 +00:00
Chad Rosier b2e2157f90 [ms-inline asm] Remove the -fenable-experimental-ms-inline-asm flag. MS-style
inline assembly can be enable with -fasm-blocks or -fms-extensions alone.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173186 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 19:38:32 +00:00
Ted Kremenek d6ec473638 Split "discards qualifiers" warnings of -Wincompatible-pointer-types into subgroup.
This allows users to promote -Wincompatible-pointer-type warnings to
errors but keep those for "discard qualifiers" as warnings (if they
so desire).

Addresses <rdar://problem/13062738>.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173184 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 19:32:27 +00:00
Dmitri Gribenko 68c4146047 Update docs: nullptr conversion tool landed
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173183 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 19:22:22 +00:00
Fariborz Jahanian 3548068c22 Small code change to improve performance
in my last patch, suggested by Argyrios.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173182 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 19:05:17 +00:00
Fariborz Jahanian 48f3cc2b2b objectiveC (take two): don't warn when in -Wselector mode and
an unimplemented selector is consumed by
"respondsToSelector:". // rdar://12938616


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173179 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 18:35:43 +00:00
Chad Rosier c666cf404d [ms-inline asm] Remove a warning about ms-style inline assembly not being
supported.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173177 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 18:18:22 +00:00
Douglas Gregor e0d2066ab8 Make getDefinitiveDeclContext() actually return a DeclContext, as one
would expect, and clean up the return/break inconsistencies. Thanks,
Sebastian!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173171 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 17:08:30 +00:00
Nico Weber 3a344f9fc7 Fix a bug in VarDecl::getSourceRange() for static member arrays with an element
type with an implicit initializer expression.

Patch from Will Wilson <will@indefiant.com>!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173170 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 17:00:09 +00:00
Nico Weber f5ecfa5b4f Formatter: Remove a fixme klimek fixed in r173168.
Add a few comments to the ObjC test cases.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173169 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 16:53:59 +00:00
Manuel Klimek 86721d2a46 Implements more principled comment parsing.
Changing nextToken() in the UnwrappedLineParser to get the next
non-comment token. This allows us to correctly layout a whole class of
snippets, like:

if /* */(/* */ a /* */) /* */
  f() /* */; /* */
else /* */
  g();

Fixes a bug in the formatter where we would assume there is a previous
non-comment token.
Also adds the indent level of an unwrapped line to the debug output in
the parser.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173168 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 16:31:55 +00:00
Daniel Jasper 3298327e0e Let the formatter be more restrictive for breaking around . and ->
Before:
aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaa)
    .aaaaaaaaaaaaaaaaaa();

After:
aaaaaaaaaaaaaaa(aaaaaaaaa, aaaaaaaaa,
                aaaaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaa();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173160 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 14:28:24 +00:00
Daniel Jasper ffee17126e Fix "*" formatting when creating arrays of pointers.
Before: A = new int * [10]();
After:  A = new int *[10]();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173150 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 11:46:26 +00:00
Tim Northover 9ec55f24b8 Switch to APFloat constructor taking fltSemantics.
This change also makes the serialisation store the required semantics,
fixing an issue where PPC128 was always assumed when re-reading a
128-bit value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173139 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 09:46:51 +00:00
Alexander Potapenko 6a94c1ea2d [ASan] Fixed darwin-sanitizer-ld.c to match the flags after the switch to the dynamic runtime.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173137 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 09:27:00 +00:00
Alexander Potapenko 454028e1be [ASan] Link with the dynamic runtime on OS X
This patch changes the behavior of the -fsanitize=address flag, making it use the dynamic runtime library (libclang_rt.asan_osx_dynamic.dylib) instead of the static one. It also drops the CoreFoundation dependency, since the dynamic runtime doesn't need it.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173135 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 09:16:03 +00:00
NAKAMURA Takumi 6f7eeb9a97 libclang: Update comment about USEDLIBS in c-*-test/Makefile.
"Note that 'USEDLIBS' must include all of the core clang libraries when -static is given to linker on cygming."

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173124 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 04:11:33 +00:00
John McCall b62faef5ec Use the correct field to copy/dispose a __block variable.
We were previously hard-coding a particular field index.  This was
fine before (because we were obviously guaranteed the presence
of a copy/dispose member) except for (1) alignment padding and
(2) future extensions adding extra members to the header, such
as the extended-layout pointer.

Note that we only introduce the extended-layout pointer in the
presence of structs.  (We also seem to be introducing it even
in the presence of an all-non-object layout, but that's a
different potential issue.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173122 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 03:56:22 +00:00
NAKAMURA Takumi 614323cc1c clang/test/Index/comment-to-html-xml-conversion.cpp: Mark this as XFAIL:valgrind, for now. Working in progress.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173121 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 03:49:16 +00:00
NAKAMURA Takumi cc128e90b4 clang/test: [CMake] check-clang doesn't require llvm-dis any more.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173116 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 01:52:04 +00:00
NAKAMURA Takumi a7246da6ad clang/test/CodeGen: Nuke llvm's opt and llvm-dis, and FileCheck-ize two tests. -O1 is sufficient here.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173115 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 01:51:59 +00:00
NAKAMURA Takumi 146254fb4e clang/test/CodeGen/2006-01-13-StackSave.c: Nuke llvm's opt and llvm-dis, and FileCheck-ize.
@llvm.stacksave is emitted regardless of "opt -std-compile-opts". We have optimizers' tests in llvm/test/Transforms.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173114 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 01:51:54 +00:00
NAKAMURA Takumi 9627bb6e00 clang/test/CodeGen/blocks-seq.c: FileCheck-ize.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173113 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-22 01:51:48 +00:00