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

42824 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 9352a62f27 Test for my last patch. // rdar://13178483
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175453 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 19:02:44 +00:00
Argyrios Kyrtzidis 91d243b601 Add include guards for CommentVisitor.h
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175451 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 18:31:16 +00:00
Fariborz Jahanian 0dc4ff2209 Prevent crash on multiple user errors (which I cannot reproduce in
a small test case). // rdar://13178483.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175450 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 17:22:23 +00:00
Douglas Gregor 3b1a40fedc CodeGenFunction::CurFuncDecl can be NULL; fix crash introduced in r175386.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175448 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 15:59:24 +00:00
Douglas Gregor aa945900d5 Ensure that the identifier chains have the most recent declaration after module deserialization.
This commit introduces a set of related changes to ensure that the
declaration that shows up in the identifier chain after deserializing
declarations with a given identifier is, in fact, the most recent
declaration. The primary change involves waiting until after we
deserialize and wire up redeclaration chains before updating the
identifier chains. There is a minor optimization in here to avoid
recursively deserializing names as part of looking to see whether
top-level declarations for a given name exist.

A related change that became suddenly more urgent is to property
record a merged declaration when an entity first declared in the
current translation unit is later deserialized from a module (that had
not been loaded at the time of the original declaration). Since we key
off the canonical declaration (which is parsed, not from an AST file)
for emitted redeclarations, we simply record this as a merged
declaration during AST writing and let the readers merge them.

Re-fixes <rdar://problem/13189985>, presumably for good this time.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175447 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 15:53:43 +00:00
Daniel Jasper 82282dc907 Improve indentation of builder type calls.
In builder-type calls, it can be very confusing to just indent
parameters from the start of the line. Instead, indent 4 from the
correct function call.

Before:
aaaaaaaaaaaaaaaaaaa()->aaaaaa(bbbbb)->aaaaaaaaaaaaaaaaaaa( // break
    aaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa = aaaaaa->aaaaaaaaaaaa()->aaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
    ->aaaaaaaaaaaaaaaaa();

After:
aaaaaaaaaaaaaaaaaaa()->aaaaaa(bbbbb)->aaaaaaaaaaaaaaaaaaa( // break
                                        aaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaa *aaaaaaaaa = aaaaaa->aaaaaaaaaaaa()
    ->aaaaaaaaaaaaaaaa(
        aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
    ->aaaaaaaaaaaaaaaaa();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175444 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 13:52:06 +00:00
Daniel Jasper 515f65df40 Improve formatting of builder-type calls.
Before:
aaaaaaa->aaaaaaa->aaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)->aaaaaaaa(aaaaaaaaaaaaaaa);

After:
aaaaaaa->aaaaaaa
    ->aaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)
    ->aaaaaaaa(aaaaaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175441 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 13:24:21 +00:00
Daniel Jasper 29333160cf Reformat lines if they were "moved around".
An unwrapped line can get moved around if there is no newline before
it and the previous line was formatted.

Example:

  template<typename T>  // Cursor is on this line when hitting "format"
  T *getFETokenInfo() const { return static_cast<T*>(FETokenInfo); }

"return .." is the second unwrapped line in this scenario. I does not
touch any reformatted region. Thus, the result of formatting is:

  template <typename T> T *getFETokenInfo() const { return static_cast<T *>(FETokenInfo); }

After second format (and arguably desired end-result):

  template <typename T> T *getFETokenInfo() const {
      return static_cast<T *>(FETokenInfo);
  }

This fixes: llvm.org/PR15060.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175440 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 13:08:03 +00:00
Daniel Jasper d0f349be14 Correctly determine */& usage in more cases.
This fixes llvm.org/PR15248.

Before:
Test::Test(int b) : a(b *b) {}
for (int i = 0; i < a *a; ++i) {}

After:
Test::Test(int b) : a(b * b) {}
for (int i = 0; i < a * a; ++i) {}

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175439 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 12:44:35 +00:00
Tim Northover 6a93c86fc7 AArch64: add atomic support parameters to TargetInfo
This allows Clang to detect and deal wih __atomic_* operations properly on
AArch64. Previously we produced an error when encountering them at high
optimisation levels.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175438 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 12:11:32 +00:00
Daniel Jasper 66d19bdeef Always break after multi-line string literals.
Otherwise, other parameters can be quite hidden.
Reformatted unittests/Format/FormatTest.cpp after this.

Before:
someFunction("Always break between multi-line"
             " string literals", and, other, parameters);

After:
someFunction("Always break between multi-line"
             " string literals",
             and, other, parameters);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175436 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 11:59:17 +00:00
Daniel Jasper cf5767d65a Prevent line breaks that make stuff hard to read.
Before:
aaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaa).aaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaa, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa)
    .aaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa)
    .aaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaa,
                         aaaaaaaaaaaaaaaaaaa,
                         aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175432 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 11:05:07 +00:00
David Blaikie 6b8f37a565 Update test cases to account for DIBuilder type changes.
Paired commit with LLVM, may produce temporary build breakage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175427 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 07:27:35 +00:00
Ted Kremenek 724cfee8b5 Disable dead stores checker for template instantations. Fixes <rdar://problem/13213575>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175425 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 07:18:28 +00:00
Eric Christopher f110a9c687 Fix up grammar a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175418 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 04:38:06 +00:00
Eric Christopher 6c7db8967c Unify some "kernel or kext" conditionals.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175414 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 01:16:37 +00:00
Eric Christopher 3fcdea7115 Add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175412 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 00:38:34 +00:00
Eric Christopher cfc01e45dd Clean up comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175411 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 00:38:31 +00:00
Eric Christopher d4440c230d Grammar.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175410 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 00:38:28 +00:00
Eric Christopher 0798b69ee4 Unify some code. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175409 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-18 00:38:25 +00:00
Dmitri Gribenko e50e91d4a6 Test ivar-invariant.m: use a more idiomatic RUN line and tighten the test
by matching the function name first


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175395 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 14:59:41 +00:00
Lang Hames e95036b2f5 Remove block names from test case to unbreak release builds.
Thanks Chandler. :)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 10:18:28 +00:00
James Dennett 6c31f7c56f Documentation: use \brief and don't duplicate the name of the declared entity
at the start of the doc comment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175391 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 08:24:19 +00:00
James Dennett 49d7111bd4 Documentation cleanup: fix a typo ("////" for "///") and suppress Doxygen's
automatic link generation for "file:", as it's not used as a URL here.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175390 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 08:19:35 +00:00
Lang Hames 56c00c4868 Re-apply r174919 - smarter copy/move assignment/construction, with fixes for
bitfield related issues.

The original commit broke Takumi's builder. The bug was caused by bitfield sizes
being determined by their underlying type, rather than the field info. A similar
issue with bitfield alignments showed up on closer testing. Both have been fixed
in this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 07:22:09 +00:00
Saleem Abdulrasool 28a2cecfda [clang] fix test execution command
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175387 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 04:13:35 +00:00
Saleem Abdulrasool 961f570878 [CodeGen] tighten objc ivar invariant.load attribution
An ivar ofset cannot be marked as invariant load in all cases.  The ivar offset
is a lazily initialised constant, which is dependent on an objc_msgSend
invocation to perform a fixup of the offset.  If the load is being performed on
a method implemented by the class then this load can safely be marked as an
inviarant because a message must have been passed to the class at some point,
forcing the ivar offset to be resolved.

An additional heuristic that can be used to identify an invariant load would be
if the ivar offset base is a parameter to an objc method.  However, without the
parameters available at hand, this is currently not possible.

Reviewed-by: John McCall <rjmccall@apple.com>
Signed-off-by: Saleem Abdulrasool <compnerd@compnerd.org>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175386 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 04:03:34 +00:00
Dmitri Gribenko 97e948e9c9 Fix for ARM: functions don't have extra attributes there, so {{.*}} is ""
While there, explicitly declare functions to remove warnings.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175384 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-17 03:06:16 +00:00
Dmitri Gribenko 959dc8475f Use trailing documentation comments properly
Patch by Alexander Zinenko.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175376 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 22:21:38 +00:00
Dmitri Gribenko 6ba52aab96 Use the correct type to hold enumeration values
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175374 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 20:03:26 +00:00
James Dennett c34464ee33 Documentation cleanup: make a \brief be brief, and fix a bad use of \see.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175340 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 08:16:47 +00:00
James Dennett 1216015de0 Documentation cleanup: use \brief, and don't repeat the identifier being
declared.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175339 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 07:45:22 +00:00
Jordan Rose 12e0c13819 libAnalysis: Add a case for TypeAliasDecl in CFGRecStmtDeclVisitor.
Neither of the current clients of CFGRecStmtDeclVisitor are doing
anything with typedefs, so I assume type aliases (C++11 "using")
can be safely ignored. This was causing assertion failures in
the analyzer.

<rdar://problem/13228440>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175335 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 01:33:16 +00:00
Dmitri Gribenko cb6bcf1c63 libclang: remove reinterpret_casts by using SourceLocation::getPtrEncoding
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175333 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 01:07:48 +00:00
Dmitri Gribenko 0076ea62c2 Remove unused forward declarations
clang/AST/Decl.h is included to see the TypeSourceInfo definition anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175332 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 01:06:07 +00:00
David Blaikie 896c7dd628 Don't warn on conversion from NULL to nullptr_t
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175331 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 00:56:22 +00:00
Richard Smith b4127a28a6 Emit vtables for an extern template class as available_externally, not as
linkonce_odr. Emit construction vtables as internal in this case, since the ABI
does not guarantee that they will be availble externally.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175330 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 00:51:21 +00:00
Argyrios Kyrtzidis 7640b02a56 [PCH] Deserializing the DeclContext of a template parameter is not safe
until recursive loading is finished.

Otherwise we may end up with a template trying to deserialize a template
parameter that is in the process of getting loaded.

rdar://13135282

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175329 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 00:48:59 +00:00
Dmitri Gribenko 8f2fcd3ad1 Remove unused forward declarations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175328 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 00:41:34 +00:00
John McCall 5a758de93f Rework the visibility computation algorithm in preparation
for distinguishing type vs. value visibility.

The changes to the visibility of explicit specializations
are intentional.  The change to the "ugly" test case is
a consequence of a sensible implementation, and I am happy
to argue that this is better behavior.  Other changes may
or may not be intended;  it is quite difficult to divine
intent from some of the code I altered.

I've left behind a comment which I hope explains the
philosophy behind visibility computation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175326 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-16 00:17:33 +00:00
Chad Rosier a6e0a0db0a Add test case for r175312.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175313 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 21:58:41 +00:00
Bill Wendling c0dcc2d7be Add the 'target-cpu' and 'target-features' attributes to functions.
The back-end will use these values to reconfigure code generation for different
features.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175308 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 21:30:01 +00:00
Dmitri Gribenko ae03d8e52d libclang: add clang_getTypeSpelling(CXType CT)
Adds a function clang_getTypeSpelling(CXType CT) that returns
a CXString containing the underlying type.

Patch by Ben Gertzfield.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175299 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 21:15:49 +00:00
Fariborz Jahanian 17c1a2e748 objective-C: Fixes a compiler crash when encoding
an ivar of type pointer to a typedef'ed object.
// rdar://13190095


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175298 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 21:14:50 +00:00
Daniel Jasper 4a544e5856 Recognize < and > as binary expressions in builder-type calls.
The current heuristic assumes that there can't be binary operators in
builder-type calls (excluding assigments). However, it also excluded
< and > in general, which is wrong. Now they are only excluded if they
are template parameters.

Before:
return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa()i
       .aaaaaa() < aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();

After:
return aaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa() <
       aaaaaaaaaaaaaaaaaaa->aaaaa().aaaaaaaaaaaaa().aaaaaa();

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175291 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 20:33:06 +00:00
Enea Zaffanella 3285c78041 Fixed diagnostic nondeterministic order bug (pr14901).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175289 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 20:09:55 +00:00
Daniel Jasper dc2efa1c10 Done break between 'operator' and '<<'.
Before:
ostream &operator
    <<(ostream &out, some::ns::SomeReallyLongType WithSomeReallyLongValue);

After:
ostream &operator<<(ostream &out,
                    some::ns::SomeReallyLongType WithSomeReallyLongValue);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175286 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 19:24:08 +00:00
Argyrios Kyrtzidis db546fa2ce Fix crash-on-invalid where a ParenListExpr shows up as a message receiver
while trying to do error recovery.

rdar://13207886

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 18:34:15 +00:00
Argyrios Kyrtzidis 820b23dc92 When a statement is dropped from the AST because it was invalid, make sure
we don't do the scope checks otherwise we are going to hit assertion checks
since a label may not have been actually added.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175281 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 18:34:13 +00:00
Daniel Jasper b130a54940 Re-enable ConstructorInitializerAllOnOneLineOrOnePerLine option.
This got lost and was untested as the same effect is achieved by
avoiding bin packing, which is active in Google style by default.
However, moving forward, we want more control over the bin packing
option(s) and thus, this flag should work as expected.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175277 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-15 16:49:44 +00:00