]> granicus.if.org Git - clang/log
clang
11 years agoTest ivar-invariant.m: use a more idiomatic RUN line and tighten the test
Dmitri Gribenko [Sun, 17 Feb 2013 14:59:41 +0000 (14:59 +0000)]
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

11 years agoRemove block names from test case to unbreak release builds.
Lang Hames [Sun, 17 Feb 2013 10:18:28 +0000 (10:18 +0000)]
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

11 years agoDocumentation: use \brief and don't duplicate the name of the declared entity
James Dennett [Sun, 17 Feb 2013 08:24:19 +0000 (08:24 +0000)]
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

11 years agoDocumentation cleanup: fix a typo ("////" for "///") and suppress Doxygen's
James Dennett [Sun, 17 Feb 2013 08:19:35 +0000 (08:19 +0000)]
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

11 years agoRe-apply r174919 - smarter copy/move assignment/construction, with fixes for
Lang Hames [Sun, 17 Feb 2013 07:22:09 +0000 (07:22 +0000)]
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

11 years ago[clang] fix test execution command
Saleem Abdulrasool [Sun, 17 Feb 2013 04:13:35 +0000 (04:13 +0000)]
[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

11 years ago[CodeGen] tighten objc ivar invariant.load attribution
Saleem Abdulrasool [Sun, 17 Feb 2013 04:03:34 +0000 (04:03 +0000)]
[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

11 years agoFix for ARM: functions don't have extra attributes there, so {{.*}} is ""
Dmitri Gribenko [Sun, 17 Feb 2013 03:06:16 +0000 (03:06 +0000)]
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

11 years agoUse trailing documentation comments properly
Dmitri Gribenko [Sat, 16 Feb 2013 22:21:38 +0000 (22:21 +0000)]
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

11 years agoUse the correct type to hold enumeration values
Dmitri Gribenko [Sat, 16 Feb 2013 20:03:26 +0000 (20:03 +0000)]
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

11 years agoDocumentation cleanup: make a \brief be brief, and fix a bad use of \see.
James Dennett [Sat, 16 Feb 2013 08:16:47 +0000 (08:16 +0000)]
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

11 years agoDocumentation cleanup: use \brief, and don't repeat the identifier being
James Dennett [Sat, 16 Feb 2013 07:45:22 +0000 (07:45 +0000)]
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

11 years agolibAnalysis: Add a case for TypeAliasDecl in CFGRecStmtDeclVisitor.
Jordan Rose [Sat, 16 Feb 2013 01:33:16 +0000 (01:33 +0000)]
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

11 years agolibclang: remove reinterpret_casts by using SourceLocation::getPtrEncoding
Dmitri Gribenko [Sat, 16 Feb 2013 01:07:48 +0000 (01:07 +0000)]
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

11 years agoRemove unused forward declarations
Dmitri Gribenko [Sat, 16 Feb 2013 01:06:07 +0000 (01:06 +0000)]
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

11 years agoDon't warn on conversion from NULL to nullptr_t
David Blaikie [Sat, 16 Feb 2013 00:56:22 +0000 (00:56 +0000)]
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

11 years agoEmit vtables for an extern template class as available_externally, not as
Richard Smith [Sat, 16 Feb 2013 00:51:21 +0000 (00:51 +0000)]
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

11 years ago[PCH] Deserializing the DeclContext of a template parameter is not safe
Argyrios Kyrtzidis [Sat, 16 Feb 2013 00:48:59 +0000 (00:48 +0000)]
[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

11 years agoRemove unused forward declarations
Dmitri Gribenko [Sat, 16 Feb 2013 00:41:34 +0000 (00:41 +0000)]
Remove unused forward declarations

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

11 years agoRework the visibility computation algorithm in preparation
John McCall [Sat, 16 Feb 2013 00:17:33 +0000 (00:17 +0000)]
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

11 years agoAdd test case for r175312.
Chad Rosier [Fri, 15 Feb 2013 21:58:41 +0000 (21:58 +0000)]
Add test case for r175312.

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

11 years agoAdd the 'target-cpu' and 'target-features' attributes to functions.
Bill Wendling [Fri, 15 Feb 2013 21:30:01 +0000 (21:30 +0000)]
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

11 years agolibclang: add clang_getTypeSpelling(CXType CT)
Dmitri Gribenko [Fri, 15 Feb 2013 21:15:49 +0000 (21:15 +0000)]
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

11 years agoobjective-C: Fixes a compiler crash when encoding
Fariborz Jahanian [Fri, 15 Feb 2013 21:14:50 +0000 (21:14 +0000)]
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

11 years agoRecognize < and > as binary expressions in builder-type calls.
Daniel Jasper [Fri, 15 Feb 2013 20:33:06 +0000 (20:33 +0000)]
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

11 years agoFixed diagnostic nondeterministic order bug (pr14901).
Enea Zaffanella [Fri, 15 Feb 2013 20:09:55 +0000 (20:09 +0000)]
Fixed diagnostic nondeterministic order bug (pr14901).

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

11 years agoDone break between 'operator' and '<<'.
Daniel Jasper [Fri, 15 Feb 2013 19:24:08 +0000 (19:24 +0000)]
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

11 years agoFix crash-on-invalid where a ParenListExpr shows up as a message receiver
Argyrios Kyrtzidis [Fri, 15 Feb 2013 18:34:15 +0000 (18:34 +0000)]
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

11 years agoWhen a statement is dropped from the AST because it was invalid, make sure
Argyrios Kyrtzidis [Fri, 15 Feb 2013 18:34:13 +0000 (18:34 +0000)]
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

11 years agoRe-enable ConstructorInitializerAllOnOneLineOrOnePerLine option.
Daniel Jasper [Fri, 15 Feb 2013 16:49:44 +0000 (16:49 +0000)]
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

11 years agoSema: Unnest early exit and remove an unnecessary bad cast.
Benjamin Kramer [Fri, 15 Feb 2013 15:17:50 +0000 (15:17 +0000)]
Sema: Unnest early exit and remove an unnecessary bad cast.

cast<ObjCObjectPointerType> doesn't look through sugar, getAs does.
Fixes PR15257.

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

11 years agoAbstract out emitting the vdtor calls and do it properly when using -cxx-abi microsof...
Timur Iskhodzhanov [Fri, 15 Feb 2013 14:45:22 +0000 (14:45 +0000)]
Abstract out emitting the vdtor calls and do it properly when using -cxx-abi microsoft; also fix vdtor calls for the ARM ABI

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

11 years agoMake helper functions static.
Benjamin Kramer [Fri, 15 Feb 2013 12:30:38 +0000 (12:30 +0000)]
Make helper functions static.

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

11 years agoPrevent only breaking before "?" in conditional expressions.
Daniel Jasper [Fri, 15 Feb 2013 11:07:25 +0000 (11:07 +0000)]
Prevent only breaking before "?" in conditional expressions.

This is almost always more readable.

Before:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ? aaaaaaaaaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaa;

After:
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    ? aaaaaaaaaaaaaaaaaaaaaaaaaaa
    : aaaaaaaaaaaaaaaaaaaaaaaaaaa;

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

11 years agoUpdate testcases due to Attribute sorting improvements.
Bill Wendling [Fri, 15 Feb 2013 05:25:49 +0000 (05:25 +0000)]
Update testcases due to Attribute sorting improvements.

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

11 years ago[analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.
Jordan Rose [Fri, 15 Feb 2013 01:23:24 +0000 (01:23 +0000)]
[analyzer] Don't assert when mixing reinterpret_cast and derived-to-base casts.

This just adds a very simple check that if a DerivedToBase CastExpr is
operating on a value with known C++ object type, and that type is not the
base type specified in the AST, then the cast is invalid and we should
return UnknownVal.

In the future, perhaps we can have a checker that specifies that this is
illegal, but we still shouldn't assert even if the user turns that checker
off.

PR14872

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

11 years agoRe-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."
Jordan Rose [Fri, 15 Feb 2013 00:32:15 +0000 (00:32 +0000)]
Re-apply "[analyzer] Model trivial copy/move ctors with an aggregate bind."

...after a host of optimizations related to the use of LazyCompoundVals
(our implementation of aggregate binds).

Originally applied in r173951.
Reverted in r174069 because it was causing hangs.
Re-applied in r174212.
Reverted in r174265 because it was /still/ causing hangs.

If this needs to be reverted again it will be punted to far in the future.

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

11 years ago[analyzer] Cache the bindings accessible through a LazyCompoundVal.
Jordan Rose [Fri, 15 Feb 2013 00:32:12 +0000 (00:32 +0000)]
[analyzer] Cache the bindings accessible through a LazyCompoundVal.

This means we don't have to recompute them all later for every
removeDeadSymbols check.

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

11 years ago[analyzer] Scan the correct store when finding symbols in a LazyCompoundVal.
Jordan Rose [Fri, 15 Feb 2013 00:32:10 +0000 (00:32 +0000)]
[analyzer] Scan the correct store when finding symbols in a LazyCompoundVal.

Previously, we were scanning the current store. Now, we properly scan the
store that the LazyCompoundVal came from, which may have very different
live symbols.

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

11 years ago[analyzer] Tweak LazyCompoundVal reuse check to ignore qualifiers.
Jordan Rose [Fri, 15 Feb 2013 00:32:08 +0000 (00:32 +0000)]
[analyzer] Tweak LazyCompoundVal reuse check to ignore qualifiers.

This is optimization only; no behavioral change.

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

11 years ago[analyzer] Use collectSubRegionKeys to make removeDeadBindings faster.
Jordan Rose [Fri, 15 Feb 2013 00:32:06 +0000 (00:32 +0000)]
[analyzer] Use collectSubRegionKeys to make removeDeadBindings faster.

Previously, whenever we had a LazyCompoundVal, we crawled through the
entire store snapshot looking for bindings within the LCV's region. Now, we
just ask for the subregion bindings of the lazy region and only visit those.

This is an optimization (so no test case), but it may allow us to clean up
more dead bindings than we were previously.

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

11 years ago[analyzer] Refactor RegionStore's sub-region bindings traversal.
Jordan Rose [Fri, 15 Feb 2013 00:32:03 +0000 (00:32 +0000)]
[analyzer] Refactor RegionStore's sub-region bindings traversal.

This is going to be used in the next commit.
While I'm here, tighten up assumptions about symbolic offset
BindingKeys, and make offset calculation explicitly handle all
MemRegion kinds.

No functionality change.

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

11 years agoMake this test determinstic for my last patch.
Fariborz Jahanian [Thu, 14 Feb 2013 22:38:41 +0000 (22:38 +0000)]
Make this test determinstic for my last patch.
// rdar://13192366

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

11 years agoobjective-C: synthesize properties in order of their
Fariborz Jahanian [Thu, 14 Feb 2013 22:33:34 +0000 (22:33 +0000)]
objective-C: synthesize properties in order of their
declarations to synthesize their ivars in similar
determinstic order so they are laid out in
a determinstic order. // rdar://13192366

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

11 years agolibclang: remove reinterpret_casts by using SourceLocation::getFromPtrEncoding
Dmitri Gribenko [Thu, 14 Feb 2013 20:07:36 +0000 (20:07 +0000)]
libclang: remove reinterpret_casts by using SourceLocation::getFromPtrEncoding
directly instead of casting a pointer to an integer

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

11 years agoobjective-C: When implementing custom accessor method for
Fariborz Jahanian [Thu, 14 Feb 2013 19:07:19 +0000 (19:07 +0000)]
objective-C: When implementing custom accessor method for
a property, the -Wdirect-ivar-access should not warn when
accessing the property's synthesized instance variable.
// rdar://13142820

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

11 years ago[analyzer] Try constant-evaluation for all variables, not just globals.
Jordan Rose [Thu, 14 Feb 2013 19:06:11 +0000 (19:06 +0000)]
[analyzer] Try constant-evaluation for all variables, not just globals.

In C++, constants captured by lambdas (and blocks) are not actually stored
in the closure object, since they can be expanded at compile time. In this
case, they will have no binding when we go to look them up. Previously,
RegionStore thought they were uninitialized stack variables; now, it checks
to see if they are a constant we know how to evaluate, using the same logic
as r175026.

This particular code path is only for scalar variables. Constant arrays and
structs are still unfortunately unhandled; we'll need a stronger solution
for those.

This may have a small performance impact, but only for truly-undefined
local variables, captures in a non-inlined block, and non-constant globals.
Even then, in the non-constant case we're only doing a quick type check.

<rdar://problem/13105553>

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

11 years ago[arcmt] Make sure the function has an associated parameter for the argument
Argyrios Kyrtzidis [Thu, 14 Feb 2013 17:29:16 +0000 (17:29 +0000)]
[arcmt] Make sure the function has an associated parameter for the argument
before checking for its attributes.

rdar://13192395

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

11 years agoMangle extern "C" functions whose names are not simple identifiers.
Rafael Espindola [Thu, 14 Feb 2013 15:38:59 +0000 (15:38 +0000)]
Mangle extern "C" functions whose names are not simple identifiers.

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

11 years agoFix counting of parameters so that r175162 works as expected.
Daniel Jasper [Thu, 14 Feb 2013 15:01:34 +0000 (15:01 +0000)]
Fix counting of parameters so that r175162 works as expected.

Before:
aaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa()
                              .aaaaaaaaaaaaaaaaa());

After:
aaaaaaaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa().aaaaaaaaaaaaaaaaa());

Not sure which of the formattings above is better, but we should not pick
one by accident.

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

11 years agoReduce penalty for breaking before ./-> after complex calls.
Daniel Jasper [Thu, 14 Feb 2013 14:26:07 +0000 (14:26 +0000)]
Reduce penalty for breaking before ./-> after complex calls.

This gives a clearer separation of the context, e.g. in GMOCK
statements.

Before:
EXPECT_CALL(SomeObject,
            SomeFunction(Parameter)).WillRepeatedly(Return(SomeValue));

After:
EXPECT_CALL(SomeObject, SomeFunction(Parameter))
    .WillRepeatedly(Return(SomeValue));

Minor format cleanups.

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

11 years agoRemove a const_cast by propagating constness to called functions
Dmitri Gribenko [Thu, 14 Feb 2013 13:53:30 +0000 (13:53 +0000)]
Remove a const_cast by propagating constness to called functions

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

11 years agoRemove an unneeded const_cast
Dmitri Gribenko [Thu, 14 Feb 2013 13:49:48 +0000 (13:49 +0000)]
Remove an unneeded const_cast

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

11 years agoRemove const_casts by making spec_begin()/spec_end() const
Dmitri Gribenko [Thu, 14 Feb 2013 13:20:36 +0000 (13:20 +0000)]
Remove const_casts by making spec_begin()/spec_end() const

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

11 years agoRemove the trailing whitespace of formatted lines.
Daniel Jasper [Thu, 14 Feb 2013 09:58:41 +0000 (09:58 +0000)]
Remove the trailing whitespace of formatted lines.

So far, clang-format has always assumed the whitespace belonging to the
subsequent token. This has the negative side-effect that when
clang-format formats a line, it does not remove its trailing whitespace,
as it belongs to the next token.

Thus, this patch fixes most of llvm.org/PR15062.

We are not zapping a file's trailing whitespace so far, as this does not
belong to any token we see during formatting. We need to fix this in a
subsequent patch.

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

11 years agoGet less confused by trailing comma in Google style.
Daniel Jasper [Thu, 14 Feb 2013 09:19:04 +0000 (09:19 +0000)]
Get less confused by trailing comma in Google style.

The formatter can now format:
void aaaaaaaaaaaaaaaaaa(int level,
                        double *min_x,
                        double *max_x,
                        double *min_y,
                        double *max_y,
                        double *min_z,
                        double *max_z, ) {
}

Although this is invalid code, it frequently happens during development and
clang-format should be nicer :-).

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

11 years agoRemove accidentally committed empty test.
Daniel Jasper [Thu, 14 Feb 2013 08:45:14 +0000 (08:45 +0000)]
Remove accidentally committed empty test.

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

11 years agoAlign superclasses for multiple inheritence.
Daniel Jasper [Thu, 14 Feb 2013 08:42:54 +0000 (08:42 +0000)]
Align superclasses for multiple inheritence.

This fixes llvm.org/PR15179.

Before:
class ColorChooserMac : public content::ColorChooser,
    public content::WebContentsObserver {
};

After:
class ColorChooserMac : public content::ColorChooser,
                        public content::WebContentsObserver {
};

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

11 years agoRevert accidental commit.
Bill Wendling [Thu, 14 Feb 2013 08:18:53 +0000 (08:18 +0000)]
Revert accidental commit.

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

11 years agoPass the target options through to code generation.
Bill Wendling [Thu, 14 Feb 2013 08:09:20 +0000 (08:09 +0000)]
Pass the target options through to code generation.

The code generation stuff is going to set attributes on the functions it
generates. To do that it needs the target options. Pass them through.

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

11 years agoPartially revert r175117 so that we don't break assumptions about how
Rafael Espindola [Thu, 14 Feb 2013 03:31:26 +0000 (03:31 +0000)]
Partially revert r175117 so that we don't break assumptions about how
static functions in extern "C" contexts are mangled. Should fix the
bootstrap.

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

11 years agomerge hasCLanguageLinkage and isExternC. Keep the shorter name.
Rafael Espindola [Thu, 14 Feb 2013 01:47:04 +0000 (01:47 +0000)]
merge hasCLanguageLinkage and isExternC. Keep the shorter name.

I added hasCLanguageLinkage while fixing some language linkage bugs some
time ago so that I wouldn't have to check all users of isExternC. It turned
out to be a much longer detour than expected, but this patch finally
merges the two again. The isExternC function now implements just the
standard notion of having C language linkage.

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

11 years agoAdd a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fix
Rafael Espindola [Thu, 14 Feb 2013 01:18:37 +0000 (01:18 +0000)]
Add a getLanguageLinkage method to VarDecls and FunctionDecls. Use it to fix
some cases where functions with no language linkage were being treated as having
C language linkage. In particular, don't warn in

extern "C" {
  static NonPod foo();
}

Since getLanguageLinkage checks the language linkage, the linkage computation
cannot use the language linkage. Break the loop by checking just the context
in the linkage computation.

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

11 years agoWhen marking derived classes' virtual methods ODR-used in order to trigger
Nick Lewycky [Thu, 14 Feb 2013 00:55:17 +0000 (00:55 +0000)]
When marking derived classes' virtual methods ODR-used in order to trigger
instantiation in order to permit devirtualization later in codegen, skip over
pure functions since those can't be devirtualization targets.

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

11 years agoTeach ccc-analyze to pass on -iquote with no spaces between it an the argument.
Ted Kremenek [Thu, 14 Feb 2013 00:32:25 +0000 (00:32 +0000)]
Teach ccc-analyze to pass on -iquote with no spaces between it an the argument.

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

11 years agoActually fix rendering of the example code block!
Richard Smith [Thu, 14 Feb 2013 00:23:04 +0000 (00:23 +0000)]
Actually fix rendering of the example code block!

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

11 years agoSome grammar fixes to 'Format String Checking', and reorder the text slightly to...
Richard Smith [Thu, 14 Feb 2013 00:22:00 +0000 (00:22 +0000)]
Some grammar fixes to 'Format String Checking', and reorder the text slightly to try to make the final code block actually get rendered.

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

11 years agoDocument Clang's support for [[gnu::...]] attributes.
Richard Smith [Thu, 14 Feb 2013 00:13:34 +0000 (00:13 +0000)]
Document Clang's support for [[gnu::...]] attributes.

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

11 years ago[docs] The stat cache has been removed from the PCH, update the docs to remove mentio...
Argyrios Kyrtzidis [Thu, 14 Feb 2013 00:12:44 +0000 (00:12 +0000)]
[docs] The stat cache has been removed from the PCH, update the docs to remove mentions of it.

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

11 years agoobjective-C: Make order of ivars which are synthesized
Fariborz Jahanian [Wed, 13 Feb 2013 22:50:36 +0000 (22:50 +0000)]
objective-C: Make order of ivars which are synthesized
in the course of property synthesis deterministic (ordered
by their type size), instead of having hashtable order
(as it is currently). // rdar://13192366

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

11 years agoRemove outdated performance.html webpage.
Tanya Lattner [Wed, 13 Feb 2013 21:51:18 +0000 (21:51 +0000)]
Remove outdated performance.html webpage.

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

11 years ago[ms-inline asm] Add test case for r175083.
Chad Rosier [Wed, 13 Feb 2013 21:34:54 +0000 (21:34 +0000)]
[ms-inline asm] Add test case for r175083.

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

11 years agoubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,
Richard Smith [Wed, 13 Feb 2013 21:18:23 +0000 (21:18 +0000)]
ubsan: Add checking for invalid downcasts. Per [expr.static.cast]p2 and p11,
base-to-derived casts have undefined behavior if the object is not actually an
instance of the derived type.

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

11 years agoAllow breaking after the return type in function declarations.
Daniel Jasper [Wed, 13 Feb 2013 20:33:44 +0000 (20:33 +0000)]
Allow breaking after the return type in function declarations.

This has so far been disabled for Google style, but should be done
before breaking at nested name specifiers or in template parameters.

Before (in Google style):
template <typename T>
aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<
    T>::aaaaaaa() {}

After:
template <typename T>
aaaaaaaa::aaaaa::aaaaaa<T, aaaaaaaaaaaaaaaaaaaaaaaaa>
aaaaaaaaaaaaaaaaaaaaaaaa<T>::aaaaaaa() {}

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

11 years agoUse 'RC_XBS' instead of 'RC_BUILDIT' to catch all times when it's built in the Apple...
Bill Wendling [Wed, 13 Feb 2013 19:44:17 +0000 (19:44 +0000)]
Use 'RC_XBS' instead of 'RC_BUILDIT' to catch all times when it's built in the Apple way.

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

11 years agoFix comment alignment close to the column limit.
Daniel Jasper [Wed, 13 Feb 2013 19:25:54 +0000 (19:25 +0000)]
Fix comment alignment close to the column limit.

Due to an error in one of the expressions, we used to not align comments
although it would have been possible.

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

11 years ago[libclang] Fix annotation of a range where the begin or end location
Argyrios Kyrtzidis [Wed, 13 Feb 2013 18:33:28 +0000 (18:33 +0000)]
[libclang] Fix annotation of a range where the begin or end location
is inside a macro argument.

Previously we would give up and not annotate anything in the range.
rdar://11891550

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

11 years ago... and now fix the +Asserts build
Timur Iskhodzhanov [Wed, 13 Feb 2013 12:24:19 +0000 (12:24 +0000)]
... and now fix the +Asserts build

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

11 years agoFix the microsoft-abi-structors test expectations to match both Release and Release...
Timur Iskhodzhanov [Wed, 13 Feb 2013 12:14:25 +0000 (12:14 +0000)]
Fix the microsoft-abi-structors test expectations to match both Release and Release+Asserts builds

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

11 years agoPull search state out as class members.
Manuel Klimek [Wed, 13 Feb 2013 10:54:19 +0000 (10:54 +0000)]
Pull search state out as class members.

Fix some comments.

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

11 years agoAn attempt to make the search algorithm easier to understand.
Manuel Klimek [Wed, 13 Feb 2013 10:46:36 +0000 (10:46 +0000)]
An attempt to make the search algorithm easier to understand.

- clear ownership: the SpecificBumpPtrAllocator owns all StateNodes
- this allows us to simplify the memoization data structure into a
  std::set (FIXME: figure out whether we want to use a hash based
  data structure).
- introduces StateNode as recursive data structure, instead of using
  Edge and the Seen-map combined to drill through the graph
- using a count to stabilize the penalty instead of relying on the
  container
- pulled out a method to forward-apply states in the end

This leads to a ~40% runtime decrease on Nico's benchmark.

Main FiXME is that the parameter lists of some function get too long.
I'd vote for either pulling the Queue etc into the Formatter proper,
or creating an inner class just for the search algorithm.

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

11 years agoEmit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058
Timur Iskhodzhanov [Wed, 13 Feb 2013 08:37:51 +0000 (08:37 +0000)]
Emit virtual/deleting destructors properly with -cxx-abi microsoft, PR15058

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

11 years agoFormatter: And more cast tests (these don't pass yet).
Nico Weber [Wed, 13 Feb 2013 04:40:03 +0000 (04:40 +0000)]
Formatter: And more cast tests (these don't pass yet).

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

11 years agoFormatter: Add more cast tests.
Nico Weber [Wed, 13 Feb 2013 04:32:57 +0000 (04:32 +0000)]
Formatter: Add more cast tests.

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

11 years agoFormatter: Refactor the cast detection code to be a bit more readable.
Nico Weber [Wed, 13 Feb 2013 04:13:13 +0000 (04:13 +0000)]
Formatter: Refactor the cast detection code to be a bit more readable.

No functionality change. Also add another cast test.

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

11 years agoFormatter: Detect ObjC method expressions after casts.
Nico Weber [Wed, 13 Feb 2013 03:48:27 +0000 (03:48 +0000)]
Formatter: Detect ObjC method expressions after casts.

Not all casts are correctly detected yet, but it helps in some cases.

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

11 years agoChange this comment to helpfully explain why it's there.
Nick Lewycky [Wed, 13 Feb 2013 03:34:21 +0000 (03:34 +0000)]
Change this comment to helpfully explain why it's there.

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

11 years ago[analyzer] Use Clang's evaluation for global constants and default arguments.
Jordan Rose [Wed, 13 Feb 2013 03:11:06 +0000 (03:11 +0000)]
[analyzer] Use Clang's evaluation for global constants and default arguments.

Previously, we were handling only simple integer constants for globals and
the smattering of implicitly-valued expressions handled by Environment for
default arguments. Now, we can use any integer constant expression that
Clang can evaluate, in addition to everything we handled before.

PR15094 / <rdar://problem/12830437>

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

11 years ago[analyzer] Use makeZeroVal in RegionStore's lazy evaluation of statics.
Jordan Rose [Wed, 13 Feb 2013 03:11:01 +0000 (03:11 +0000)]
[analyzer] Use makeZeroVal in RegionStore's lazy evaluation of statics.

No functionality change.

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

11 years ago[ms-inline-asm] Test cases to ensure the AsmRewrite list is sorted (r175021).
Chad Rosier [Wed, 13 Feb 2013 01:06:08 +0000 (01:06 +0000)]
[ms-inline-asm] Test cases to ensure the AsmRewrite list is sorted (r175021).
Part of rdar://13202662

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

11 years agoOrder the methods in the global method pool based on when they become visible, not...
Douglas Gregor [Tue, 12 Feb 2013 23:36:21 +0000 (23:36 +0000)]
Order the methods in the global method pool based on when they become visible, not when they become deserialized <rdar://problem/13203033>.

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

11 years agoReplace 'signed' with 'int'. 'signed' is not typical for LLVM style
Dmitri Gribenko [Tue, 12 Feb 2013 22:40:22 +0000 (22:40 +0000)]
Replace 'signed' with 'int'.  'signed' is not typical for LLVM style

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

11 years ago[preprocessing record] Add some sanity checks for the preprocessed entity index
Argyrios Kyrtzidis [Tue, 12 Feb 2013 21:41:23 +0000 (21:41 +0000)]
[preprocessing record] Add some sanity checks for the preprocessed entity index
to make sure we don't crash on release if the index is not valid.

rdar://13089714

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

11 years ago[ms-inline-asm] Add test cases for the align/emit directives.
Chad Rosier [Tue, 12 Feb 2013 21:34:14 +0000 (21:34 +0000)]
[ms-inline-asm] Add test cases for the align/emit directives.
Part of rdar://13200215

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

11 years agoAdd a test for r174980, that we used to accept
Dmitri Gribenko [Tue, 12 Feb 2013 20:43:41 +0000 (20:43 +0000)]
Add a test for r174980, that we used to accept

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

11 years agoFix crash for incomplete labels in macros.
Daniel Jasper [Tue, 12 Feb 2013 20:17:17 +0000 (20:17 +0000)]
Fix crash for incomplete labels in macros.

Still the formatting can be improved, but at least we don't assert any
more. This happened when trying to format lib/Sema/SemaType.cpp.

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

11 years ago[ms-inline asm] Update test case now that we are correctly parsing __emit directives.
Chad Rosier [Tue, 12 Feb 2013 19:42:57 +0000 (19:42 +0000)]
[ms-inline asm] Update test case now that we are correctly parsing __emit directives.

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

11 years agoFixing the MSVC compiler warning a different way; removed use of static_cast and...
Aaron Ballman [Tue, 12 Feb 2013 19:20:48 +0000 (19:20 +0000)]
Fixing the MSVC compiler warning a different way; removed use of static_cast and instead used a signed integer parameter.

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

11 years agoTypo.
Chad Rosier [Tue, 12 Feb 2013 19:15:05 +0000 (19:15 +0000)]
Typo.

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

11 years ago[ms-inline asm] Add a few test cases for the parsing of hexidecimal integers.
Chad Rosier [Tue, 12 Feb 2013 18:45:21 +0000 (18:45 +0000)]
[ms-inline asm] Add a few test cases for the parsing of hexidecimal integers.

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