Summary:
Fix code to follow the "Don’t use else after a return" rule.
This is a followup from rL219792.
Reviewers: alexfh
Subscribers: klimek, cfe-commits
Differential Revision: http://reviews.llvm.org/D5826
llvm-svn: 219939
(also, the code executed once the element was found was split half
inside the loop and half after it - now put it all together after the
find operation)
I'm a bit concerned that this code is rather untested (commenting out
this whole function and running check-clang doesn't fail any tests)...
And I wish I had polymorphic lambdas.
llvm-svn: 219938
The final goal is to get rid of all the rest overloads that
accept LLVM objects (llvm::Function and llvm::GlobalVariable),
and pass in source-level entities instead.
llvm-svn: 219937
When the constant divisor was larger than 32bits, then the optimized code
generated for the AArch64 backend would emit the wrong code, because the shift
was defined as a shift of a 32bit constant '(1<<Lg2(divisor))' and we would
loose the upper 32bits.
This fixes rdar://problem/18678801.
llvm-svn: 219934
Summary:
In order to support big endian targets for the BuildPairF64 nodes we
just need to swap the low/high pair registers. Additionally, for the
ExtractElementF64 nodes we have to calculate the correct stack offset
with respect to the node's register/operand that we want to extract.
Reviewers: dsanders
Reviewed By: dsanders
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D5753
llvm-svn: 219931
Summary:
This patch allows modules to specify default options for the checks
defined in them. This way a sufficiently configurable check can be registered in
multiple modules with different default options. E.g. the SpacesBeforeComments
option may be set to 1 for the "llvm-namespace-comments" check and to 2 for the
"google-readability-namespace-comment" check without modifying or extending the
check code.
This patch also registers the google-readability-braces-around-statements check
with suitable defaults.
Reviewers: djasper
Reviewed By: djasper
Subscribers: curdeius, cfe-commits
Differential Revision: http://reviews.llvm.org/D5798
llvm-svn: 219923
a number of warnings to be enabled. The one making the most noise
across the code base right now is CLANG_WARN_UNREACHABLE_CODE = YES.
llvm-svn: 219910
Plumb through the full QualType of the TemplateArgument::Declaration, as
it's insufficient to only know whether the type is a reference or
pointer (that was necessary for mangling, but insufficient for debug
info). This shouldn't increase the size of TemplateArgument as
TemplateArgument::Integer is still longer by another 32 bits.
Several bits of code were testing that the reference-ness of the
parameters matched, but this seemed to be insufficient (various other
features of the type could've mismatched and wouldn't've been caught)
and unnecessary, at least insofar as removing those tests didn't cause
anything to fail.
(Richard - perchaps you can hypothesize why any of these checks might
need to test reference-ness of the parameters (& explain why
reference-ness is part of the mangling - I would've figured that for the
reference-ness to be different, a prior template argument would have to
be different). I'd be happy to add them in/beef them up and add test
cases if there's a reason for them)
llvm-svn: 219900
Make tail recursion elimination a bit more aggressive. This allows us to get
tail recursion on functions that are just branches to a different function. The
fact that the function takes a byval argument does not restrict it from being
optimised into just a tail call.
llvm-svn: 219899
Fix for clang crash when instantiating a template with qualified lookup for members in non-class types.
Differential Revision: http://reviews.llvm.org/D5769
llvm-svn: 219897
We've already created a FileSpec based on this local and
this code path would never be executed if it is an invalid
FilePath - but the static analyzer doesn't know this and I
want to placate it.
clang static analyzer fixit.
llvm-svn: 219890