platform/upstream/llvm.git
11 years agoUse the correct alignment for POD-member memcpys where the first field is a
Lang Hames [Wed, 27 Feb 2013 04:14:49 +0000 (04:14 +0000)]
Use the correct alignment for POD-member memcpys where the first field is a
bitfield. CGBitField::StorageAlignment holds the alignment in chars, but
emitMemcpy had been treating it as if it were held in bits, leading to
underaligned memcpys.

Related to PR15348.

Thanks very much to Chandler for the diagnosis.

llvm-svn: 176163

11 years agofixing typo in header file
Shankar Easwaran [Wed, 27 Feb 2013 04:02:30 +0000 (04:02 +0000)]
fixing typo in header file

llvm-svn: 176162

11 years agoAdd the skeleton for the Mips constant island pass.
Reed Kotler [Wed, 27 Feb 2013 03:33:58 +0000 (03:33 +0000)]
Add the skeleton for the Mips constant island pass.
It will only be used for Mips 16 at this time.

llvm-svn: 176161

11 years agoWhen starting a kernel debug session, if the user specified an executable
Jason Molenda [Wed, 27 Feb 2013 03:07:49 +0000 (03:07 +0000)]
When starting a kernel debug session, if the user specified an executable
binary to lldb already check that the UUID of that binary and the UUID of
the kernel binary in memory match.  Warn if they don't.
<rdar://problem/13184784>

llvm-svn: 176160

11 years agoRename methods to comply with the LLVM Coding Standards.
Rafael Espindola [Wed, 27 Feb 2013 02:56:45 +0000 (02:56 +0000)]
Rename methods to comply with the LLVM Coding Standards.

llvm-svn: 176159

11 years ago<rdar://problem/13289828>
Enrico Granata [Wed, 27 Feb 2013 02:37:12 +0000 (02:37 +0000)]
<rdar://problem/13289828>

Categories were conceptually meant to be placeable on test methods as well as test classes and test directories
However, that was broken. This checkin fixes that.
The incantation required to put categories on individual test case methods is not exactly elegant, unfortunately:

def test_case(self):
    """Test me."""
    self.do_it()

def _test_case_get_categories(self):
    return ["demo"]

test_case.getCategories = _test_case_get_categories
del _test_case_get_categories

llvm-svn: 176158

11 years agoChange Type::getLinkageAndVisibility to return a LinkageInfo.
Rafael Espindola [Wed, 27 Feb 2013 02:27:19 +0000 (02:27 +0000)]
Change Type::getLinkageAndVisibility to return a LinkageInfo.

llvm-svn: 176157

11 years agoIR: Don't constant fold GEP bitcasts between different address spaces
Meador Inge [Wed, 27 Feb 2013 02:26:42 +0000 (02:26 +0000)]
IR: Don't constant fold GEP bitcasts between different address spaces

PR15262 reported a bug where the following instruction:

  i8 getelementptr inbounds i8* bitcast ([4 x i8] addrspace(12)* @buf to i8*),
                                i32 2

was getting folded into:

  addrspace(12)* getelementptr inbounds ([4 x i8] addrspace(12)* @buf, i32 0,
                                        i32 2)

This caused instcombine to crash because the original instruction and
the folded instruction have different types.  The issue was fixed by
disallowing bitcasts between different address spaces to be folded away.

llvm-svn: 176156

11 years agoMove LinkageInfo out of NamedDecl so that it can be used in Type.h.
Rafael Espindola [Wed, 27 Feb 2013 02:15:29 +0000 (02:15 +0000)]
Move LinkageInfo out of NamedDecl so that it can be used in Type.h.

Everything that cares about visibility also cares about linkage, so I just
moved it to Visibility.h instead of creating a new .h.

llvm-svn: 176155

11 years agoSelectionDAG: If llvm.donothing has a landingpad, we should clear
Manman Ren [Wed, 27 Feb 2013 02:11:57 +0000 (02:11 +0000)]
SelectionDAG: If llvm.donothing has a landingpad, we should clear
CurrentCallSite to avoid an assertion failure:
assert(MMI.getCurrentCallSite() == 0 && "Overlapping call sites!");

rdar://problem/13228754

llvm-svn: 176154

11 years agoUpdate template diffing to handle template arguments that are declarations.
Richard Trieu [Wed, 27 Feb 2013 01:41:53 +0000 (01:41 +0000)]
Update template diffing to handle template arguments that are declarations.

llvm-svn: 176153

11 years agoAdd a test to make sure __has_include works from inside a macro.
Argyrios Kyrtzidis [Wed, 27 Feb 2013 01:34:48 +0000 (01:34 +0000)]
Add a test to make sure __has_include works from inside a macro.

llvm-svn: 176152

11 years agoTemporarily revert r176116 for compile-time performance regression.
Adrian Prantl [Wed, 27 Feb 2013 01:31:55 +0000 (01:31 +0000)]
Temporarily revert r176116 for compile-time performance regression.

This reverts commit ea95e4587fd13606fbf63b10a07a7d02026aa39c.

llvm-svn: 176151

11 years ago[ELF][Writer] Add dynamic relocation tables.
Michael J. Spencer [Wed, 27 Feb 2013 01:30:27 +0000 (01:30 +0000)]
[ELF][Writer] Add dynamic relocation tables.

This adds separate PLT and dynamic relocation tables. It also fills in the dynamic table
entries for them.

llvm-svn: 176150

11 years ago[analyzer] Add stop-gap patch to prevent assertion failure when analyzing LLVM codebase.
Ted Kremenek [Wed, 27 Feb 2013 01:26:58 +0000 (01:26 +0000)]
[analyzer] Add stop-gap patch to prevent assertion failure when analyzing LLVM codebase.

This potentially reduces a performance optimization of throwing away
PreStmtPurgeDeadSymbols nodes.  I'll investigate the performance impact
soon and see if we need something better.

llvm-svn: 176149

11 years ago[PCH] When deserializing an IdentifierInfo, call IdentifierInfo::RevertTokenIDToIdent...
Argyrios Kyrtzidis [Wed, 27 Feb 2013 01:13:51 +0000 (01:13 +0000)]
[PCH] When deserializing an IdentifierInfo, call IdentifierInfo::RevertTokenIDToIdentifier() only when it's not already an identifier.

Fixes an assertion hit.
rdar://13288735

llvm-svn: 176148

11 years agocomment parsing: Properties are considered like methods, and people
Fariborz Jahanian [Wed, 27 Feb 2013 00:46:06 +0000 (00:46 +0000)]
comment parsing: Properties are considered like methods, and people
think of them as having return values that may be computed. Don't
warn when using @return in their comment. // rdar://13189938

llvm-svn: 176147

11 years agoDon't crash when diagnosing path-constrained protected
John McCall [Wed, 27 Feb 2013 00:08:19 +0000 (00:08 +0000)]
Don't crash when diagnosing path-constrained protected
access to a private member to which we have special access.

rdar://12926092

llvm-svn: 176146

11 years agoReapply r176133 with testcase fixes.
Bill Wendling [Wed, 27 Feb 2013 00:06:04 +0000 (00:06 +0000)]
Reapply r176133 with testcase fixes.

llvm-svn: 176145

11 years ago[analyzer] If a struct has a partial lazy binding, its fields aren't Undef.
Jordan Rose [Wed, 27 Feb 2013 00:05:29 +0000 (00:05 +0000)]
[analyzer] If a struct has a partial lazy binding, its fields aren't Undef.

This is essentially the same problem as r174031: a lazy binding for the first
field of a struct may stomp on an existing default binding for the
entire struct. Because of the way RegionStore is set up, we can't help
but lose the top-level binding, but then we need to make sure that accessing
one of the other fields doesn't come back as Undefined.

In this case, RegionStore is now correctly detecting that the lazy binding
we have isn't the right type, but then failing to follow through on the
implications of that: we don't know anything about the other fields in the
aggregate. This fix adds a test when searching for other kinds of default
values to see if there's a lazy binding we rejected, and if so returns
a symbolic value instead of Undefined.

The long-term fix for this is probably a new Store model; see
<rdar://problem/12701038>.

Fixes <rdar://problem/13292559>.

llvm-svn: 176144

11 years agoDebug Info: for static member variables, add AT_MIPS_linkage_name to the
Manman Ren [Wed, 27 Feb 2013 00:02:32 +0000 (00:02 +0000)]
Debug Info: for static member variables, add AT_MIPS_linkage_name to the
definition DIE, to make old GDB happy.

We have a regression for old GDB when Clang uses DW_TAG_member to declare
static members inside a class, instead of DW_TAG_variable. This patch will fix
this regression.

rdar://problem/13291234

llvm-svn: 176143

11 years agoRefine SourceManager's isBeforeInTranslationUnit() cache to have more entries.
Ted Kremenek [Wed, 27 Feb 2013 00:00:26 +0000 (00:00 +0000)]
Refine SourceManager's isBeforeInTranslationUnit() cache to have more entries.

isBeforeInTranslationUnit() uses a cache to reduce the expensive work
to compute a common ancestor for two FileIDs.  This work is very
expensive, so even caching the latest used FileIDs was a big win.
A closer analysis of the cache before, however, shows that the cache
access pattern would oscillate between a working set of FileIDs, and
thus caching more pairs would be profitable.

This patch adds a side table for extending caching.  This side table
is bounded in size (experimentally determined in this case from
a simple Objective-C project), and when the table gets too large
we fall back to the single entry caching before as before.

On Sketch (a small example Objective-C project), this optimization
reduces -fsyntax-only time on SKTGraphicView.m by 5%.  This is
for a project that is already using PCH.

Fixes <rdar://problem/13299847>

llvm-svn: 176142

11 years agoFix one remaining mach port number/globally unique thread ID mixup which prevented...
Jason Molenda [Tue, 26 Feb 2013 23:58:00 +0000 (23:58 +0000)]
Fix one remaining mach port number/globally unique thread ID mixup which prevented queue names
from being fetched correctly.  <rdar://problem/13290877>

llvm-svn: 176141

11 years ago<rdar://problem/13287629>
Greg Clayton [Tue, 26 Feb 2013 23:45:18 +0000 (23:45 +0000)]
<rdar://problem/13287629>

Fixed an issue with clang 500's new way to represent static class variables where it emits a DW_TAG_member with a DW_AT_external(0x01) attribute and no DW_AT_data_member_location.

llvm-svn: 176140

11 years agoEnhance integer division emulation support to handle types smaller than 32 bits,
Pedro Artigas [Tue, 26 Feb 2013 23:33:20 +0000 (23:33 +0000)]
Enhance integer division emulation support to handle types smaller than 32 bits,
enhancement done the trivial way; by extending inputs and truncating outputs
which is addequate for targets with little or no support for integer arithmetic
on integer types less than 32 bits.

llvm-svn: 176139

11 years agoUse existing macros to simplify the test a bit.
Rafael Espindola [Tue, 26 Feb 2013 23:24:59 +0000 (23:24 +0000)]
Use existing macros to simplify the test a bit.

llvm-svn: 176138

11 years agoTemporarily revert r176133 until testcases are modified.
Bill Wendling [Tue, 26 Feb 2013 23:18:33 +0000 (23:18 +0000)]
Temporarily revert r176133 until testcases are modified.

llvm-svn: 176137

11 years agoHave a way for a target to opt-out of target-independent fast isel
Michael Ilseman [Tue, 26 Feb 2013 23:15:23 +0000 (23:15 +0000)]
Have a way for a target to opt-out of target-independent fast isel

llvm-svn: 176136

11 years agoFix testcases to not rely upon target-* attributes.
Bill Wendling [Tue, 26 Feb 2013 23:08:48 +0000 (23:08 +0000)]
Fix testcases to not rely upon target-* attributes.

llvm-svn: 176135

11 years agoTry to get rid of a -wunitialized warning: explicitly initialize the pointer
Eli Bendersky [Tue, 26 Feb 2013 23:04:17 +0000 (23:04 +0000)]
Try to get rid of a -wunitialized warning: explicitly initialize the pointer
to NULL and use asserts to check in relevant places.

llvm-svn: 176134

11 years agoDon't set the -target-cpu and -target-features attributes just now.
Bill Wendling [Tue, 26 Feb 2013 23:01:33 +0000 (23:01 +0000)]
Don't set the -target-cpu and -target-features attributes just now.

This is causing some problems with some of the builders. It's non-trivial to
reset the target's features.

llvm-svn: 176133

11 years agoMark a few more tests as "basic_process".
Jim Ingham [Tue, 26 Feb 2013 22:51:48 +0000 (22:51 +0000)]
Mark a few more tests as "basic_process".

llvm-svn: 176132

11 years agoConstant fold vector bitcasts of halves similarly to how floats and doubles are folde...
Michael Ilseman [Tue, 26 Feb 2013 22:51:07 +0000 (22:51 +0000)]
Constant fold vector bitcasts of halves similarly to how floats and doubles are folded. Test case included.

llvm-svn: 176131

11 years agoAdd support for autodetection of ADM bdver2.
Roman Divacky [Tue, 26 Feb 2013 22:41:01 +0000 (22:41 +0000)]
Add support for autodetection of ADM bdver2.

llvm-svn: 176130

11 years agoRevert r176120 as it caused a failure at static-member.cpp
Manman Ren [Tue, 26 Feb 2013 22:35:53 +0000 (22:35 +0000)]
Revert r176120 as it caused a failure at static-member.cpp

llvm-svn: 176129

11 years agoNo need to initialize these variables.
Chad Rosier [Tue, 26 Feb 2013 22:15:50 +0000 (22:15 +0000)]
No need to initialize these variables.

llvm-svn: 176128

11 years agodoxygen command. Add 'attention' command to list of similar
Fariborz Jahanian [Tue, 26 Feb 2013 22:12:16 +0000 (22:12 +0000)]
doxygen command. Add 'attention' command to list of similar
doxygen commands. // rdar://12379053

llvm-svn: 176127

11 years agoAdd links to buildbots on the LLDB build instructions page
Daniel Malea [Tue, 26 Feb 2013 21:41:55 +0000 (21:41 +0000)]
Add links to buildbots on the LLDB build instructions page

llvm-svn: 176126

11 years ago[TableGen] Fix ICE on MSVC 2012 Release builds.
Michael J. Spencer [Tue, 26 Feb 2013 21:29:47 +0000 (21:29 +0000)]
[TableGen] Fix ICE on MSVC 2012 Release builds.

llvm-svn: 176125

11 years agoFix PR15332 (patch by Florian Zeitz).
Bill Schmidt [Tue, 26 Feb 2013 21:28:57 +0000 (21:28 +0000)]
Fix PR15332 (patch by Florian Zeitz).

There's no need to generate a stack frame for PPC32 SVR4 when there are
no local variables assigned to the stack, i.e., when no red zone is needed.
(PPC64 supports a red zone, but PPC32 does not.)

llvm-svn: 176124

11 years agoFix auto_ptr is deprecated warnings
Matt Arsenault [Tue, 26 Feb 2013 21:20:35 +0000 (21:20 +0000)]
Fix auto_ptr is deprecated warnings

llvm-svn: 176123

11 years agoFix assertion failure when a field is given an address space.
Matt Arsenault [Tue, 26 Feb 2013 21:16:00 +0000 (21:16 +0000)]
Fix assertion failure when a field is given an address space.

llvm-svn: 176122

11 years agoFix initializer for variables with attribute address_space set.
Matt Arsenault [Tue, 26 Feb 2013 21:15:54 +0000 (21:15 +0000)]
Fix initializer for variables with attribute address_space set.

This would error in C++ mode unless the variable also had a cv
qualifier.

e.g.

__attribute__((address_space(2))) float foo = 1.0f; would error but
__attribute__((address_space(2))) const float foo = 1.0f; would not.

llvm-svn: 176121

11 years agoDebug Info: for static member variables, move AT_MIPS_linkage_name from
Manman Ren [Tue, 26 Feb 2013 20:48:29 +0000 (20:48 +0000)]
Debug Info: for static member variables, move AT_MIPS_linkage_name from
TAG_member inside a class to the specification DIE.

Having AT_MIPS_linkage_name on TAG_member caused old gdb (GNU 6.3.50) to
error out. Also gcc 4.7 has AT_MIPS_linkage_name on the specification DIE.

rdar://problem/13291234

llvm-svn: 176120

11 years agoAdd a test case for r176066.
Chad Rosier [Tue, 26 Feb 2013 20:22:30 +0000 (20:22 +0000)]
Add a test case for r176066.

llvm-svn: 176119

11 years agoAsmParser: More generic support for integer type suffices.
Jim Grosbach [Tue, 26 Feb 2013 20:17:10 +0000 (20:17 +0000)]
AsmParser: More generic support for integer type suffices.

For integer constants, allow 'L', 'UL' as well as 'ULL' and 'LL'. This provides
better support for shared headers between .s and .c files that define bunches
of constant values.

rdar://9321056

llvm-svn: 176118

11 years agoFix typo
Matt Arsenault [Tue, 26 Feb 2013 20:13:09 +0000 (20:13 +0000)]
Fix typo

llvm-svn: 176117

11 years agoEnsure that DIType is regenerated after we visited an implementation that adds ivars...
Adrian Prantl [Tue, 26 Feb 2013 20:01:46 +0000 (20:01 +0000)]
Ensure that DIType is regenerated after we visited an implementation that adds ivars to an interface. Fixes rdar://13175234

llvm-svn: 176116

11 years ago[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.
Ted Kremenek [Tue, 26 Feb 2013 19:44:38 +0000 (19:44 +0000)]
[analyzer] Use 'MemRegion::printPretty()' instead of assuming the region is a VarRegion.

Fixes PR15358 and <rdar://problem/13295437>.

Along the way, shorten path diagnostics that say "Variable 'x'" to just
be "'x'".  By the context, it is obvious that we have a variable,
and so this just consumes text space.

llvm-svn: 176115

11 years agoWarn on dropping the return value from a warn_unused_result function, even in
Matt Beaumont-Gay [Tue, 26 Feb 2013 19:34:08 +0000 (19:34 +0000)]
Warn on dropping the return value from a warn_unused_result function, even in
macros.

llvm-svn: 176114

11 years agoAnother test commit. Remove trailing whitespace.
Matt Arsenault [Tue, 26 Feb 2013 19:33:48 +0000 (19:33 +0000)]
Another test commit. Remove trailing whitespace.

llvm-svn: 176113

11 years agoUse the most recent decl in getExplicitVisibility.
Rafael Espindola [Tue, 26 Feb 2013 19:33:14 +0000 (19:33 +0000)]
Use the most recent decl in getExplicitVisibility.

Now that implicitly hidden template arguments can make an instantiation hidden,
it is important to look at more than just the canonical decl of the argument
in order to see if an attribute is available in a more recent decl.

This has the disadvantage of exposing when getExplicitVisibility is called,
but lets us handle cases like

template <typename T>
struct __attribute__((visibility("default"))) barT {
  static void zed() {}
};
class foo;
class __attribute__((visibility("default"))) foo;
template struct barT<foo>;

llvm-svn: 176112

11 years agoTest commit. Remove trailing whitespace.
Matt Arsenault [Tue, 26 Feb 2013 19:18:06 +0000 (19:18 +0000)]
Test commit. Remove trailing whitespace.

llvm-svn: 176111

11 years agoBe more careful in applying pragma weak. Fixes pr14974.
Rafael Espindola [Tue, 26 Feb 2013 19:13:56 +0000 (19:13 +0000)]
Be more careful in applying pragma weak. Fixes pr14974.

GCC applies a pragma weak to a decl if it matches the mangled name. We used
to apply if it matched the plain name.

This patch is a compromise: we apply the pragma only if it matches the name
and the decl has C language linkage.

llvm-svn: 176110

11 years agoRemove a few unused arguments.
Chad Rosier [Tue, 26 Feb 2013 18:39:31 +0000 (18:39 +0000)]
Remove a few unused arguments.

llvm-svn: 176109

11 years ago[docs] Use reST link instead of direct HTML link.
Sean Silva [Tue, 26 Feb 2013 18:22:18 +0000 (18:22 +0000)]
[docs] Use reST link instead of direct HTML link.

llvm-svn: 176108

11 years agoSlight cosmetic fixes
Eli Bendersky [Tue, 26 Feb 2013 18:05:31 +0000 (18:05 +0000)]
Slight cosmetic fixes

llvm-svn: 176107

11 years agoBacked out a hacky fix that is no longer needed.
Greg Clayton [Tue, 26 Feb 2013 17:59:39 +0000 (17:59 +0000)]
Backed out a hacky fix that is no longer needed.

llvm-svn: 176106

11 years agoR600/SI: Add promotion of e32 to e64 in operand folding
Christian Konig [Tue, 26 Feb 2013 17:52:47 +0000 (17:52 +0000)]
R600/SI: Add promotion of e32 to e64 in operand folding

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176105

11 years agoR600/SI: add VOP mapping functions
Christian Konig [Tue, 26 Feb 2013 17:52:42 +0000 (17:52 +0000)]
R600/SI: add VOP mapping functions

Make it possible to map between e32 and e64 encoding opcodes.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176104

11 years agoR600/SI: swap operands if it helps folding
Christian Konig [Tue, 26 Feb 2013 17:52:36 +0000 (17:52 +0000)]
R600/SI: swap operands if it helps folding

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176103

11 years agoR600/SI: add some more instruction flags
Christian Konig [Tue, 26 Feb 2013 17:52:29 +0000 (17:52 +0000)]
R600/SI: add some more instruction flags

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176102

11 years agoR600/SI: add post ISel folding for SI v2
Christian Konig [Tue, 26 Feb 2013 17:52:23 +0000 (17:52 +0000)]
R600/SI: add post ISel folding for SI v2

Include immediate folding and SGPR limit handling for VOP3 instructions.

v2: remove leftover hasExtraSrcRegAllocReq

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176101

11 years agoR600/SI: add folding helper
Christian Konig [Tue, 26 Feb 2013 17:52:16 +0000 (17:52 +0000)]
R600/SI: add folding helper

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176100

11 years agoR600/SI: fix VOP3b encoding v2
Christian Konig [Tue, 26 Feb 2013 17:52:09 +0000 (17:52 +0000)]
R600/SI: fix VOP3b encoding v2

v2: document why we hardcode VCC for now.

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176099

11 years agoR600/SI: fix and cleanup SI register definition v2
Christian Konig [Tue, 26 Feb 2013 17:52:03 +0000 (17:52 +0000)]
R600/SI: fix and cleanup SI register definition v2

Prevent producing real strange tablegen code by using
proper register sizes, alignments and hierarchy.

Also cleanup the unused definitions and add some comments.

v2: add SGPR 512 bit registers, stop registers from wrapping around,
    fix SGPR alignment

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176098

11 years agoR600/SI: fix stupid typo
Christian Konig [Tue, 26 Feb 2013 17:51:57 +0000 (17:51 +0000)]
R600/SI: fix stupid typo

This is a candidate for the mesa-stable branch.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 176097

11 years agoAdding ARM as supported architecture
Renato Golin [Tue, 26 Feb 2013 17:23:13 +0000 (17:23 +0000)]
Adding ARM as supported architecture

llvm-svn: 176096

11 years agoProper XFAILs for ARMv7 / v5
Renato Golin [Tue, 26 Feb 2013 17:16:27 +0000 (17:16 +0000)]
Proper XFAILs for ARMv7 / v5

llvm-svn: 176095

11 years agoFix PR15359.
Bill Schmidt [Tue, 26 Feb 2013 16:41:03 +0000 (16:41 +0000)]
Fix PR15359.

The PowerPC TLS relocation types were not previously added to the
necessary list in MCELFStreamer::fixSymbolsInTLSFixups().  Now they are!

llvm-svn: 176094

11 years agoMichael van der Westhuizen: correction to the libcxx build instructions when built...
Howard Hinnant [Tue, 26 Feb 2013 16:27:55 +0000 (16:27 +0000)]
Michael van der Westhuizen: correction to the libcxx build instructions when built with libcxxrt on Linux.

llvm-svn: 176093

11 years agoFix bad line break decision.
Daniel Jasper [Tue, 26 Feb 2013 13:59:14 +0000 (13:59 +0000)]
Fix bad line break decision.

Before:
if (Intervals[i].getRange().getFirst() < Intervals[i - 1]
                                             .getRange().getLast()) {}

After:
if (Intervals[i].getRange().getFirst() <
    Intervals[i - 1].getRange().getLast()) {}

llvm-svn: 176092

11 years ago[Sanitizer] Don't die if external symbolizer is used on Mac, where it's not implement...
Alexey Samsonov [Tue, 26 Feb 2013 13:40:51 +0000 (13:40 +0000)]
[Sanitizer] Don't die if external symbolizer is used on Mac, where it's not implemented yet

llvm-svn: 176091

11 years agoGCC 4.6.3 O3 miscompiles on ARM
Renato Golin [Tue, 26 Feb 2013 13:32:40 +0000 (13:32 +0000)]
GCC 4.6.3 O3 miscompiles on ARM

llvm-svn: 176090

11 years ago[sanitizer] A low-level vector implementation to be used in leak checking code. Patch...
Kostya Serebryany [Tue, 26 Feb 2013 13:30:27 +0000 (13:30 +0000)]
[sanitizer] A low-level vector implementation to be used in leak checking code. Patch by Sergey Matveev

llvm-svn: 176089

11 years agoAllow dash before "ld" in android driver test.
Evgeniy Stepanov [Tue, 26 Feb 2013 13:20:29 +0000 (13:20 +0000)]
Allow dash before "ld" in android driver test.

Sometimes android linker is "arm-linux-androideabi-ld", and not just "ld".

llvm-svn: 176088

11 years agoIn range-based for-loops, prefer splitting after ":".
Daniel Jasper [Tue, 26 Feb 2013 13:18:08 +0000 (13:18 +0000)]
In range-based for-loops, prefer splitting after ":".

Before:
for (const aaaaaaaaaaaaaaaaaaaaa &
         aaaaaaaaa : aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

After:
for (const aaaaaaaaaaaaaaaaaaaaa &aaaaaaaaa :
     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa) {}

llvm-svn: 176087

11 years agoOnly keep empty lines in unwrapped lines if they preceed a line comment.
Daniel Jasper [Tue, 26 Feb 2013 13:10:34 +0000 (13:10 +0000)]
Only keep empty lines in unwrapped lines if they preceed a line comment.

Empty lines followed by line comments are often used to highlight the
comment. Empty lines somewhere else are usually left over from manual or
automatic formatting and should probably be removed.

Before (clang-format would keep):
S s = {
  a,

  b
};

After:
S s = { a, b };

llvm-svn: 176086

11 years ago[asan] a bit stricter lint for CHECK vs CHECK_XX (these CHECK_XX really help debugging!)
Kostya Serebryany [Tue, 26 Feb 2013 12:59:06 +0000 (12:59 +0000)]
[asan] a bit stricter lint for CHECK vs CHECK_XX (these CHECK_XX really help debugging!)

llvm-svn: 176085

11 years agoOnly break string literals as a last resort.
Daniel Jasper [Tue, 26 Feb 2013 12:52:34 +0000 (12:52 +0000)]
Only break string literals as a last resort.

We might want to move towards doing this if the formatting can be
significantly improved, but we need to carefully evaluate the different
situations first.

Before (the string literal was split by clang-format here):
aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaa, aaaaaa("aaa aaaaa aaa aaa aaaaa aaa "
                                                  "aaaaa aaa aaa aaaaaa"));

After:
aaaaaaaaaaaaaaaaaaaa(
    aaaaaaaaaaaaaaaaaaaa,
    aaaaaa("aaa aaaaa aaa aaa aaaaa aaa aaaaa aaa aaa aaaaaa"));

llvm-svn: 176084

11 years agoDefine CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ subdirectory...
Alexey Samsonov [Tue, 26 Feb 2013 09:43:27 +0000 (09:43 +0000)]
Define CMake option CLANG_INCLUDE_TESTS *before* traversing into tests/ subdirectory. Otherwise, while configuring the build tree for the first time, Clang unit tests could avoid being added to 'check-clang' command, and thus avoid being built and executed.

llvm-svn: 176080

11 years ago[tsan] enable tsan-vs-gvn test since it is now fixed
Kostya Serebryany [Tue, 26 Feb 2013 08:18:27 +0000 (08:18 +0000)]
[tsan] enable tsan-vs-gvn test since it is now fixed

llvm-svn: 176079

11 years ago[asan] fix the output for range accesses (memset, etc); improve the tests; more stric...
Kostya Serebryany [Tue, 26 Feb 2013 07:25:18 +0000 (07:25 +0000)]
[asan] fix the output for range accesses (memset, etc); improve the tests; more strict checking in memcmp

llvm-svn: 176078

11 years ago[asan] use the new attribute syntax (no_address_safety_analysis => no_sanitize_address)
Kostya Serebryany [Tue, 26 Feb 2013 07:01:06 +0000 (07:01 +0000)]
[asan] use the new attribute syntax (no_address_safety_analysis => no_sanitize_address)

llvm-svn: 176077

11 years agoUnify clang/llvm attributes for asan/tsan/msan (Clang part)
Kostya Serebryany [Tue, 26 Feb 2013 06:58:27 +0000 (06:58 +0000)]
Unify clang/llvm attributes for asan/tsan/msan (Clang part)

These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176076

11 years agoUnify clang/llvm attributes for asan/tsan/msan (LLVM part)
Kostya Serebryany [Tue, 26 Feb 2013 06:58:09 +0000 (06:58 +0000)]
Unify clang/llvm attributes for asan/tsan/msan (LLVM part)

These are two related changes (one in llvm, one in clang).
LLVM:
- rename address_safety => sanitize_address (the enum value is the same, so we preserve binary compatibility with old bitcode)
- rename thread_safety => sanitize_thread
- rename no_uninitialized_checks -> sanitize_memory

CLANG:
- add __attribute__((no_sanitize_address)) as a synonym for __attribute__((no_address_safety_analysis))
- add __attribute__((no_sanitize_thread))
- add __attribute__((no_sanitize_memory))

for S in address thread memory
If -fsanitize=S is present and __attribute__((no_sanitize_S)) is not
set llvm attribute sanitize_S

llvm-svn: 176075

11 years agoUpdate tests to do a full match against printed C++11 attributes.
Michael Han [Tue, 26 Feb 2013 02:00:13 +0000 (02:00 +0000)]
Update tests to do a full match against printed C++11 attributes.

llvm-svn: 176074

11 years ago[Pass][Layout] Fix bug and add debug printing.
Michael J. Spencer [Tue, 26 Feb 2013 01:35:30 +0000 (01:35 +0000)]
[Pass][Layout] Fix bug and add debug printing.

Fix a bug where if two atoms had the same index in the override map,
the compare would return false. It now goes to the next check when
they are equal.

No test because it currently can't be tested. An upcomming patch will test it.

llvm-svn: 176073

11 years agoUse a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the...
Michael Ilseman [Tue, 26 Feb 2013 01:31:59 +0000 (01:31 +0000)]
Use a DenseMap instead of a std::map for AnalysisID -> Pass* maps. This reduces the pass-manager overhead from FPPassManager::runOnFunction() by about 10%.

llvm-svn: 176072

11 years agoA quick variable rename Sean and I had discussed earlier to make things a bit clearer.
Greg Clayton [Tue, 26 Feb 2013 01:31:37 +0000 (01:31 +0000)]
A quick variable rename Sean and I had discussed earlier to make things a bit clearer.

llvm-svn: 176071

11 years ago[mips] Use class RegDefsUses to track register defs and uses.
Akira Hatanaka [Tue, 26 Feb 2013 01:30:05 +0000 (01:30 +0000)]
[mips] Use class RegDefsUses to track register defs and uses.

No functionality change.

llvm-svn: 176070

11 years ago[analyzer] Don't look through casts when creating pointer temporaries.
Jordan Rose [Tue, 26 Feb 2013 01:21:27 +0000 (01:21 +0000)]
[analyzer] Don't look through casts when creating pointer temporaries.

Normally, we need to look through derived-to-base casts when creating
temporary object regions (added in r175854). However, if the temporary
is a pointer (rather than a struct/class instance), we need to /preserve/
the base casts that have been applied.

This also ensures that we really do create a new temporary region when
we need to: MaterializeTemporaryExpr and lvalue CXXDefaultArgExprs.

Fixes PR15342, although the test case doesn't include the crash because
I couldn't isolate it.

llvm-svn: 176069

11 years ago[analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.
Jordan Rose [Tue, 26 Feb 2013 01:21:21 +0000 (01:21 +0000)]
[analyzer] StackAddrEscapeChecker: strip qualifiers from temporary types.

With the new support for trivial copy constructors, we are not always
consistent about whether a CXXTempObjectRegion gets reused or created
from scratch, which affects whether qualifiers are preserved. However,
we probably don't care anyway.

This also switches to using the current PrintingPolicy for the type,
which means C++ types don't get a spurious 'struct' prefix anymore.

llvm-svn: 176068

11 years agoFixed several problems with class uniq'ing in the
Sean Callanan [Tue, 26 Feb 2013 01:12:25 +0000 (01:12 +0000)]
Fixed several problems with class uniq'ing in the
SymbolFileDWARF code:

  - If a class is being uniqued to another copy of itself
    and the method lists don't match exactly, take a slow
    path and at least unique the methods that they have
    in common.

  - Sort name_to_die maps before querying them.  This
    would otherwise result in uniquing failures because
    looking up a name in a map that contains it would
    often fail.

  - Tolerate classes in other symbol files in the case
    of debugging with .o files rather than with a
    .dSYM.  We used to assume that the classes being
    uniqued were in the same symbol file, causing
    unpredictable results.

This will dramatically reduce the number of cases where
a function does not have a valid DeclContext.

<rdar://problem/12153915>

llvm-svn: 176067

11 years ago[fast-isel] Make sure the FastLowerArguments function checks to make sure the
Chad Rosier [Tue, 26 Feb 2013 01:05:31 +0000 (01:05 +0000)]
[fast-isel] Make sure the FastLowerArguments function checks to make sure the
arguments type is a simple type.
rdar://13290455

llvm-svn: 176066

11 years agoRemoving leftover printf() statement
Enrico Granata [Tue, 26 Feb 2013 00:28:02 +0000 (00:28 +0000)]
Removing leftover printf() statement

llvm-svn: 176065

11 years agoIf the user has disabled kext loading with the
Jason Molenda [Tue, 26 Feb 2013 00:26:47 +0000 (00:26 +0000)]
If the user has disabled kext loading with the
plugin.dynamic-loader.darwin-kernel.load-kexts setting, don't print
any messages about loading the kexts (which isn't being done) and
don't read the Mach-O headers out of memory (which can be slow and
they're not being used for anything at this point).

llvm-svn: 176064

11 years ago<rdar://problem/13289157>
Greg Clayton [Tue, 26 Feb 2013 00:21:38 +0000 (00:21 +0000)]
<rdar://problem/13289157>

Set the exception breakpoints more efficiently by specifying two module basenames as module filters for Apple vendor targets.

llvm-svn: 176063

11 years ago<rdar://problem/13282582>
Han Ming Ong [Tue, 26 Feb 2013 00:04:29 +0000 (00:04 +0000)]
<rdar://problem/13282582>

Really don't call sysctl again when we already have the result.

llvm-svn: 176062

11 years agoFix the .categories, it had "dataformatter" not "dataformatters".
Jim Ingham [Mon, 25 Feb 2013 23:51:06 +0000 (23:51 +0000)]
Fix the .categories, it had "dataformatter" not "dataformatters".
Remove the getCategory from TestDataFormatterObjC.py, since it was superceded by the .categories file,
and didn't work anyway (getCategories currently has to be a method on the test class, not on the test.)
Add a "basic_process" category, and start to find some tests for simple process running sniff tests.

llvm-svn: 176061