]> granicus.if.org Git - clang/log
clang
11 years ago[clang-format] Don't flash an ugly cmd prompt in Vim on Windows
Reid Kleckner [Mon, 10 Jun 2013 14:16:26 +0000 (14:16 +0000)]
[clang-format] Don't flash an ugly cmd prompt in Vim on Windows

Reviewers: klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D941

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

11 years agoFixes the comment for hasDeclaration.
Manuel Klimek [Mon, 10 Jun 2013 08:52:15 +0000 (08:52 +0000)]
Fixes the comment for hasDeclaration.

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

11 years agoSupport for contextual conversion tweaks (N3323) was added, as Revision 183637
Larisse Voufo [Mon, 10 Jun 2013 08:25:58 +0000 (08:25 +0000)]
Support for contextual conversion tweaks (N3323) was added, as Revision 183637

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

11 years agoreverted test
Larisse Voufo [Mon, 10 Jun 2013 06:50:24 +0000 (06:50 +0000)]
reverted test

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

11 years agotest
Larisse Voufo [Mon, 10 Jun 2013 06:28:37 +0000 (06:28 +0000)]
test

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

11 years ago[CodeGen] Make CGCleanup.h include what it now uses
Reid Kleckner [Sun, 9 Jun 2013 16:56:53 +0000 (16:56 +0000)]
[CodeGen] Make CGCleanup.h include what it now uses

Also move CGCleanup.h to the top of CGCleanup.cpp to verify that
CGCleanup.h really includes what it needs.

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

11 years ago[CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h
Reid Kleckner [Sun, 9 Jun 2013 16:45:02 +0000 (16:45 +0000)]
[CodeGen] Move EHScopeStack to CGCleanup.h from CodeGenFunction.h

No functionality change.  CGCleanup.cpp provides the implementation for
EHScopeStack, so it seems more consistent to place the class definition
in CGCleanup.h.

This should also help solve a header ordering problem that I have.

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

11 years agoFix the parser's updating of the template depth when parsing local templates and...
Faisal Vali [Sat, 8 Jun 2013 19:47:52 +0000 (19:47 +0000)]
Fix the parser's updating of the template depth when parsing local templates and late-parsed templates.
This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)

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

11 years agoRevert r183618.
Faisal Vali [Sat, 8 Jun 2013 19:39:00 +0000 (19:39 +0000)]
Revert r183618.
I ran clang-format on my patch but it seemed to have wreaked havoc with new lines  - might have to do with using it on windows :( will resubmit once i've cleaned this issue up. sorry.

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

11 years agoFix the parser's updating of the template depth when parsing local templates and...
Faisal Vali [Sat, 8 Jun 2013 19:33:09 +0000 (19:33 +0000)]
Fix the parser's updating of the template depth when parsing local templates and late-parsed templates. This is a slight tweak of r180708; It avoids incrementing depth when non-template local classes nested within member templates of local classes are encountered.
This patch was LGTM'd by Doug http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20130506/079656.html and passed the regression tests that normally pass (i.e. excluding many Module and Index tests on Windows that fail regardless)

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

11 years agoAdd a test case for blocks taking an array typedef
Reid Kleckner [Sat, 8 Jun 2013 18:51:21 +0000 (18:51 +0000)]
Add a test case for blocks taking an array typedef

r183614 was failing because va_list on some platforms is defined in a
similar manner.  This test fails on Windows with r183614 applied.

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

11 years agoRevert "[Sema] Make FunctionType's TSI use unadjusted argument types"
Reid Kleckner [Sat, 8 Jun 2013 18:19:52 +0000 (18:19 +0000)]
Revert "[Sema] Make FunctionType's TSI use unadjusted argument types"

This reverts commit r183614.

It broke test/Sema/block-printf-attribute-1.c on non-Windows platforms,
and the fix is not trivial.

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

11 years ago[Sema] Make FunctionType's TSI use unadjusted argument types
Reid Kleckner [Sat, 8 Jun 2013 17:28:56 +0000 (17:28 +0000)]
[Sema] Make FunctionType's TSI use unadjusted argument types

This helps preserve the type-as-written in the AST, which we need for
MSVC mangling.  In particular, we need to preserve the types of array
parameters in function pointer types.

The essence of this change is:
-  QualType ArgTy = Param->getType();
+  QualType ArgTy = Param->getTypeSourceInfo()->getType();

... followed by the adjustment in ActOnFunctionDeclarator().

Differential Revision: http://llvm-reviews.chandlerc.com/D883

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

11 years agoRecognition of empty structures and unions is moved to semantic stage
Serge Pavlov [Sat, 8 Jun 2013 13:29:58 +0000 (13:29 +0000)]
Recognition of empty structures and unions is moved to semantic stage

Differential Revision: http://llvm-reviews.chandlerc.com/D586

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

11 years agoAdded a type checking which handle the case of an ext vector and integral scalar
Jin-Gu Kang [Sat, 8 Jun 2013 02:15:36 +0000 (02:15 +0000)]
Added a type checking which handle the case of an ext vector and integral scalar

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

11 years ago[analyzer] Minor fixups to r183062
Anna Zaks [Sat, 8 Jun 2013 00:29:29 +0000 (00:29 +0000)]
[analyzer] Minor fixups to r183062

Based on feedback from Jordan.

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

11 years ago[analyzer; alternate edges] Fix the edge locations in presence of macros.
Anna Zaks [Sat, 8 Jun 2013 00:29:24 +0000 (00:29 +0000)]
[analyzer; alternate edges] Fix the edge locations in presence of macros.

We drew the diagnostic edges to wrong statements in cases the note was on a macro.
The fix is simple, but seems to work just fine for a whole bunch of test cases (plist-macros.cpp).

Also, removes an unnecessary edge in edges-new.mm, when function signature starts with a macro.

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

11 years agoFixed comment typo.
Michael Gottesman [Sat, 8 Jun 2013 00:27:19 +0000 (00:27 +0000)]
Fixed comment typo.

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

11 years agoDebug info: An if condition now creates a lexical scope of its own.
Adrian Prantl [Sat, 8 Jun 2013 00:16:55 +0000 (00:16 +0000)]
Debug info: An if condition now creates a lexical scope of its own.
Two variables with the same name declared in two if conditions in the same
scope are no longer coalesced into one.

rdar://problem/14024005

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

11 years agoRecursively lifetime-extend into array temporaries. These can get implicitly
Richard Smith [Sat, 8 Jun 2013 00:02:08 +0000 (00:02 +0000)]
Recursively lifetime-extend into array temporaries. These can get implicitly
created through binding a reference-to-array to an initializer list.

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

11 years agoWhen we're compiling with -pg make sure to link with gcrt1.o on linux. Be
Eric Christopher [Fri, 7 Jun 2013 23:25:01 +0000 (23:25 +0000)]
When we're compiling with -pg make sure to link with gcrt1.o on linux. Be
sure to do this always, this matches the behavior for the gcc driver.

Fixes PR16251.

Based on a patch by Qiao Yang.

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

11 years agoFix va_arg on x86-64 for a struct containing a single int128_t. PR16248
Eli Friedman [Fri, 7 Jun 2013 23:20:55 +0000 (23:20 +0000)]
Fix va_arg on x86-64 for a struct containing a single int128_t.  PR16248

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

11 years agoLoosen r178109 even further, to assume that all redefined macros in system headers...
Douglas Gregor [Fri, 7 Jun 2013 22:56:11 +0000 (22:56 +0000)]
Loosen r178109 even further, to assume that all redefined macros in system headers and system modules are equivalent.

Fixes <rdar://problem/14025673>.

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

11 years ago80-column fixup after recent change to getOrCreateType.
Eric Christopher [Fri, 7 Jun 2013 22:54:39 +0000 (22:54 +0000)]
80-column fixup after recent change to getOrCreateType.

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

11 years agoEven in a modules world, people will depend on the weird xmmintrin.h -> emmintrin...
Douglas Gregor [Fri, 7 Jun 2013 22:49:44 +0000 (22:49 +0000)]
Even in a modules world, people will depend on the weird xmmintrin.h -> emmintrin.h forwarding.

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

11 years agoFix line endings.
Eli Friedman [Fri, 7 Jun 2013 22:42:22 +0000 (22:42 +0000)]
Fix line endings.

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

11 years agoaddress some comments on r183474:
Adrian Prantl [Fri, 7 Jun 2013 22:29:12 +0000 (22:29 +0000)]
address some comments on r183474:
- factor the name construction part out from constructSetterName
- rename constructSetterName to the more appropriate constructSetterSelector

no functionality change intended.
rdar://problem/14035789

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

11 years agoRevert "Properly consider the range of enum for range comparisons in C mode"
David Majnemer [Fri, 7 Jun 2013 22:07:20 +0000 (22:07 +0000)]
Revert "Properly consider the range of enum for range comparisons in C mode"

The approach r183084 took was wrong, back it out.

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

11 years agoAdd missing file from r183563 (the recommit of 183466).
Eli Friedman [Fri, 7 Jun 2013 20:33:10 +0000 (20:33 +0000)]
Add missing file from r183563 (the recommit of 183466).

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

11 years agoRe-commit r183466 with a fix to make the TypeLoc casting machinery work
Eli Friedman [Fri, 7 Jun 2013 20:31:48 +0000 (20:31 +0000)]
Re-commit r183466 with a fix to make the TypeLoc casting machinery work
correctly in the presence of qualified types.

(I had to change the unittest because it was trying to cast a
QualifiedTypeLoc to TemplateSpecializationTypeLoc.)

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

11 years agoObjective-C: Another case of issuing warning about misusing
Fariborz Jahanian [Fri, 7 Jun 2013 20:26:51 +0000 (20:26 +0000)]
Objective-C: Another case of issuing warning about misusing
property auto-synthesis before knowingit it is to be
auto-synthesized. // rdar://14094682

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

11 years agoPR16273: Weaken a bogus assertion.
Richard Smith [Fri, 7 Jun 2013 20:03:01 +0000 (20:03 +0000)]
PR16273: Weaken a bogus assertion.

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

11 years agoDefine id to the correct type.
Rafael Espindola [Fri, 7 Jun 2013 18:41:01 +0000 (18:41 +0000)]
Define id to the correct type.

Found this while working on pr16247. The fix for that bug will cause clang to
reject this.

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

11 years agoObjective-C: Removes a bogus warning about auto-synthesis
Fariborz Jahanian [Fri, 7 Jun 2013 18:32:55 +0000 (18:32 +0000)]
Objective-C: Removes a bogus warning about auto-synthesis
of properties. Fixes // rdar://14085456

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

11 years agoThread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees...
Argyrios Kyrtzidis [Fri, 7 Jun 2013 17:57:59 +0000 (17:57 +0000)]
Thread the 'Invalid' out parameter through SourceManager::getSLocEntry() and callees of SourceManager::getSLocEntryByID().

Also add an 'Invalid' check in SourceManager::computeMacroArgsCache().

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

11 years agoImproved handling of escaped newlines at the token start.
Alexander Kornienko [Fri, 7 Jun 2013 17:45:07 +0000 (17:45 +0000)]
Improved handling of escaped newlines at the token start.

Summary: Remove them from the TokenText as well.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D935

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

11 years agoHandle Unicode characters in fix-it replacement strings.
Jordan Rose [Fri, 7 Jun 2013 17:16:01 +0000 (17:16 +0000)]
Handle Unicode characters in fix-it replacement strings.

Patch by Sukolsak Sakshuwong!

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

11 years agofix up recogtion of block pointer type in my last patch.
Fariborz Jahanian [Fri, 7 Jun 2013 16:07:38 +0000 (16:07 +0000)]
fix up recogtion of block pointer type in my last patch.
// rdar://14085217.
e-This line, and those below, will be ignored--

M    lib/Sema/SemaExpr.cpp

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

11 years agoFixed calculation of penalty when breaking tokens.
Alexander Kornienko [Fri, 7 Jun 2013 16:02:52 +0000 (16:02 +0000)]
Fixed calculation of penalty when breaking tokens.

Summary:
Introduced two new style parameters: PenaltyBreakComment and
PenaltyBreakString. Add penalty for each character of a breakable token beyond
the column limit (this relates mainly to comments, as they are broken only on
whitespace). Tuned PenaltyBreakComment to prefer comment breaking over breaking
inside most binary expressions.
Fixed a bug that prevented *, & and && from being considered TT_BinaryOperator
in the presense of adjacent comments.

Reviewers: klimek, djasper

Reviewed By: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D933

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

11 years agoAdds a test that verifies angle bracket locations.
Manuel Klimek [Fri, 7 Jun 2013 11:27:57 +0000 (11:27 +0000)]
Adds a test that verifies angle bracket locations.

Regression test to make sure TemplateSpecializationTypeLocs have the
correct locations for angle brackets.

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

11 years agoReverts r183466: "Perform dynamic alignment computations..."
Manuel Klimek [Fri, 7 Jun 2013 11:27:53 +0000 (11:27 +0000)]
Reverts r183466: "Perform dynamic alignment computations..."

This introduces bugs in TemplateSpecializationTypeLoc's angle bracket
locations.

Regression test follows in a subsequent commit.

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

11 years agoReverting test commit
Faisal Vali [Fri, 7 Jun 2013 05:33:21 +0000 (05:33 +0000)]
Reverting test commit

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

11 years agotest commit
Faisal Vali [Fri, 7 Jun 2013 05:19:33 +0000 (05:19 +0000)]
test commit

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

11 years agoPR16243: Use CXXThisOverride during template instantiation, and fix up the
Richard Smith [Fri, 7 Jun 2013 02:33:37 +0000 (02:33 +0000)]
PR16243: Use CXXThisOverride during template instantiation, and fix up the
places which weren't setting it up properly. This allows us to get the right
cv-qualifiers for 'this' when it appears outside a method body in a class
template.

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

11 years agoWhen we're synthesizing copy/move-assignment, we can't form a reference to an
Eli Friedman [Fri, 7 Jun 2013 01:48:56 +0000 (01:48 +0000)]
When we're synthesizing copy/move-assignment, we can't form a reference to an
invalid field; make sure we don't try.  Fixes <rdar://problem/14084171>.

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

11 years agodocumentation: remove confusing reference to properties.
Adrian Prantl [Fri, 7 Jun 2013 01:10:48 +0000 (01:10 +0000)]
documentation: remove confusing reference to properties.

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

11 years agoObjC Debug Info: Emit the names of accessors whenever they diverge from
Adrian Prantl [Fri, 7 Jun 2013 01:10:45 +0000 (01:10 +0000)]
ObjC Debug Info: Emit the names of accessors whenever they diverge from
the default names, not just when the isImplicit flag is set.

rdar://problem/14035789

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

11 years agoImprove documentation.
Adrian Prantl [Fri, 7 Jun 2013 01:10:41 +0000 (01:10 +0000)]
Improve documentation.

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

11 years agoblocks: fixes an ast bug when block pointer variable
Fariborz Jahanian [Fri, 7 Jun 2013 00:48:14 +0000 (00:48 +0000)]
blocks: fixes an ast bug when block pointer variable
is evaluated in a condition expression and then
dereferenced to envoke the block. This is
pr15663 and I applied a slight variation of the
patch with a test case. (patch is from
Arthur O'Dwyer). Also // rdar://14085217

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

11 years agoDiagnose malformed x86 inline asm using 'y' constraint.
Tim Northover [Fri, 7 Jun 2013 00:04:50 +0000 (00:04 +0000)]
Diagnose malformed x86 inline asm using 'y' constraint.

X86's 'y' inline assembly constraint represents an MMX register, this change
prevents Clang from hitting an assertion when passed an incompatible type to
deal with.

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

11 years agoPerform dynamic alignment computations so that the data in TypeLocs is
Eli Friedman [Fri, 7 Jun 2013 00:04:31 +0000 (00:04 +0000)]
Perform dynamic alignment computations so that the data in TypeLocs is
correctly aligned.  Not performing such computations led to misaligned loads,
which crash on some platforms and are generally bad on other platforms.

The implementation of TypeLocBuilder::pushImpl is rather messy; code using
TypeLocBuilder accidentally assumes that partial TypeLocs are
laid out like a complete TypeLoc.  As a followup, I intend to work on
fixing the TypeLocBuilder API to avoid exposing partial TypeLocs; this should
substantially simplify the implemementation.

Fixes PR16144.

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

11 years agoImplement DR7
David Majnemer [Thu, 6 Jun 2013 23:43:20 +0000 (23:43 +0000)]
Implement DR7

Disallowing deriving from classes that have private virtual base classes
except in instances where the deriving class would be able to cast
itself to the private virtual base via a different derivation.

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

11 years ago[analyzer] Address Jordan’s code review for r183451
Anna Zaks [Thu, 6 Jun 2013 22:32:11 +0000 (22:32 +0000)]
[analyzer] Address Jordan’s code review for r183451

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

11 years ago[analyzer] Ensure that pieces with invalid locations always get removed from the...
Anna Zaks [Thu, 6 Jun 2013 22:02:58 +0000 (22:02 +0000)]
[analyzer] Ensure that pieces with invalid locations always get removed from the BugReport

The function in which we were doing it used to be conditionalized. Add a new unconditional
cleanup step.

This fixes PR16227 (radar://14073870) - a crash when generating html output for one of the test files.

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

11 years ago[analyzer] fixup the comment
Anna Zaks [Thu, 6 Jun 2013 22:02:55 +0000 (22:02 +0000)]
[analyzer] fixup the comment

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

11 years ago[analyzer; new edges] Simplify edges in a C++11 for-range loop.
Jordan Rose [Thu, 6 Jun 2013 21:53:45 +0000 (21:53 +0000)]
[analyzer; new edges] Simplify edges in a C++11 for-range loop.

Previously our edges were completely broken here; now, the final result
is a very simple set of edges in most cases: one up to the "for" keyword
for context, and one into the body of the loop. This matches the behavior
for ObjC for-in loops.

In the AST, however, CXXForRangeStmts are handled very differently from
ObjCForCollectionStmts. Since they are specified in terms of equivalent
statements in the C++ standard, we actually have implicit AST nodes for
all of the semantic statements. This makes evaluation very easy, but
diagnostic locations a bit trickier. Fortunately, the problem can be
generally defined away by marking all of the implicit statements as
part of the top-level for-range statement.

One of the implicit statements in a for-range statement is the declaration
of implicit iterators __begin and __end. The CFG synthesizes two
separate DeclStmts to match each of these decls, but until now these
synthetic DeclStmts weren't in the function's ParentMap. Now, the CFG
keeps track of its synthetic statements, and the AnalysisDeclContext will
make sure to add them to the ParentMap.

<rdar://problem/14038483>

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

11 years ago[libclang] CMake: add an option to control building libclang as a static library...
Argyrios Kyrtzidis [Thu, 6 Jun 2013 19:51:37 +0000 (19:51 +0000)]
[libclang] CMake: add an option to control building libclang as a static library (off by default)

This avoids building libclang twice by default.

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

11 years agoFix incorrect line breaking before trailing block comments.
Daniel Jasper [Thu, 6 Jun 2013 16:08:57 +0000 (16:08 +0000)]
Fix incorrect line breaking before trailing block comments.

Before, clang-format would happily move a trailing block comment to a
new line, which normally changes the perceived binding of that comment.

E.g., it would move:
void f() { /* comment */
  ...
}
to:
void f() {
  /* comment */
  ...
}

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

11 years agoFix a crash with -Wassign-enum, where we didn't adjust the APInt type of the
Joey Gouly [Thu, 6 Jun 2013 13:48:00 +0000 (13:48 +0000)]
Fix a crash with -Wassign-enum, where we didn't adjust the APInt type of the
constant. Also fix some spelling mistakes and formatting issues.

Reviewed by Richard Smith over IRC.

Fixes PR15069.

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

11 years agoclang-check: add missing space in Makefile
Hans Wennborg [Thu, 6 Jun 2013 13:24:44 +0000 (13:24 +0000)]
clang-check: add missing space in Makefile

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

11 years agoclang-check: Link the static analyzer in the Makefile build too.
Benjamin Kramer [Thu, 6 Jun 2013 13:16:41 +0000 (13:16 +0000)]
clang-check: Link the static analyzer in the Makefile build too.

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

11 years agoAdd support for static analysis to clang-check
Pavel Labath [Thu, 6 Jun 2013 12:35:43 +0000 (12:35 +0000)]
Add support for static analysis to clang-check

Summary:
This adds a command line argument '-analyze' to clang-check which runs the
clang static analyzer on the source files.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D926

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

11 years agoClangTool: strip -o from the command line
Pavel Labath [Thu, 6 Jun 2013 11:52:19 +0000 (11:52 +0000)]
ClangTool: strip -o from the command line

Summary:
This patch creates a new ArgumentsAdjuster, which removes all -o parameters from
the command line. This adjuster is inserted by default into the ClangTool pipeline.

Reviewers: klimek

CC: cfe-commits, revane
Differential Revision: http://llvm-reviews.chandlerc.com/D925

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

11 years agoImplement DR1270: braces can be elided in all aggregate initialization, not
Richard Smith [Thu, 6 Jun 2013 11:41:05 +0000 (11:41 +0000)]
Implement DR1270: braces can be elided in all aggregate initialization, not
just copy-list-initialization in a variable declaration. This effectively
reverts r142147.

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

11 years agoDisallow reinterpret_cast from pointer to bool on Windows
Hans Wennborg [Thu, 6 Jun 2013 09:16:36 +0000 (09:16 +0000)]
Disallow reinterpret_cast from pointer to bool on Windows

This became allowed by accident in r131201, but triggers an assert.
That patch added an exception to allow conversion from pointers to
narrow integral types for MSVC compatibility. However, a pointer can
already be converted to bool in a civilized manner; allowing conversion
via reinterpret_cast is a bad idea.

Fixes PR16222.

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

11 years agoFix clang-format's expression parser for leading }s.
Daniel Jasper [Thu, 6 Jun 2013 09:11:58 +0000 (09:11 +0000)]
Fix clang-format's expression parser for leading }s.

The leading "}" in the construct "} else if (..) {" was confusing the
expression parser. Thus, no fake parentheses were generated and the
indentation was broken in some cases.

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

11 years agoImprove c-style cast detection.
Daniel Jasper [Thu, 6 Jun 2013 08:20:20 +0000 (08:20 +0000)]
Improve c-style cast detection.

Before:
return (my_int) aaaa;
template <> void f<int>(int i)SOME_ANNOTATION;
f("aaaa" SOME_MACRO(aaaa)"aaaa");

After:
return (my_int)aaaa;
template <> void f<int>(int i) SOME_ANNOTATION;
f("aaaa" SOME_MACRO(aaaa) "aaaa");

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

11 years agoWhen a static storage duration temporary appears in a constant expression, it
Richard Smith [Thu, 6 Jun 2013 08:19:16 +0000 (08:19 +0000)]
When a static storage duration temporary appears in a constant expression, it
must be initialized by a constant expression (not just a core constant
expression), because we're going to emit it as a global. Core issue for this is
pending.

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

11 years agoDon't create a StringRef from a temporary string.
Richard Trieu [Thu, 6 Jun 2013 02:22:29 +0000 (02:22 +0000)]
Don't create a StringRef from a temporary string.

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

11 years ago[analyzer] Look through ExprWithCleanups to see if an expr's consumed.
Jordan Rose [Thu, 6 Jun 2013 01:57:24 +0000 (01:57 +0000)]
[analyzer] Look through ExprWithCleanups to see if an expr's consumed.

We based decisions during analysis and during path generation on whether
or not an expression is consumed, so if a top-level expression has
cleanups it's important for us to look through that.

<rdar://problem/14076125>

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

11 years ago[analyzer] Improve debug output for PathDiagnosticPieces.
Jordan Rose [Thu, 6 Jun 2013 01:57:19 +0000 (01:57 +0000)]
[analyzer] Improve debug output for PathDiagnosticPieces.

You can now dump a single PathDiagnosticPiece or PathDiagnosticLocation.

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

11 years agoclang/unittests/Format/FormatTest.cpp: Suppress utf8 literals with _MSC_VER. MS cl...
NAKAMURA Takumi [Thu, 6 Jun 2013 01:14:58 +0000 (01:14 +0000)]
clang/unittests/Format/FormatTest.cpp: Suppress utf8 literals with _MSC_VER. MS cl.exe is unaware of BOM-less utf8 source files.

FIXME: Encode Cyrillic and CJK characters below to appease MS compilers.

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

11 years ago[analyzer] Fix a crash that occurs when processing an rvalue array.
Anna Zaks [Thu, 6 Jun 2013 00:19:36 +0000 (00:19 +0000)]
[analyzer] Fix a crash that occurs when processing an rvalue array.

When processing ArrayToPointerDecay, we expect the array to be a location, not a LazyCompoundVal.
Special case the rvalue arrays by using a location to represent them. This case is handled similarly
elsewhere in the code.

Fixes PR16206.

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

11 years ago[analyzer; new edges] Don't crash if the top-level entry edge is missing.
Jordan Rose [Thu, 6 Jun 2013 00:12:41 +0000 (00:12 +0000)]
[analyzer; new edges] Don't crash if the top-level entry edge is missing.

We previously asserted that there was a top-level function entry edge, but
if the function decl's location is invalid (or within a macro) this edge
might not exist. Change the assertion to an actual check, and don't drop
the first path piece if it doesn't match.

<rdar://problem/14070304>

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

11 years ago[analyzer; new edges] Ignore self-edges, not all edges with the same location.
Jordan Rose [Thu, 6 Jun 2013 00:12:37 +0000 (00:12 +0000)]
[analyzer; new edges] Ignore self-edges, not all edges with the same location.

The edge optimizer needs to see edges for, say, implicit casts (which have
the same source location as their operand) to uniformly simplify the
entire path. However, we still don't want to produce edges from a statement
to /itself/, which could occur when two nodes in a row have the same
statement location.

This necessitated moving the check for redundant notes to after edge
optimization, since the check relies on notes being adjacent in the path.

<rdar://problem/14061675>

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

11 years agoIf we're splitting the dwarf for fission and don't want to use the
Eric Christopher [Wed, 5 Jun 2013 23:58:15 +0000 (23:58 +0000)]
If we're splitting the dwarf for fission and don't want to use the
integrated assembler then go ahead and still split the dwarf anyhow.

Add two tests, one to exercise existing behavior of not splitting
when we're just emitting assembly files and the other to test
that we split when we're not in integrated as mode.

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

11 years agoObjective-C: Provide fixit with suggested spelling correction
Fariborz Jahanian [Wed, 5 Jun 2013 18:46:14 +0000 (18:46 +0000)]
Objective-C: Provide fixit with suggested spelling correction
for -Wundeclared-selector warnings. // rdar://14039037

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

11 years agoPR14763: Debug info for non-trivial record parameters
David Blaikie [Wed, 5 Jun 2013 18:30:31 +0000 (18:30 +0000)]
PR14763: Debug info for non-trivial record parameters

There seems to have been some erroneous code attempting to describe the
ABI of parameters (non-trivial record parameters are passed by
reference). This would break the type of the function (especially when
it caused a mismatch between the type of a declaration & a definition)
causing PR14763 and PR14645.

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

11 years agoWhen the template specialization header is missing, set a valid source location for...
Argyrios Kyrtzidis [Wed, 5 Jun 2013 17:52:24 +0000 (17:52 +0000)]
When the template specialization header is missing, set a valid source location for the template keyword when recovering.

Otherwise ClassTemplateSpecializationDecl::getSourceRange() will mistakenly consider itself as an implicit partial specialization
and lead to a crash.

Fixes rdar://14063074

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

11 years ago[ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.
Peter Collingbourne [Wed, 5 Jun 2013 17:49:37 +0000 (17:49 +0000)]
[ms-cxxabi] Thread GlobalDecls through to CodeGenModule::getFunctionLinkage.

This is so that we can give destructor variants different linkage later.

Differential Revision: http://llvm-reviews.chandlerc.com/D819

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

11 years agoclang-check: Enable specification of additional compiler arguments
Pavel Labath [Wed, 5 Jun 2013 16:23:30 +0000 (16:23 +0000)]
clang-check: Enable specification of additional compiler arguments

Summary:
This adds two command-line parameters: -extra-arg and -extra-arg-before, which
enable the user to pass additional parameters to the compiler command.

Reviewers: klimek

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D919

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

11 years ago[ms-cxxabi] Fix vbptr offsets in memptrs when the vbptr is in an nvbase
Reid Kleckner [Wed, 5 Jun 2013 15:58:29 +0000 (15:58 +0000)]
[ms-cxxabi] Fix vbptr offsets in memptrs when the vbptr is in an nvbase

Also addresses a review comment from John from on r180985 by removing
the "== -1" check, since it's now reusing the correct code which has the
comment.

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

11 years agoSilence GCC warning.
Benjamin Kramer [Wed, 5 Jun 2013 15:37:50 +0000 (15:37 +0000)]
Silence GCC warning.

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

11 years agoAdded test with characters using four bytes in UTF-8 representation.
Alexander Kornienko [Wed, 5 Jun 2013 15:08:20 +0000 (15:08 +0000)]
Added test with characters using four bytes in UTF-8 representation.

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

11 years agoUTF-8 support for clang-format.
Alexander Kornienko [Wed, 5 Jun 2013 14:09:10 +0000 (14:09 +0000)]
UTF-8 support for clang-format.

Summary:
Detect if the file is valid UTF-8, and if this is the case, count code
points instead of just using number of bytes in all (hopefully) places, where
number of columns is needed. In particular, use the new
FormatToken.CodePointCount instead of TokenLength where appropriate.
Changed BreakableToken implementations to respect utf-8 character boundaries
when in utf-8 mode.

Reviewers: klimek, djasper

Reviewed By: djasper

CC: cfe-commits, rsmith, gribozavr
Differential Revision: http://llvm-reviews.chandlerc.com/D918

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

11 years agoRecommit r183298+r183300 'Get rid of VTableContext::ComputeMethodVTableIndices()...
Timur Iskhodzhanov [Wed, 5 Jun 2013 14:05:50 +0000 (14:05 +0000)]
Recommit r183298+r183300 'Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers()'

In r183298, I've used llvm::SmallPtrSet<..., 8> instead of llvm::SmallVector<..., 8> for NewVirtualFunctionsTy by mistake.
This only manifested when a class had more than 8 virtual functions, which wasn't covered by unit-tests

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

11 years ago... and actually run it
Timur Iskhodzhanov [Wed, 5 Jun 2013 13:50:24 +0000 (13:50 +0000)]
... and actually run it

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

11 years agoAdd a test for the breakage from r183298
Timur Iskhodzhanov [Wed, 5 Jun 2013 13:49:11 +0000 (13:49 +0000)]
Add a test for the breakage from r183298

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

11 years agoUnrevert the tests from r183298 as they pass with both old and new code
Timur Iskhodzhanov [Wed, 5 Jun 2013 13:12:36 +0000 (13:12 +0000)]
Unrevert the tests from r183298 as they pass with both old and new code

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

11 years agoRevert r183298 and r183300 as the former broke the virtual function lookup in libcxx...
Timur Iskhodzhanov [Wed, 5 Jun 2013 12:24:46 +0000 (12:24 +0000)]
Revert r183298 and r183300 as the former broke the virtual function lookup in libcxx __locale

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

11 years agoMake clang tools ignore -fcolor-diagnostics and -fdiagnostics-color retrieved from...
Alexander Kornienko [Wed, 5 Jun 2013 11:33:11 +0000 (11:33 +0000)]
Make clang tools ignore -fcolor-diagnostics and -fdiagnostics-color retrieved from the compilation database.

Summary:
Clang tools' diagnostic output could be force colored when a command
line from the compilation database contains -fcolor-diagnostics or
-fdiagnostics-color. This is not what we want e.g. for vim integration.

Reviewers: klimek

Reviewed By: klimek

CC: cfe-commits, revane, jordan_rose
Differential Revision: http://llvm-reviews.chandlerc.com/D917

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

11 years agoASTTests/DeclTest.cpp: Tweak on msvc target to add "-fno-ms-extensions".
NAKAMURA Takumi [Wed, 5 Jun 2013 06:54:06 +0000 (06:54 +0000)]
ASTTests/DeclTest.cpp: Tweak on msvc target to add "-fno-ms-extensions".

MS extensions don't prefer imaginary suffix even with -std=c++11.

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

11 years agoFix fallout from r183298, unused function (CollectPrimaryBases) causing the -Werror...
David Blaikie [Wed, 5 Jun 2013 06:50:40 +0000 (06:50 +0000)]
Fix fallout from r183298, unused function (CollectPrimaryBases) causing the -Werror build to fail

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

11 years agoFix the DUMP_OVERRIDERS macro in the VTableBuilder.cpp
Timur Iskhodzhanov [Wed, 5 Jun 2013 06:40:07 +0000 (06:40 +0000)]
Fix the DUMP_OVERRIDERS macro in the VTableBuilder.cpp

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

11 years agoGet rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtu...
Timur Iskhodzhanov [Wed, 5 Jun 2013 06:36:37 +0000 (06:36 +0000)]
Get rid of VTableContext::ComputeMethodVTableIndices() and VTableContext::getNumVirtualFunctionPointers(); also add some tests for the VTable indices output to make sure we don't regress

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

11 years agoPR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types used via...
David Blaikie [Wed, 5 Jun 2013 05:32:23 +0000 (05:32 +0000)]
PR16214: Debug Info: -flimit-debug-info doesn't omit definitions for types used via typedefs

In an effort to make -flimit-debug-info more consistent I over-shot the
mark & made types used via typedefs never produce definitions in the
debug info (even if the type was used in a way that would require a
definition).

The fix for this is to do exactly what I was hoping to do at some point
- plumb the declaration/definition choice through the various layers of
"CreateType" in CGDebugInfo. In this way we can produce declarations
whenever they are sufficient & definitions otherwise - including when
qualifiers are used, for example (discovered in PR14467). This may not
be complete (there may be other types/situations where we need to
propagate the "declaration/definition" choice) but it lays the basic
foundation which we can enhance in future iterations.

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

11 years agoDefault to PIE and using stack protection on OpenBSD.
Rafael Espindola [Wed, 5 Jun 2013 04:28:55 +0000 (04:28 +0000)]
Default to PIE and using stack protection on OpenBSD.

Patch by Matthew Dempsky.

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

11 years agoImplement SparcV9ABIInfo::EmitVAArg.
Jakob Stoklund Olesen [Wed, 5 Jun 2013 03:00:18 +0000 (03:00 +0000)]
Implement SparcV9ABIInfo::EmitVAArg.

This could actually be implemented with the LLVM IR va_arg instruction,
but it doesn't seem to offer any advantages over accessing the va_list
pointer directly.

Using the va_list pointer directly makes it possible to perform type
coercion directly from the argument array, and the va_list updates are
exposed to the optimizers.

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

11 years agoFix CoerceIntOrPtrToIntOrPtr on big-endian targets.
Jakob Stoklund Olesen [Wed, 5 Jun 2013 03:00:13 +0000 (03:00 +0000)]
Fix CoerceIntOrPtrToIntOrPtr on big-endian targets.

Type coercion for argument passing is equivalent to storing the source
type and loading the destination type from the same pointer. On
big-endian targets, this means that the high bits of integers are
preserved.

This patch fixes the CoerceIntOrPtrToIntOrPtr() function on big-endian
targets by inserting the required shift instructions to preserve the
high bits instead of the low bits.

This is used by SparcABIInfo when passing small structs in the high bits
of registers.

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

11 years agoHeed ABIArgInfo::getInReg() for return values.
Jakob Stoklund Olesen [Wed, 5 Jun 2013 03:00:09 +0000 (03:00 +0000)]
Heed ABIArgInfo::getInReg() for return values.

The 'inreg' attribute can also be applied to function return values in
LLVM IR. The SPARC v9 backend is using the flag when returning structs
containing 32-bit floats.

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