platform/upstream/llvm.git
11 years agoFixed some whitespace/80+ violations. Also added a space after a namespace declaration.
Michael Gottesman [Tue, 29 Jan 2013 04:58:30 +0000 (04:58 +0000)]
Fixed some whitespace/80+ violations. Also added a space after a namespace declaration.

llvm-svn: 173772

11 years agoC++11 status:
Richard Smith [Tue, 29 Jan 2013 04:55:18 +0000 (04:55 +0000)]
C++11 status:
 * Mark 'sequence points' as done now we have a warning for unsequenced operations
 * Mark 'memory model' as done now we correctly model bitfield operations

llvm-svn: 173771

11 years agoAdded missing dashes from header declaration comment.
Michael Gottesman [Tue, 29 Jan 2013 04:53:55 +0000 (04:53 +0000)]
Added missing dashes from header declaration comment.

llvm-svn: 173770

11 years agoJuggled Debug.h from ObjCARC.h to only the including cpp files that
Michael Gottesman [Tue, 29 Jan 2013 04:51:59 +0000 (04:51 +0000)]
Juggled Debug.h from ObjCARC.h to only the including cpp files that
actually have DEBUG statements. Also changed raw_ostream in said header
to be a forward declaration (removing an include).

llvm-svn: 173769

11 years agoPropagate the spelling list index for an attribute across template instantiation.
Richard Smith [Tue, 29 Jan 2013 04:21:28 +0000 (04:21 +0000)]
Propagate the spelling list index for an attribute across template instantiation.

llvm-svn: 173768

11 years agoSorted includes using utils/sort_includes.
Michael Gottesman [Tue, 29 Jan 2013 04:20:52 +0000 (04:20 +0000)]
Sorted includes using utils/sort_includes.

llvm-svn: 173767

11 years agoPR15017: A '>' can appear after a type-specifier in a template-argument-list.
Richard Smith [Tue, 29 Jan 2013 04:13:32 +0000 (04:13 +0000)]
PR15017: A '>' can appear after a type-specifier in a template-argument-list.
It turns out that there's no correctness bug here (because we can't have a type
definition in this location), but there was a diagnostic bug.

llvm-svn: 173766

11 years agoAdd a test case for attribute print.
Michael Han [Tue, 29 Jan 2013 04:13:20 +0000 (04:13 +0000)]
Add a test case for attribute print.

llvm-svn: 173765

11 years agoAdded two missing headers from ObjCARCAliasAnalysis.h.
Michael Gottesman [Tue, 29 Jan 2013 04:09:24 +0000 (04:09 +0000)]
Added two missing headers from ObjCARCAliasAnalysis.h.

This was missed since whenever I was including ObjCARCAliasAnalysis.h, I
was including ObjCARC.h before it which included these includes
(resulting in no compilation breakage).

llvm-svn: 173764

11 years agoRemoved InstCombine/Targets as library dependencies for libObjCARCOpts since they...
Michael Gottesman [Tue, 29 Jan 2013 04:05:17 +0000 (04:05 +0000)]
Removed InstCombine/Targets as library dependencies for libObjCARCOpts since they are unnecessary.

llvm-svn: 173763

11 years agoModify the tests for the (sorted) order that the attributes come out as now.
Bill Wendling [Tue, 29 Jan 2013 03:21:00 +0000 (03:21 +0000)]
Modify the tests for the (sorted) order that the attributes come out as now.

llvm-svn: 173762

11 years agoConvert getAttributes() to return an AttributeSetNode.
Bill Wendling [Tue, 29 Jan 2013 03:20:31 +0000 (03:20 +0000)]
Convert getAttributes() to return an AttributeSetNode.

The AttributeSetNode contains all of the attributes. This removes one (hopefully
last) use of the Attribute class as a container of multiple attributes.

llvm-svn: 173761

11 years agoExtracted ObjCARCContract from ObjCARCOpts into its own file.
Michael Gottesman [Tue, 29 Jan 2013 03:03:03 +0000 (03:03 +0000)]
Extracted ObjCARCContract from ObjCARCOpts into its own file.

This also required adding 2x headers Dependency Analysis.h/Provenance Analysis.h
and a .cpp file DependencyAnalysis.cpp to unentangle the dependencies inbetween
ObjCARCContract and ObjCARCOpts.

llvm-svn: 173760

11 years agoRemoved some cruft from ObjCARCAliasAnalysis.cpp.
Michael Gottesman [Tue, 29 Jan 2013 03:02:59 +0000 (03:02 +0000)]
Removed some cruft from ObjCARCAliasAnalysis.cpp.

llvm-svn: 173759

11 years agoPR15100: look through type sugar when determining whether we have one of the
Richard Smith [Tue, 29 Jan 2013 02:49:47 +0000 (02:49 +0000)]
PR15100: look through type sugar when determining whether we have one of the
forms of 'main' which we accept as an extension.

llvm-svn: 173758

11 years agoSince an address (0x12346) is an expression, be brief.
Enrico Granata [Tue, 29 Jan 2013 02:46:04 +0000 (02:46 +0000)]
Since an address (0x12346) is an expression, be brief.

llvm-svn: 173757

11 years agoFold tests for C++ 'main' into a single file.
Richard Smith [Tue, 29 Jan 2013 02:42:09 +0000 (02:42 +0000)]
Fold tests for C++ 'main' into a single file.

llvm-svn: 173756

11 years agoTeach SDISel to combine fsin / fcos into a fsincos node if the following
Evan Cheng [Tue, 29 Jan 2013 02:32:37 +0000 (02:32 +0000)]
Teach SDISel to combine fsin / fcos into a fsincos node if the following
conditions are met:
1. They share the same operand and are in the same BB.
2. Both outputs are used.
3. The target has a native instruction that maps to ISD::FSINCOS node or
   the target provides a sincos library call.

Implemented the generic optimization in sdisel and enabled it for
Mac OSX. Also added an additional optimization for x86_64 Mac OSX by
using an alternative entry point __sincos_stret which returns the two
results in xmm0 / xmm1.

rdar://13087969
PR13204

llvm-svn: 173755

11 years agoTest that we print MS keyword attributes without a __declspec(...) adornment.
Richard Smith [Tue, 29 Jan 2013 02:31:57 +0000 (02:31 +0000)]
Test that we print MS keyword attributes without a __declspec(...) adornment.

llvm-svn: 173754

11 years ago<rdar://problem/12552374>
Enrico Granata [Tue, 29 Jan 2013 01:48:30 +0000 (01:48 +0000)]
<rdar://problem/12552374>

Replacing the address argument type with address-expression in cases where StringToAddress() is used, and hence an expression can be passed where previously only a numeric address was allowed
This makes the documentation more clear and helps users discover that they can truly pass in an expression in these situations.

llvm-svn: 173753

11 years agoTreat alignas and _Alignas as keyword attributes. This allows us to
Richard Smith [Tue, 29 Jan 2013 01:48:07 +0000 (01:48 +0000)]
Treat alignas and _Alignas as keyword attributes. This allows us to
pretty-print them properly (modulo the more general badness in alignment
attribute printing).

llvm-svn: 173752

11 years agoUse an AttrBuilder to generate the correct AttributeSet.
Bill Wendling [Tue, 29 Jan 2013 01:43:29 +0000 (01:43 +0000)]
Use an AttrBuilder to generate the correct AttributeSet.

We no longer accept an encoded integer as representing all of the
attributes. Convert this via the AttrBuilder class into an AttributeSet with the
correct representation (an AttributeSetImpl that holds a list of Attribute
objects).

llvm-svn: 173750

11 years agoActually remove the hack which was blocking the Borland-style attributes from
Richard Smith [Tue, 29 Jan 2013 01:38:41 +0000 (01:38 +0000)]
Actually remove the hack which was blocking the Borland-style attributes from
working, and add the missing attribute spellings. This brings _pascal,
_fastcall, _stdcall and _cdecl to life in -fborland-extensions mode.

llvm-svn: 173749

11 years ago<rdar://problem/12890171>
Enrico Granata [Tue, 29 Jan 2013 01:35:01 +0000 (01:35 +0000)]
<rdar://problem/12890171>

Providing a compact display mode for "po" to use where the convenience variable name and the pointer value are both hidden.
This is for convenience when dealing with ObjC instances where the description often gets it right and the debugger-provided information is not useful to most people.
If you need either of these, "expr" will still show them.

llvm-svn: 173748

11 years agoDon't crash while printing APValues that are lvalues casted to a
Douglas Gregor [Tue, 29 Jan 2013 01:26:43 +0000 (01:26 +0000)]
Don't crash while printing APValues that are lvalues casted to a
decidedly non-reference, non-pointer type. Fixes <rdar://problem/13090123>.

llvm-svn: 173747

11 years agoReplace AS_MSTypespec with AS_Keyword, for representing any attribute spelled
Richard Smith [Tue, 29 Jan 2013 01:24:26 +0000 (01:24 +0000)]
Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelled
as a keyword. Rationalize existing attributes to use it as appropriate, and to
not lie about some __declspec attributes being GNU attributes. In passing,
remove a gross hack which was discarding attributes which we could handle. This
results in us actually respecting the __pascal keyword again.

llvm-svn: 173746

11 years ago<rdar://problem/12524607>
Greg Clayton [Tue, 29 Jan 2013 01:17:09 +0000 (01:17 +0000)]
<rdar://problem/12524607>

Flush the process when symbols are loaded/unloaded manually. This was going on in:
- "target modules load" command
- SBTarget::SetSectionLoadAddress(...)
- SBTarget::ClearSectionLoadAddress(...)
- SBTarget::SetModuleLoadAddress(...)
- SBTarget::ClearModuleLoadAddress(...)

llvm-svn: 173745

11 years agoAbstract the behavior of when to use base-class tail padding.
John McCall [Tue, 29 Jan 2013 01:14:22 +0000 (01:14 +0000)]
Abstract the behavior of when to use base-class tail padding.

For fun, I added a comedy "actually obey the C++11 POD rules" option
which nobody is allowed to use.

llvm-svn: 173744

11 years ago[ELF] Give Chunk a ELFTargetInfo.
Michael J. Spencer [Tue, 29 Jan 2013 01:07:47 +0000 (01:07 +0000)]
[ELF] Give Chunk a ELFTargetInfo.

llvm-svn: 173743

11 years agoConvert the AttrBuilder into a list of Attributes instead of one Attribute object...
Bill Wendling [Tue, 29 Jan 2013 01:02:03 +0000 (01:02 +0000)]
Convert the AttrBuilder into a list of Attributes instead of one Attribute object that holds all of its attributes.

llvm-svn: 173742

11 years ago[ELF] Remove OwningPtr from the Chunk::write interface.
Michael J. Spencer [Tue, 29 Jan 2013 01:00:21 +0000 (01:00 +0000)]
[ELF] Remove OwningPtr from the Chunk::write interface.

llvm-svn: 173741

11 years ago[ELF] Clean up doxygen comments.
Michael J. Spencer [Tue, 29 Jan 2013 01:00:04 +0000 (01:00 +0000)]
[ELF] Clean up doxygen comments.

llvm-svn: 173740

11 years agoFormatting correction
Andrew Kaylor [Tue, 29 Jan 2013 00:50:18 +0000 (00:50 +0000)]
Formatting correction

llvm-svn: 173739

11 years agoS'more small non-functional changes in comments and #includes.
Bill Wendling [Tue, 29 Jan 2013 00:48:16 +0000 (00:48 +0000)]
S'more small non-functional changes in comments and #includes.

llvm-svn: 173738

11 years agoDescribe the data formatters as part of the architecture
Enrico Granata [Tue, 29 Jan 2013 00:42:12 +0000 (00:42 +0000)]
Describe the data formatters as part of the architecture

llvm-svn: 173734

11 years agoReorder some functions and add comments. No functionality change.
Bill Wendling [Tue, 29 Jan 2013 00:34:06 +0000 (00:34 +0000)]
Reorder some functions and add comments. No functionality change.

llvm-svn: 173733

11 years agoAdding a Makefile. Hopefully that will make the Linux buildbot happy
Enrico Granata [Tue, 29 Jan 2013 00:29:33 +0000 (00:29 +0000)]
Adding a Makefile. Hopefully that will make the Linux buildbot happy

llvm-svn: 173732

11 years agoFixed a "wchar_t" typo.
Greg Clayton [Tue, 29 Jan 2013 00:29:18 +0000 (00:29 +0000)]
Fixed a "wchar_t" typo.

llvm-svn: 173731

11 years agoUnroll again after running BBVectorize
Hal Finkel [Tue, 29 Jan 2013 00:22:49 +0000 (00:22 +0000)]
Unroll again after running BBVectorize

Because BBVectorize may significantly shorten a loop body, unroll
again after vectorization. This is especially important when using
runtime or partial unrolling.

llvm-svn: 173730

11 years agoAdd isBGQ method to PPCSubtarget
Hal Finkel [Tue, 29 Jan 2013 00:22:47 +0000 (00:22 +0000)]
Add isBGQ method to PPCSubtarget

This function will be used in future commits.

llvm-svn: 173729

11 years ago<rdar://problem/12978143>
Enrico Granata [Mon, 28 Jan 2013 23:47:25 +0000 (23:47 +0000)]
<rdar://problem/12978143>

Data formatters now cache themselves.
This commit provides a new formatter cache mechanism. Upon resolving a formatter (summary or synthetic), LLDB remembers the resolution for later faster retrieval.
Also moved the data formatters subsystem from the core to its own group and folder for easier management, and done some code reorganization.
The ObjC runtime v1 now returns a class name if asked for the dynamic type of an object. This is required for formatters caching to work with the v1 runtime.
Lastly, this commit disposes of the old hack where ValueObjects had to remember whether they were queried for formatters with their static or dynamic type.
Now the ValueObjectDynamicValue class works well enough that we can use its dynamic value setting for the same purpose.

llvm-svn: 173728

11 years agoFinish semantic analysis for [[carries_dependency]] attribute.
Richard Smith [Mon, 28 Jan 2013 22:42:45 +0000 (22:42 +0000)]
Finish semantic analysis for [[carries_dependency]] attribute.

This required plumbing through a new flag to determine whether a ParmVarDecl is
actually a parameter of a function declaration (as opposed to a function
typedef etc, where the attribute is prohibited). Weirdly, this attribute (just
like [[noreturn]]) cannot be applied to a function type, just to a function
declaration (and its parameters).

llvm-svn: 173726

11 years agoTry to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.
Bill Wendling [Mon, 28 Jan 2013 22:33:39 +0000 (22:33 +0000)]
Try to appease some broken compilers by using 'unsigned' instead of 'uint64_t'.

llvm-svn: 173725

11 years agoAlways define types from stdint.h so they are always available for use in expressions...
Greg Clayton [Mon, 28 Jan 2013 22:31:43 +0000 (22:31 +0000)]
Always define types from stdint.h so they are always available for use in expressions no matter what debug info you have. Types added are:

int8_t
uint8_t
int16_t
uint16_t
int32_t
uint32_t
int64_t
uint64_t
intptr_t
uintptr_t
size_t
ptrdiff_t
whar_t

llvm-svn: 173724

11 years agoAvoid Unnecessary Builds
David Greene [Mon, 28 Jan 2013 22:05:50 +0000 (22:05 +0000)]
Avoid Unnecessary Builds

By default, stop the universe build if a key component fails.  This
avoids useless builds when we know a package is broken anyway.
Provide a --keep-going option to override this behavior.

llvm-svn: 173723

11 years agoRemove the AttributeWithIndex class.
Bill Wendling [Mon, 28 Jan 2013 21:55:20 +0000 (21:55 +0000)]
Remove the AttributeWithIndex class.

The AttributeWithIndex class exposed the interior structure of the AttributeSet
class. That was gross. Remove it and all of the code that relied upon it.

llvm-svn: 173722

11 years agoAdd a comment mentioning that InstructionSimplify routines do,
Dan Gohman [Mon, 28 Jan 2013 21:45:32 +0000 (21:45 +0000)]
Add a comment mentioning that InstructionSimplify routines do,
in fact, resolve undef uses.

llvm-svn: 173721

11 years agoFileCheck'ize tests
Dmitri Gribenko [Mon, 28 Jan 2013 21:43:46 +0000 (21:43 +0000)]
FileCheck'ize tests

llvm-svn: 173720

11 years agodocs: reorganize front page slightly
Sean Silva [Mon, 28 Jan 2013 21:28:10 +0000 (21:28 +0000)]
docs: reorganize front page slightly

llvm-svn: 173718

11 years agoFileCheck'ize a test
Dmitri Gribenko [Mon, 28 Jan 2013 21:04:29 +0000 (21:04 +0000)]
FileCheck'ize a test

llvm-svn: 173717

11 years agoMigrate a test to -verify
Dmitri Gribenko [Mon, 28 Jan 2013 20:55:54 +0000 (20:55 +0000)]
Migrate a test to -verify

llvm-svn: 173716

11 years ago[driver] Revise this test to remove the dependency on the integrate assembler.
Chad Rosier [Mon, 28 Jan 2013 20:51:27 +0000 (20:51 +0000)]
[driver] Revise this test to remove the dependency on the integrate assembler.

llvm-svn: 173715

11 years agoFileCheck'ize and merge tests
Dmitri Gribenko [Mon, 28 Jan 2013 20:40:50 +0000 (20:40 +0000)]
FileCheck'ize and merge tests

llvm-svn: 173714

11 years agoUndo my re-wording of the "ARC forbids Objective-C objects in ..."
Douglas Gregor [Mon, 28 Jan 2013 20:13:44 +0000 (20:13 +0000)]
Undo my re-wording of the "ARC forbids Objective-C objects in ..."
error. Jordan is right.

llvm-svn: 173713

11 years agoAdd support for source and line information to IntelJITEventListener for object emitt...
Andrew Kaylor [Mon, 28 Jan 2013 19:52:37 +0000 (19:52 +0000)]
Add support for source and line information to IntelJITEventListener for object emitted by MCJIT.

llvm-svn: 173712

11 years agoFix gcc/printf/ISO C++ warning
Edwin Vane [Mon, 28 Jan 2013 19:34:42 +0000 (19:34 +0000)]
Fix gcc/printf/ISO C++ warning

Remove the use of the 't' length modifier to avoid a gcc warning. Based
on usage, 32 bits of precision is good enough for printing a stack
offset for a stack trace.

't' length modifier isn't in C++03 but it *is* in C++11. Added a FIXME
to reintroduce once LLVM makes the switch to C++11.

Reviewer: gribozavr
llvm-svn: 173711

11 years agoadd register section, remove contentType from sectionKey
Shankar Easwaran [Mon, 28 Jan 2013 19:21:04 +0000 (19:21 +0000)]
add register section, remove contentType from sectionKey

llvm-svn: 173709

11 years agoForbid the use of objects in unions in Objective-C++ ARC. Fixes
Douglas Gregor [Mon, 28 Jan 2013 19:08:09 +0000 (19:08 +0000)]
Forbid the use of objects in unions in Objective-C++ ARC. Fixes
<rdar://problem/13098104>.

llvm-svn: 173708

11 years agoEnable the global module index by default. Introduce the
Douglas Gregor [Mon, 28 Jan 2013 18:38:02 +0000 (18:38 +0000)]
Enable the global module index by default. Introduce the
-fno-modules-global-index -cc1 option to allow one to disable the
index for performance testing purposes, but with a 10% win in
-fsyntax-only time, there is no reason a user would do this.

llvm-svn: 173707

11 years agoThis patch addresses bug 15031.
Bill Schmidt [Mon, 28 Jan 2013 18:36:58 +0000 (18:36 +0000)]
This patch addresses bug 15031.

The common code in the post-RA scheduler to break anti-dependencies on the
critical path contained a flaw.  In the reported case, an anti-dependency
between the overlapping registers %X4 and %R4 exists:

%X29<def> = OR8 %X4, %X4
%R4<def>, %X3<def,dead,tied3> = LBZU 1, %X3<kill,tied1>

The unpatched code breaks the dependency by replacing %R4 and its uses
with %R3, the first register on the available list.  However, %R3 and
%X3 overlap, so this creates two overlapping definitions on the same
instruction.

The fix is straightforward, preventing selection of a register that
overlaps any other defined register on the same instruction.

The test case is reduced from the bug report, and verifies that we no
longer produce "lbzu 3, 1(3)" when breaking this anti-dependency.

llvm-svn: 173706

11 years agoASTReader and profiling statistics indicate that implementing a method
Douglas Gregor [Mon, 28 Jan 2013 18:29:39 +0000 (18:29 +0000)]
ASTReader and profiling statistics indicate that implementing a method
pool in the global module index is not worthwhile. Update comments to
limit the scope of the global module index to identifiers.

llvm-svn: 173705

11 years agoTests: remove disabled llvm-gcc invocations
Dmitri Gribenko [Mon, 28 Jan 2013 18:01:33 +0000 (18:01 +0000)]
Tests: remove disabled llvm-gcc invocations

llvm-svn: 173703

11 years agoAdd some more ASTReader statistics for global method pool lookups.
Douglas Gregor [Mon, 28 Jan 2013 17:54:36 +0000 (17:54 +0000)]
Add some more ASTReader statistics for global method pool lookups.

llvm-svn: 173702

11 years agoPR15067 (again): Don't warn about UCNs in C90 if we're raw-lexing.
Jordan Rose [Mon, 28 Jan 2013 17:49:02 +0000 (17:49 +0000)]
PR15067 (again): Don't warn about UCNs in C90 if we're raw-lexing.

Fixes a crash. Thanks, Richard.

llvm-svn: 173701

11 years agoFix comment.
Eric Christopher [Mon, 28 Jan 2013 17:39:03 +0000 (17:39 +0000)]
Fix comment.

llvm-svn: 173700

11 years agoFix comment.
Eric Christopher [Mon, 28 Jan 2013 17:33:26 +0000 (17:33 +0000)]
Fix comment.

llvm-svn: 173698

11 years agoFileCheck'ize and merge tests
Dmitri Gribenko [Mon, 28 Jan 2013 17:31:40 +0000 (17:31 +0000)]
FileCheck'ize and merge tests

llvm-svn: 173697

11 years agoFileCheck'ize test
Dmitri Gribenko [Mon, 28 Jan 2013 17:30:37 +0000 (17:30 +0000)]
FileCheck'ize test

llvm-svn: 173696

11 years agoFix a bug that would lead to bad line break decisions in for loops.
Daniel Jasper [Mon, 28 Jan 2013 17:30:17 +0000 (17:30 +0000)]
Fix a bug that would lead to bad line break decisions in for loops.

Before:
    for (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa = aaaaaaaaaaaaaaa
             .aaaaaaaaaaaaaaaa;
         aaaaaaaaaaa != aaaaaaaaaaaaaaaaaaa; ++aaaaaaaaaaa) {}

After:
    for (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaa =
             aaaaaaaaaaaaaaa.aaaaaaaaaaaaaaaa;
         aaaaaaaaaaa != aaaaaaaaaaaaaaaaaaa; ++aaaaaaaaaaa) {}

llvm-svn: 173695

11 years agoUse the correct order of NOINLINE vs ret type to fix Windows build
Timur Iskhodzhanov [Mon, 28 Jan 2013 17:29:50 +0000 (17:29 +0000)]
Use the correct order of NOINLINE vs ret type to fix Windows build

llvm-svn: 173694

11 years agoBack out r173689. It doesn't matter when we're building with Clang anyway.
Douglas Gregor [Mon, 28 Jan 2013 17:26:34 +0000 (17:26 +0000)]
Back out r173689. It doesn't matter when we're building with Clang anyway.

llvm-svn: 173693

11 years agoEliminate memory allocation from most invocations of
Douglas Gregor [Mon, 28 Jan 2013 16:46:33 +0000 (16:46 +0000)]
Eliminate memory allocation from most invocations of
ModuleManager::visit() by keeping a free list of the two data
structures used to store state (a preallocated stack and a visitation
number vector). Improves -fsyntax-only performance for my modules test
case by 2.8%. Modules has pulled ahead by almost 10% with the global
module index.

llvm-svn: 173692

11 years agoVectorization Factor clarification
Renato Golin [Mon, 28 Jan 2013 16:02:45 +0000 (16:02 +0000)]
Vectorization Factor clarification

llvm-svn: 173691

11 years agoDon't put a function's return type on its own line in Google style.
Daniel Jasper [Mon, 28 Jan 2013 15:40:20 +0000 (15:40 +0000)]
Don't put a function's return type on its own line in Google style.

This would be against the style guide:
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml?showone=Function_Declarations_and_Definitions#Function_Declarations_and_Definitions

Not sure what to do as a last resort if the function signature does not
fit onto a single line in Google style ..

llvm-svn: 173690

11 years agoNote that SrcMgr::SLocEntry's are POD-like, so SmallVector can do a
Douglas Gregor [Mon, 28 Jan 2013 15:39:10 +0000 (15:39 +0000)]
Note that SrcMgr::SLocEntry's are POD-like, so SmallVector can do a
better job with them. Shaves off 0.7% of -fparse-only time for a
modules test case. Sure makes you wonder...

llvm-svn: 173689

11 years agoLet clang-format break after a function's return type.
Daniel Jasper [Mon, 28 Jan 2013 15:16:31 +0000 (15:16 +0000)]
Let clang-format break after a function's return type.

Before:
TypeSpecDecl *TypeSpecDecl::Create(ASTContext &C, DeclContext *DC,
                                   SourceLocation L, IdentifierInfo *II,
                                   Type *T) {}

After:
TypeSpecDecl *
TypeSpecDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation L,
                     IdentifierInfo *II, Type *T) {}

This fixes llvm.org/PR14717.

llvm-svn: 173688

11 years ago[msan] A runtime call to support custom allocators.
Evgeniy Stepanov [Mon, 28 Jan 2013 13:52:49 +0000 (13:52 +0000)]
[msan] A runtime call to support custom allocators.

llvm-svn: 173687

11 years ago[msan] Remove icmp tests that require exact shadow propagation.
Evgeniy Stepanov [Mon, 28 Jan 2013 13:45:16 +0000 (13:45 +0000)]
[msan] Remove icmp tests that require exact shadow propagation.

llvm-svn: 173686

11 years agoMake continuations in constructor initializers consistent.
Daniel Jasper [Mon, 28 Jan 2013 13:31:35 +0000 (13:31 +0000)]
Make continuations in constructor initializers consistent.

Before:
Constructor
    : LooooooooooooooooooooongVariable(
        LooooooooooooooooooooongValue) {}

After:
Constructor
    : LooooooooooooooooooooongVariable(
          LooooooooooooooooooooongValue) {}

llvm-svn: 173685

11 years agoInitial support for formatting range-based for-loops.
Daniel Jasper [Mon, 28 Jan 2013 13:21:16 +0000 (13:21 +0000)]
Initial support for formatting range-based for-loops.

Before (in good cases):
for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
     : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
for (auto aaaaaaaaaaaaaaaaaaaa : aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa,
aaaa)) {}

After:
for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa :
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}
for (auto aaaaaaaaaaaaaaaaaaaa :
     aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaa)) {}

llvm-svn: 173684

11 years agoImprove formatting of conditional expressions.
Daniel Jasper [Mon, 28 Jan 2013 12:45:14 +0000 (12:45 +0000)]
Improve formatting of conditional expressions.

Before we did not really systematically format those. Now, we format the
different cases as:

- 1 Line:  a ? b : c;
- 2 Lines: short ? loooooooooong
                 : loooooooooong
- 2 Lines: loooooooooooooooong
               ? short : short
- 3 Lines: loooooooooooooooong
               ? loooooooooooooong
               : loooooooooooooong

Not sure whether "?" and ":" should go on the new line, but it seems to
be the most consistent approach.

llvm-svn: 173683

11 years ago[msan] Mostly disable msan-handle-icmp-exact.
Evgeniy Stepanov [Mon, 28 Jan 2013 11:42:28 +0000 (11:42 +0000)]
[msan] Mostly disable msan-handle-icmp-exact.

It is way too slow. Change the default option value to 0.
Always do exact shadow propagation for unsigned ICmp with constants, it is
cheap (under 1% cpu time) and required for correctness.

llvm-svn: 173682

11 years ago[ASan] fix a bug in allocator-v2 which could lead to SEGV on realloc(malloc(0), 4)
Alexey Samsonov [Mon, 28 Jan 2013 11:24:13 +0000 (11:24 +0000)]
[ASan] fix a bug in allocator-v2 which could lead to SEGV on realloc(malloc(0), 4)

llvm-svn: 173681

11 years agoSeveral small changes in formatting decisions.
Daniel Jasper [Mon, 28 Jan 2013 09:35:24 +0000 (09:35 +0000)]
Several small changes in formatting decisions.

1. Use a hanging ident for function calls nested in binary expressions.
   E.g.:
   int aaaaa = aaaaaaaaa && aaaaaaaaaa(
                                aaaaaaaaaa);

2. Slightly improve heuristic for builder type expressions and reduce
   penalty for breaking before "." and "->" in those.

3. Remove  mostly obsolete metric of decreasing indent level. This
   fixes: llvm.org/PR14931.

Changes #1 and #2 were necessary to keep tests passing after #3.

llvm-svn: 173680

11 years agoRevert r173678.
Evgeniy Stepanov [Mon, 28 Jan 2013 09:18:40 +0000 (09:18 +0000)]
Revert r173678.

Broken tests.

llvm-svn: 173679

11 years ago[msan] Make msan-handle-icmp-exact=0 by default.
Evgeniy Stepanov [Mon, 28 Jan 2013 09:15:15 +0000 (09:15 +0000)]
[msan] Make msan-handle-icmp-exact=0 by default.

50% slowdown on one of the specs.

llvm-svn: 173678

11 years agoCMake: simplify build rules for compiler-rt unit tests. This fixes warnings in Ninja...
Alexey Samsonov [Mon, 28 Jan 2013 09:07:30 +0000 (09:07 +0000)]
CMake: simplify build rules for compiler-rt unit tests. This fixes warnings in Ninja build tree.

llvm-svn: 173677

11 years ago[asan] fix a crash in asan stats printing (initialize the allocator in __asan_init)
Kostya Serebryany [Mon, 28 Jan 2013 08:05:47 +0000 (08:05 +0000)]
[asan] fix a crash in asan stats printing (initialize the allocator in __asan_init)

llvm-svn: 173676

11 years agoImprove indentation after breaking at nested name specifiers.
Daniel Jasper [Mon, 28 Jan 2013 07:43:15 +0000 (07:43 +0000)]
Improve indentation after breaking at nested name specifiers.

These always represent a continuation and we should increase the ident.

Before:
aaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa::
          aaaaaaaaaaaaaaaaaaaa);

After:
aaaaaaaaa(aaaaaaaaaaaaaaaaaaaaa::
              aaaaaaaaaaaaaaaaaaaa);

llvm-svn: 173675

11 years agoFix 256-bit PALIGNR comment decoding to understand that it works on independent 256...
Craig Topper [Mon, 28 Jan 2013 07:41:18 +0000 (07:41 +0000)]
Fix 256-bit PALIGNR comment decoding to understand that it works on independent 256-bit lanes.

llvm-svn: 173674

11 years agoAvoid confusing identations for multi-parameter functions.
Daniel Jasper [Mon, 28 Jan 2013 07:35:34 +0000 (07:35 +0000)]
Avoid confusing identations for multi-parameter functions.

Before:
aaaaaaaa(aaaaaaaaa(
    aaaaaaaaaa(),
         aaaaaaaaa);

After:
aaaaaaaa(aaaaaaaaa(
             aaaaaaaaaa(),
         aaaaaaaaa);

llvm-svn: 173673

11 years agoA bugfix for tblgen, in the function ‘emitSourceFileHeader’.
Nadav Rotem [Mon, 28 Jan 2013 07:35:33 +0000 (07:35 +0000)]
A bugfix for tblgen, in the function ‘emitSourceFileHeader’.
When the first parameter (‘Desc’) is more than 80 characters long, it will result the header line that contains the description to be more
Than (4GB!) long. Not only it takes forever to produce, the output file cannot be open, since its ginormous.

Patch by Elior Malul.

llvm-svn: 173672

11 years ago[asan] two more internal flags for asan-rt: print_stats (0) and print_legend (1)
Kostya Serebryany [Mon, 28 Jan 2013 07:34:22 +0000 (07:34 +0000)]
[asan] two more internal flags for asan-rt: print_stats (0) and print_legend (1)

llvm-svn: 173671

11 years agoPrint warning instead of error if optional ASan features are enabled w/o specifying...
Alexey Samsonov [Mon, 28 Jan 2013 07:20:44 +0000 (07:20 +0000)]
Print warning instead of error if optional ASan features are enabled w/o specifying -fsanitize=address

llvm-svn: 173670

11 years agoAdd missing break in 256-bit palignr comment printing. No test case yet because the...
Craig Topper [Mon, 28 Jan 2013 07:19:11 +0000 (07:19 +0000)]
Add missing break in 256-bit palignr comment printing. No test case yet because the comment itself is still wrong.

llvm-svn: 173669

11 years ago[CMake] Fix compiler-rt tests after r173617
Alexey Samsonov [Mon, 28 Jan 2013 07:16:22 +0000 (07:16 +0000)]
[CMake] Fix compiler-rt tests after r173617

llvm-svn: 173668

11 years agoFix inconsistent usage of PALIGN and PALIGNR when referring to the same instruction.
Craig Topper [Mon, 28 Jan 2013 06:48:25 +0000 (06:48 +0000)]
Fix inconsistent usage of PALIGN and PALIGNR when referring to the same instruction.

llvm-svn: 173667

11 years agoCreated ObjCARCUtil.cpp for functions which in my humble opinion are too large to...
Michael Gottesman [Mon, 28 Jan 2013 06:39:31 +0000 (06:39 +0000)]
Created ObjCARCUtil.cpp for functions which in my humble opinion are too large to static inline and place in a header file such as ObjCARC.h.

llvm-svn: 173666

11 years ago[ELF] Use correct regex in test.
Michael J. Spencer [Mon, 28 Jan 2013 06:11:39 +0000 (06:11 +0000)]
[ELF] Use correct regex in test.

llvm-svn: 173665

11 years agoRemove addToNoHelperNeeded function that was left unused after r173649. Fixes a ...
Craig Topper [Mon, 28 Jan 2013 06:09:24 +0000 (06:09 +0000)]
Remove addToNoHelperNeeded function that was left unused after r173649. Fixes a -Wunused warning.

llvm-svn: 173664