platform/upstream/llvm.git
12 years agoZap unnecessary semicolons.
Eli Friedman [Thu, 15 Dec 2011 21:11:38 +0000 (21:11 +0000)]
Zap unnecessary semicolons.

llvm-svn: 146682

12 years ago[asan] regression test for asan issue 19, currently fails.
Kostya Serebryany [Thu, 15 Dec 2011 20:38:14 +0000 (20:38 +0000)]
[asan] regression test for asan issue 19, currently fails.

llvm-svn: 146681

12 years agoWhen name lookup finds a module-private Objective-C class declaration,
Douglas Gregor [Thu, 15 Dec 2011 20:36:27 +0000 (20:36 +0000)]
When name lookup finds a module-private Objective-C class declaration,
check whether any previous declarations of the class were visible.

llvm-svn: 146680

12 years agoKeep track of all declarations of an Objective-C class (both forward
Douglas Gregor [Thu, 15 Dec 2011 20:29:51 +0000 (20:29 +0000)]
Keep track of all declarations of an Objective-C class (both forward
declarations and definitions) as ObjCInterfaceDecls within the same
redeclaration chain. This new representation matches what we do for
C/C++ variables/functions/classes/templates/etc., and makes it
possible to answer the query "where are all of the declarations of
this class?"

llvm-svn: 146679

12 years agoSet specific target cpu for testcase.
Lang Hames [Thu, 15 Dec 2011 20:22:34 +0000 (20:22 +0000)]
Set specific target cpu for testcase.

llvm-svn: 146678

12 years agoFixed several bugs, implemented support for vector types, and cleaned out dead code.
Howard Hinnant [Thu, 15 Dec 2011 20:02:15 +0000 (20:02 +0000)]
Fixed several bugs, implemented support for vector types, and cleaned out dead code.

llvm-svn: 146677

12 years agoMove disassemble-raw-data dir to reside under test/python_api where they belong.
Johnny Chen [Thu, 15 Dec 2011 19:56:28 +0000 (19:56 +0000)]
Move disassemble-raw-data dir to reside under test/python_api where they belong.
Add debug statements for the raw bytes and the disassembled instruction.

llvm-svn: 146676

12 years agoAdded test case for r146671.
Lang Hames [Thu, 15 Dec 2011 19:56:07 +0000 (19:56 +0000)]
Added test case for r146671.

llvm-svn: 146675

12 years agoUse the proper comparator for set_intersection.
Jakob Stoklund Olesen [Thu, 15 Dec 2011 19:26:23 +0000 (19:26 +0000)]
Use the proper comparator for set_intersection.

llvm-svn: 146674

12 years agoRefactor and simplify AddInitializerToDecl.
Richard Smith [Thu, 15 Dec 2011 19:20:59 +0000 (19:20 +0000)]
Refactor and simplify AddInitializerToDecl.

llvm-svn: 146673

12 years agoclarify that clang version number macros are marketing version #'s, not something...
Chris Lattner [Thu, 15 Dec 2011 19:06:36 +0000 (19:06 +0000)]
clarify that clang version number macros are marketing version #'s, not something useful.

llvm-svn: 146672

12 years agoFix VSELECT operand order. Was previously backwards, causing bogus vector shift resul...
Lang Hames [Thu, 15 Dec 2011 18:57:27 +0000 (18:57 +0000)]
Fix VSELECT operand order. Was previously backwards, causing bogus vector shift results - <rdar://problem/10559581>.

llvm-svn: 146671

12 years agoUpdate DebugLoc while merging nodes at -O0.
Devang Patel [Thu, 15 Dec 2011 18:21:18 +0000 (18:21 +0000)]
Update DebugLoc while merging nodes at -O0.

Patch by Kyriakos Georgiou!

llvm-svn: 146670

12 years agoExtend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
Douglas Gregor [Thu, 15 Dec 2011 18:17:27 +0000 (18:17 +0000)]
Extend ObjCInterfaceDecl::DefinitionData to contain a pointer to the
definition, and implement ObjCInterfaceDecl::getDefinition()
efficiently based on that.

llvm-svn: 146669

12 years agoUpdate tests to match r146665.
Devang Patel [Thu, 15 Dec 2011 18:03:43 +0000 (18:03 +0000)]
Update tests to match r146665.

llvm-svn: 146668

12 years agoIntroduce the core infrastructure needed to model a complete
Douglas Gregor [Thu, 15 Dec 2011 18:03:09 +0000 (18:03 +0000)]
Introduce the core infrastructure needed to model a complete
redeclaration chain for Objective-C classes, including:
  - Using the first declaration as the canonical declaration.
  - Using the definition as the primary DeclContext
  - Making sure that all declarations have a pointer to the definition
  data, and the definition knows that it is the definition.
  - Serialization support for when a definition gets added to a
  declaration that comes from an AST file.

However, note that we're not taking advantage of much of this code
yet, because we're still re-using ObjCInterfaceDecls.

llvm-svn: 146667

12 years agoAdd a test case to make sure that the nop really does follow the bl on ppc64 elf
Hal Finkel [Thu, 15 Dec 2011 17:59:23 +0000 (17:59 +0000)]
Add a test case to make sure that the nop really does follow the bl on ppc64 elf

llvm-svn: 146666

12 years agoVirtual table holder field is either metadata or null.
Devang Patel [Thu, 15 Dec 2011 17:55:56 +0000 (17:55 +0000)]
Virtual table holder field is either metadata or null.

llvm-svn: 146665

12 years agoEnsure that the nop that should follow a bl call in PPC64 ELF actually does
Hal Finkel [Thu, 15 Dec 2011 17:54:01 +0000 (17:54 +0000)]
Ensure that the nop that should follow a bl call in PPC64 ELF actually does

llvm-svn: 146664

12 years ago[asan] poison the internal asan heap memory, just in case. Change Printf to Report...
Kostya Serebryany [Thu, 15 Dec 2011 17:41:30 +0000 (17:41 +0000)]
[asan] poison the internal asan heap memory, just in case. Change Printf to Report when debugging globals.

llvm-svn: 146663

12 years ago"Accidentally" fixed a bug with overloading of functions with
Douglas Gregor [Thu, 15 Dec 2011 17:20:18 +0000 (17:20 +0000)]
"Accidentally" fixed a bug with overloading of functions with
Objective-C objects as parameters in r146659. Add a test for it.

llvm-svn: 146660

12 years agoTwo null Decl*'s don't refer to the same declaration, because they
Douglas Gregor [Thu, 15 Dec 2011 17:15:07 +0000 (17:15 +0000)]
Two null Decl*'s don't refer to the same declaration, because they
don't refer to anything. Amusingly, we were relying on this in one
place. Thanks to Chandler for noticing the weirdness in
declaresSameEntity.

llvm-svn: 146659

12 years agoProvide a default constructor for ObjCInterfaceDecl::DefinitionData
Douglas Gregor [Thu, 15 Dec 2011 16:51:02 +0000 (16:51 +0000)]
Provide a default constructor for ObjCInterfaceDecl::DefinitionData
that value-initializes all of its members for which
default-initialization does not suffice. This should clean up the
failures for compilers that do not implement C++ DR543:

  http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#543

and, therefore, implement very unfortunate semantics for
value-initialization of classes with implicitly-declared, non-trivial
default constructors.

llvm-svn: 146658

12 years agoSynthesize missing register class intersections.
Jakob Stoklund Olesen [Thu, 15 Dec 2011 16:48:55 +0000 (16:48 +0000)]
Synthesize missing register class intersections.

The function TRI::getCommonSubClass(A, B) returns the largest common
sub-class of the register classes A and B.  This patch teaches TableGen
to synthesize sub-classes such that the answer is always maximal.

In other words, every register that is in both A and B will also be
present in getCommonSubClass(A, B).

This introduces these synthetic register classes:

ARM:
    GPRnopc_and_hGPR
    GPRnopc_and_hGPR
    hGPR_and_rGPR
    GPRnopc_and_hGPR
    GPRnopc_and_hGPR
    hGPR_and_rGPR
    tGPR_and_tcGPR
    hGPR_and_tcGPR

X86:
    GR32_NOAX_and_GR32_NOSP
    GR32_NOAX_and_GR32_NOREX
    GR64_NOSP_and_GR64_TC
    GR64_NOSP_and_GR64_TC
    GR64_NOREX_and_GR64_TC
    GR32_NOAX_and_GR32_NOSP
    GR32_NOAX_and_GR32_NOREX
    GR32_NOAX_and_GR32_NOREX_NOSP
    GR64_NOSP_and_GR64_TC
    GR64_NOREX_and_GR64_TC
    GR64_NOREX_NOSP_and_GR64_TC
    GR32_NOAX_and_GR32_NOSP
    GR32_NOAX_and_GR32_NOREX
    GR32_NOAX_and_GR32_NOREX_NOSP
    GR32_ABCD_and_GR32_NOAX
    GR32_NOAX_and_GR32_NOSP
    GR32_NOAX_and_GR32_NOREX
    GR32_NOAX_and_GR32_NOREX_NOSP
    GR32_ABCD_and_GR32_NOAX
    GR32_NOAX_and_GR32_TC
    GR32_NOAX_and_GR32_NOSP
    GR64_NOSP_and_GR64_TC
    GR32_NOAX_and_GR32_NOREX
    GR32_NOAX_and_GR32_NOREX_NOSP
    GR64_NOREX_and_GR64_TC
    GR64_NOREX_NOSP_and_GR64_TC
    GR32_ABCD_and_GR32_NOAX
    GR64_ABCD_and_GR64_TC
    GR32_NOAX_and_GR32_TC
    GR32_AD_and_GR32_NOAX

Other targets are unaffected.

llvm-svn: 146657

12 years agoPass optLevel to XCoreDAGToDAGISel.
Richard Osborne [Thu, 15 Dec 2011 15:18:35 +0000 (15:18 +0000)]
Pass optLevel to XCoreDAGToDAGISel.

Patch by Kyriakos Georgiou.

llvm-svn: 146656

12 years agoRemove quotes from locale name identifier. Credit Edward Meewis.
Howard Hinnant [Thu, 15 Dec 2011 15:01:38 +0000 (15:01 +0000)]
Remove quotes from locale name identifier.  Credit Edward Meewis.

llvm-svn: 146655

12 years agoFix test/Sema/format-strings-scanf.c
Hans Wennborg [Thu, 15 Dec 2011 11:43:45 +0000 (11:43 +0000)]
Fix test/Sema/format-strings-scanf.c

llvm-svn: 146651

12 years agoSupport the 'a' length modifier in scanf format strings as a C90
Hans Wennborg [Thu, 15 Dec 2011 10:25:47 +0000 (10:25 +0000)]
Support the 'a' length modifier in scanf format strings as a C90
extension.

This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).

llvm-svn: 146649

12 years ago[libclang] Give up on using write(); hopefully unbreaks mingw build.
Argyrios Kyrtzidis [Thu, 15 Dec 2011 06:51:30 +0000 (06:51 +0000)]
[libclang] Give up on using write(); hopefully unbreaks mingw build.

llvm-svn: 146648

12 years agoRevert r146646 that was a mistake, and make the intended change in the right file.
Argyrios Kyrtzidis [Thu, 15 Dec 2011 05:53:37 +0000 (05:53 +0000)]
Revert r146646 that was a mistake, and make the intended change in the right file.

Log:
[libclang] Try to unbreak mingw build.

llvm-svn: 146647

12 years ago[libclang] Try to unbreak mingw build.
Argyrios Kyrtzidis [Thu, 15 Dec 2011 05:48:43 +0000 (05:48 +0000)]
[libclang] Try to unbreak mingw build.

llvm-svn: 146646

12 years agoMove the definition-specific data of ObjCInterfaceDecl into a
Douglas Gregor [Thu, 15 Dec 2011 05:27:12 +0000 (05:27 +0000)]
Move the definition-specific data of ObjCInterfaceDecl into a
separately-allocated DefinitionData structure, which we manage the
same way as CXXRecordDecl::DefinitionData. This prepares the way for
making ObjCInterfaceDecls redeclarable, to more accurately model
forward declarations of Objective-C classes and eliminate the mutation
of ObjCInterfaceDecl that causes us serious trouble in the AST reader.

Note that ObjCInterfaceDecl's accessors are fairly robust against
being applied to forward declarations, because Clang (and Sema in
particular) doesn't perform RequireCompleteType/hasDefinition() checks
everywhere it has to. Each of these overly-robust cases is marked with
a FIXME, which we can tackle over time.

llvm-svn: 146644

12 years agoBumped Xcode project version to lldb-95 and debugserver-155.
Greg Clayton [Thu, 15 Dec 2011 05:23:23 +0000 (05:23 +0000)]
Bumped Xcode project version to lldb-95 and debugserver-155.

llvm-svn: 146643

12 years agoFix test.
Eli Friedman [Thu, 15 Dec 2011 04:52:47 +0000 (04:52 +0000)]
Fix test.

llvm-svn: 146642

12 years ago[libclang] Install a fatal error handler that will call abort() instead of exit()
Argyrios Kyrtzidis [Thu, 15 Dec 2011 04:52:41 +0000 (04:52 +0000)]
[libclang] Install a fatal error handler that will call abort() instead of exit()
when there is a report_fatal_error() call.

rdar://10507984

llvm-svn: 146641

12 years ago<rdar://problem/10584789>
Greg Clayton [Thu, 15 Dec 2011 04:38:41 +0000 (04:38 +0000)]
<rdar://problem/10584789>

Added a static memory pressure function in SBDebugger:

    void SBDebugger::MemoryPressureDetected ()

This can be called by applications that detect memory pressure to cause LLDB to release cached information.

llvm-svn: 146640

12 years agoMake constant folding for GEPs a bit more aggressive.
Eli Friedman [Thu, 15 Dec 2011 04:33:48 +0000 (04:33 +0000)]
Make constant folding for GEPs a bit more aggressive.

llvm-svn: 146639

12 years ago<climits> has UINT_MAX, not <limits>.
Eli Friedman [Thu, 15 Dec 2011 04:24:37 +0000 (04:24 +0000)]
<climits> has UINT_MAX, not <limits>.

llvm-svn: 146638

12 years agoAnother fixit for r146633 (to make debian-fnt bot happy), try including limits instead.
Anna Zaks [Thu, 15 Dec 2011 03:27:51 +0000 (03:27 +0000)]
Another fixit for r146633 (to make debian-fnt bot happy), try including limits instead.

llvm-svn: 146637

12 years agoExpose new read memory fucntion through python in SBProcess:
Greg Clayton [Thu, 15 Dec 2011 03:14:23 +0000 (03:14 +0000)]
Expose new read memory fucntion through python in SBProcess:

    size_t
    SBProcess::ReadCStringFromMemory (addr_t addr, void *buf, size_t size, lldb::SBError &error);

    uint64_t
    SBProcess::ReadUnsignedFromMemory (addr_t addr, uint32_t byte_size, lldb::SBError &error);

    lldb::addr_t
    SBProcess::ReadPointerFromMemory (addr_t addr, lldb::SBError &error);

These ReadCStringFromMemory() has some SWIG type magic that makes it return the
python string directly and the "buf" is not needed:

error = SBError()
max_cstr_len = 256
cstr = lldb.process.ReadCStringFromMemory (0x1000, max_cstr_len, error)
if error.Success():
    ....

The other two functions behave as expteced. This will make it easier to get integer values
from the inferior process that are correctly byte swapped. Also for pointers, the correct
pointer byte size will be used.

Also cleaned up a few printf style warnings for the 32 bit lldb build on darwin.

llvm-svn: 146636

12 years agoFixit for r146633. Make sure UINT_MAX is defined on all platforms.
Anna Zaks [Thu, 15 Dec 2011 02:58:00 +0000 (02:58 +0000)]
Fixit for r146633. Make sure UINT_MAX is defined on all platforms.

(Attempt to turn debian-fnt buildbot back to green.)

llvm-svn: 146635

12 years agoEnhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the...
Eli Friedman [Thu, 15 Dec 2011 02:41:52 +0000 (02:41 +0000)]
Enhance the -Wsign-compare handling to suppress the -Wsign-compare warning in the case of a shifted bitfield.  PR11572.

llvm-svn: 146634

12 years agoAdd support for matching one or more (aka regex +) diagnostic messages with -verify.
Anna Zaks [Thu, 15 Dec 2011 02:28:16 +0000 (02:28 +0000)]
Add support for matching one or more (aka regex +) diagnostic messages with -verify.

Ex:
// expected-warning + {{tainted}

llvm-svn: 146633

12 years agogcov-style profiling support for OpenBSD. Patch by Jonathan Gray.
Eli Friedman [Thu, 15 Dec 2011 02:15:56 +0000 (02:15 +0000)]
gcov-style profiling support for OpenBSD.  Patch by Jonathan Gray.

llvm-svn: 146631

12 years agoDon't try to form FGETSIGN after legalization; it is possible in some cases, but...
Eli Friedman [Thu, 15 Dec 2011 02:07:20 +0000 (02:07 +0000)]
Don't try to form FGETSIGN after legalization; it is possible in some cases, but the existing code can't do it correctly. PR11570.

llvm-svn: 146630

12 years agohttp://llvm.org/bugs/show_bug.cgi?id=11579
Johnny Chen [Thu, 15 Dec 2011 01:55:36 +0000 (01:55 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=11579
lldb::SBValue::CreateValueFromAddress does not verify SBType::GetPointerType succeeds

SBValue::CreateValueFromAddress() should check the validity of type and its derived pointer type
before using it.  Add a test case.

llvm-svn: 146629

12 years ago[analyzer] Ensure that the order in which checker callbacks are called
Anna Zaks [Thu, 15 Dec 2011 01:36:04 +0000 (01:36 +0000)]
[analyzer] Ensure that the order in which checker callbacks are called
is deterministic.

Non-determinism was the reason for the test which caused the earlier
buildbot failures, so re-enable the test.

llvm-svn: 146628

12 years agoUse SmallVector/assign(), rather than std::vector/push_back().
Chad Rosier [Thu, 15 Dec 2011 01:16:09 +0000 (01:16 +0000)]
Use SmallVector/assign(), rather than std::vector/push_back().

llvm-svn: 146627

12 years agoobjc: do not auto synthesize properties declared in
Fariborz Jahanian [Thu, 15 Dec 2011 01:03:18 +0000 (01:03 +0000)]
objc: do not auto synthesize properties declared in
protocols; with a warning. // rdar://10567333

llvm-svn: 146626

12 years agoAdd support for lowering fneg when AVX is enabled.
Chad Rosier [Thu, 15 Dec 2011 01:02:25 +0000 (01:02 +0000)]
Add support for lowering fneg when AVX is enabled.
rdar://10566486

llvm-svn: 146625

12 years agoAdded InstCombine for "select cond, ~cond, x" type patterns
Pete Cooper [Thu, 15 Dec 2011 00:56:45 +0000 (00:56 +0000)]
Added InstCombine for "select cond, ~cond, x" type patterns

These can be reduced to "~cond & x" or "~cond | x"

llvm-svn: 146624

12 years agoEnable synthesis of FLOG2 and FEXP2 SelectionDAG nodes from libm calls. These are...
Owen Anderson [Thu, 15 Dec 2011 00:54:12 +0000 (00:54 +0000)]
Enable synthesis of FLOG2 and FEXP2 SelectionDAG nodes from libm calls.  These are already marked as illegal by default.

llvm-svn: 146623

12 years agoIn debugger support mode, if we have a top-level message send
Douglas Gregor [Thu, 15 Dec 2011 00:53:32 +0000 (00:53 +0000)]
In debugger support mode, if we have a top-level message send
expression with an unknown result type, assume that the result type is
'id'. Fixes <rdar://problem/10400663>.

llvm-svn: 146622

12 years agoMake loop preheader insertion in LoopSimplify handle the case where the loop header...
Eli Friedman [Thu, 15 Dec 2011 00:50:34 +0000 (00:50 +0000)]
Make loop preheader insertion in LoopSimplify handle the case where the loop header is a landing pad correctly (by splitting the landingpad out of the loop header).  Make some adjustments to the rest of LoopSimplify to make it clear that the rest of LoopSimplify isn't making bad assumptions about the presence of landing pads.  PR11575.

llvm-svn: 146621

12 years agoModify how the -verify flag works. Currently, the verification string and
Richard Trieu [Thu, 15 Dec 2011 00:38:15 +0000 (00:38 +0000)]
Modify how the -verify flag works.  Currently, the verification string and
diagnostic message are compared.  If either is a substring of the other, then
no error is given.  This gives rise to an unexpected case:

  // expect-error{{candidate function has different number of parameters}}

will match the following error messages from Clang:

  candidate function has different number of parameters (expected 1 but has 2)
  candidate function has different number of parameters

It will also match these other error messages:

  candidate function
  function has different number of parameters
  number of parameters

This patch will change so that the verification string must be a substring of
the diagnostic message before accepting.  Also, all the failing tests from this
change have been corrected.  Some stats from this cleanup:

87 - removed extra spaces around verification strings
70 - wording updates to diagnostics
40 - extra leading or trailing characters (typos, unmatched parens or quotes)
35 - diagnostic level was included (error:, warning:, or note:)
18 - flag name put in the warning (-Wprotocol)

llvm-svn: 146619

12 years agoReplace all comparisons between ObjCInterfaceDecl pointers with calls
Douglas Gregor [Thu, 15 Dec 2011 00:29:59 +0000 (00:29 +0000)]
Replace all comparisons between ObjCInterfaceDecl pointers with calls
to declaresSameEntity(), as a baby step toward tracking forward
declarations of Objective-C classes precisely. Part of
<rdar://problem/10583531>.

llvm-svn: 146618

12 years agoRe-re-enable compact unwind after fixing a failure in SingleSource/Benchmarks/Shootou...
Bill Wendling [Thu, 15 Dec 2011 00:14:24 +0000 (00:14 +0000)]
Re-re-enable compact unwind after fixing a failure in SingleSource/Benchmarks/Shootout-C++/except.cpp and friends. It was encoding the stored registers in the wrong order.

llvm-svn: 146617

12 years ago[libclang] Indexing API: provide an attribute list inside CXIdxEntityInfo
Argyrios Kyrtzidis [Thu, 15 Dec 2011 00:05:00 +0000 (00:05 +0000)]
[libclang] Indexing API: provide an attribute list inside CXIdxEntityInfo
so that we can access the attributes of an entity for a reference.

llvm-svn: 146616

12 years ago[libclang] Suppress indexing references for occurrences of the interface
Argyrios Kyrtzidis [Thu, 15 Dec 2011 00:04:56 +0000 (00:04 +0000)]
[libclang] Suppress indexing references for occurrences of the interface
in a superclass and the protocols in a protocol list.

llvm-svn: 146615

12 years agoAnother improvement to the implementation of .incbin directive by avoiding a
Kevin Enderby [Thu, 15 Dec 2011 00:00:27 +0000 (00:00 +0000)]
Another improvement to the implementation of .incbin directive by avoiding a
buffer copy.  Suggestion by Chris Lattner!

llvm-svn: 146614

12 years agoReplace Decl::isSameEntityAs with a free function declaresSameEntity, which can cope...
Douglas Gregor [Wed, 14 Dec 2011 23:59:32 +0000 (23:59 +0000)]
Replace Decl::isSameEntityAs with a free function declaresSameEntity, which can cope with NULL pointer values

llvm-svn: 146613

12 years agoThe saved registers weren't being processed in the correct order. This lead to
Bill Wendling [Wed, 14 Dec 2011 23:53:24 +0000 (23:53 +0000)]
The saved registers weren't being processed in the correct order. This lead to
the compact unwind claiming that one register was saved before another, which
isn't all that great in general. Process them in the natural order. Reverse the
list only when necessary for the algorithm.

llvm-svn: 146612

12 years agoI have added a function to SBTarget that allows
Sean Callanan [Wed, 14 Dec 2011 23:49:37 +0000 (23:49 +0000)]
I have added a function to SBTarget that allows
clients to disassemble a series of raw bytes as
demonstrated by a new testcase.

In the future, this API will also allow clients
to provide a callback that adds comments for
addresses in the disassembly.

I also modified the SWIG harness to ensure that
Python ByteArrays work as well as strings as
sources of raw data.

llvm-svn: 146611

12 years agoMove Instruction::isSafeToSpeculativelyExecute out of VMCore and
Dan Gohman [Wed, 14 Dec 2011 23:49:11 +0000 (23:49 +0000)]
Move Instruction::isSafeToSpeculativelyExecute out of VMCore and
into Analysis as a standalone function, since there's no need for
it to be in VMCore. Also, update it to use isKnownNonZero and
other goodies available in Analysis, making it more precise,
enabling more aggressive optimization.

llvm-svn: 146610

12 years agoConsider CPE alignment in CreateNewWater().
Jakob Stoklund Olesen [Wed, 14 Dec 2011 23:48:54 +0000 (23:48 +0000)]
Consider CPE alignment in CreateNewWater().

An aligned constant pool entry may require extra alignment padding where
the new water is created.  Take that into account when computing offset.

Also consider the alignment of other constant pool entries when
splitting a basic block.  Alignment padding may make it necessary to
move the split point higher.

llvm-svn: 146609

12 years agoARM NEON better assembly operand range checking for lane indices of VLD/VST.
Jim Grosbach [Wed, 14 Dec 2011 23:35:06 +0000 (23:35 +0000)]
ARM NEON better assembly operand range checking for lane indices of VLD/VST.

llvm-svn: 146608

12 years agoProduce more detailed diagnostics when static_assert condition is not an ICE.
Richard Smith [Wed, 14 Dec 2011 23:32:26 +0000 (23:32 +0000)]
Produce more detailed diagnostics when static_assert condition is not an ICE.

llvm-svn: 146607

12 years agoAdd more robustness - use PyString_CheckExact(pvalue) to check whether pvalue is...
Johnny Chen [Wed, 14 Dec 2011 23:27:53 +0000 (23:27 +0000)]
Add more robustness - use PyString_CheckExact(pvalue) to check whether pvalue is a Python string before
calling PyString_AsString(pvalue).  Similar to http://llvm.org/viewvc/llvm-project?rev=146584&view=rev.

llvm-svn: 146606

12 years agoARM NEON VLD2/VST2 lane indexed assembly parsing and encoding.
Jim Grosbach [Wed, 14 Dec 2011 23:25:46 +0000 (23:25 +0000)]
ARM NEON VLD2/VST2 lane indexed assembly parsing and encoding.

llvm-svn: 146605

12 years agoDo not sink instruction, if it is not profitable.
Devang Patel [Wed, 14 Dec 2011 23:20:38 +0000 (23:20 +0000)]
Do not sink instruction, if it is not profitable.

On ARM, peephole optimization for ABS creates a trivial cfg triangle which tempts machine sink to sink instructions in code which is really straight line code. Sometimes this sinking may alter register allocator input such that use and def of a reg is divided by a branch in between, which may result in extra spills. Now mahine sink avoids sinking if final sink destination is post dominator.

Radar 10266272.

llvm-svn: 146604

12 years agoAdd a blurb about MachineInstr bundling support.
Evan Cheng [Wed, 14 Dec 2011 22:57:45 +0000 (22:57 +0000)]
Add a blurb about MachineInstr bundling support.

llvm-svn: 146603

12 years agoReapply r146481 with a fix to create the Builder value in the correct place and
Bill Wendling [Wed, 14 Dec 2011 22:45:33 +0000 (22:45 +0000)]
Reapply r146481 with a fix to create the Builder value in the correct place and
with the correct iterator.
<rdar://problem/10530851>

llvm-svn: 146600

12 years agoImprove the implementation of .incbin directive by replacing a loop by using
Kevin Enderby [Wed, 14 Dec 2011 22:34:45 +0000 (22:34 +0000)]
Improve the implementation of .incbin directive by replacing a loop by using
getStreamer().EmitBytes.  Suggestion by Benjamin Kramer!

llvm-svn: 146599

12 years agoLSR: Fold redundant bitcasts on-the-fly.
Andrew Trick [Wed, 14 Dec 2011 22:07:19 +0000 (22:07 +0000)]
LSR: Fold redundant bitcasts on-the-fly.

llvm-svn: 146597

12 years agoHalve the constexpr recursion depth in this test in an attempt to make the
Richard Smith [Wed, 14 Dec 2011 21:55:23 +0000 (21:55 +0000)]
Halve the constexpr recursion depth in this test in an attempt to make the
freebsd bots happy. In the longer term, we should have a mechanism for moving
constexpr recursion off the call stack, to support the default limit of 512
suggested by the standard.

llvm-svn: 146596

12 years agoFix typos.
Rafael Espindola [Wed, 14 Dec 2011 21:50:24 +0000 (21:50 +0000)]
Fix typos.

llvm-svn: 146595

12 years agoARM NEON fix alignment encoding for VST2 w/ writeback.
Jim Grosbach [Wed, 14 Dec 2011 21:49:24 +0000 (21:49 +0000)]
ARM NEON fix alignment encoding for VST2 w/ writeback.

Add tests for w/ writeback instruction parsing and encoding.

llvm-svn: 146594

12 years agoAdd the .incbin directive which takes the binary data from a file and emits
Kevin Enderby [Wed, 14 Dec 2011 21:47:48 +0000 (21:47 +0000)]
Add the .incbin directive which takes the binary data from a file and emits
it to the streamer.  rdar://10383898

llvm-svn: 146592

12 years agoIntroduce Decl::isSameEntityAs(), to help compare declarations using
Douglas Gregor [Wed, 14 Dec 2011 21:44:45 +0000 (21:44 +0000)]
Introduce Decl::isSameEntityAs(), to help compare declarations using
their canonical Decl nodes. Not used yet, but it will be.

llvm-svn: 146591

12 years agoNuke old code. Missed in last commit.
Jim Grosbach [Wed, 14 Dec 2011 21:41:32 +0000 (21:41 +0000)]
Nuke old code. Missed in last commit.

llvm-svn: 146590

12 years agoAdd high level description of MachineInstr bundles.
Evan Cheng [Wed, 14 Dec 2011 21:32:14 +0000 (21:32 +0000)]
Add high level description of MachineInstr bundles.

llvm-svn: 146589

12 years agoARM NEON refactor VST2 w/ writeback instructions.
Jim Grosbach [Wed, 14 Dec 2011 21:32:11 +0000 (21:32 +0000)]
ARM NEON refactor VST2 w/ writeback instructions.

In addition to improving the representation, this adds support for assembly
parsing of these instructions.

llvm-svn: 146588

12 years agoDon't consider an overloaded operator& when the expression is actually
Douglas Gregor [Wed, 14 Dec 2011 21:23:13 +0000 (21:23 +0000)]
Don't consider an overloaded operator& when the expression is actually
going to be a pointer-to-member constant. Fixes <rdar://problem/10544564>.

llvm-svn: 146587

12 years agoDon't use the frame pointer on linux x86 and x86_64 if optimizing. This
Rafael Espindola [Wed, 14 Dec 2011 21:02:23 +0000 (21:02 +0000)]
Don't use the frame pointer on linux x86 and x86_64 if optimizing. This
matches gcc's behavior.

Fixes PR8186.

llvm-svn: 146586

12 years agoARM NEON improve factoring a bit. No functional change.
Jim Grosbach [Wed, 14 Dec 2011 20:59:15 +0000 (20:59 +0000)]
ARM NEON improve factoring a bit. No functional change.

llvm-svn: 146585

12 years agohttp://llvm.org/bugs/show_bug.cgi?id=11569
Johnny Chen [Wed, 14 Dec 2011 20:40:27 +0000 (20:40 +0000)]
http://llvm.org/bugs/show_bug.cgi?id=11569
LLDBSwigPythonCallCommand crashes when a command script returns an object

Add more robustness to LLDBSwigPythonCallCommand.  It should check whether the returned Python object
is a string, and only assign it as the error msg when the check holds.
Also add a regression test.

llvm-svn: 146584

12 years agoModel ARM predicated write as read-mod-write. e.g.
Evan Cheng [Wed, 14 Dec 2011 20:00:08 +0000 (20:00 +0000)]
Model ARM predicated write as read-mod-write. e.g.
r0 = mov #0
r0 = moveq #1

Then the second instruction has an implicit data dependency on the first
instruction. Sadly I have yet to come up with a small test case that
demonstrate the post-ra scheduler taking advantage of this.

llvm-svn: 146583

12 years ago[analyzer] Disable verification step on the failing test.
Anna Zaks [Wed, 14 Dec 2011 19:39:46 +0000 (19:39 +0000)]
[analyzer] Disable verification step on the failing test.

I need to keep the test itself in the repository since it's the only way I can currently reproduce the issue.

llvm-svn: 146582

12 years agoAllow empty argument lists in thread safety attributes
DeLesley Hutchins [Wed, 14 Dec 2011 19:36:06 +0000 (19:36 +0000)]
Allow empty argument lists in thread safety attributes

llvm-svn: 146580

12 years agoARM NEON VST2 assembly parsing and encoding.
Jim Grosbach [Wed, 14 Dec 2011 19:35:22 +0000 (19:35 +0000)]
ARM NEON VST2 assembly parsing and encoding.

Work in progress. Parsing for non-writeback, single spaced register lists
works now. The rest have the representations better factored, but still
need more to be able to parse properly.

llvm-svn: 146579

12 years agoFix for bug #11429: Wrong behaviour for switches. Small improvement for code size...
Stepan Dyatkovskiy [Wed, 14 Dec 2011 19:19:17 +0000 (19:19 +0000)]
Fix for bug #11429: Wrong behaviour for switches. Small improvement for code size heuristics.

llvm-svn: 146578

12 years agoIt turns out that clang does use pointer-to-function types to
Dan Gohman [Wed, 14 Dec 2011 19:10:53 +0000 (19:10 +0000)]
It turns out that clang does use pointer-to-function types to
point to ARC-managed pointers sometimes. This fixes rdar://10551239.

llvm-svn: 146577

12 years agoMove & comment the 'decltype in declarator-id' as suggested by Doug Gregor.
David Blaikie [Wed, 14 Dec 2011 18:59:02 +0000 (18:59 +0000)]
Move & comment the 'decltype in declarator-id' as suggested by Doug Gregor.

llvm-svn: 146576

12 years agoFix speling and 80-col.
Jakob Stoklund Olesen [Wed, 14 Dec 2011 18:49:13 +0000 (18:49 +0000)]
Fix speling and 80-col.

llvm-svn: 146575

12 years ago[analyzer] Re-enable the test which was failing on one of the bots.
Anna Zaks [Wed, 14 Dec 2011 18:34:17 +0000 (18:34 +0000)]
[analyzer] Re-enable the test which was failing on one of the bots.

I cannot reproduce the failures neither on my machine nor on the same buildbot machine (with the clang binary built on it). Let's see if it fails again..

llvm-svn: 146574

12 years agoAdd support for local dynamic TLS model in LowerGlobalTLSAddress. Direct object
Akira Hatanaka [Wed, 14 Dec 2011 18:26:41 +0000 (18:26 +0000)]
Add support for local dynamic TLS model in LowerGlobalTLSAddress. Direct object
emission is not supported yet, but a patch that adds the support should follow
soon.

llvm-svn: 146572

12 years agoFix copy/pasto that skipped the 'modify' step.
Jim Grosbach [Wed, 14 Dec 2011 18:12:37 +0000 (18:12 +0000)]
Fix copy/pasto that skipped the 'modify' step.

llvm-svn: 146571

12 years agoARM/Thumb2 mov vs. mvn alias goes both ways.
Jim Grosbach [Wed, 14 Dec 2011 17:56:51 +0000 (17:56 +0000)]
ARM/Thumb2 mov vs. mvn alias goes both ways.

llvm-svn: 146570

12 years agoVFP2 is required for FP loads. Noticed by inspection.
Chad Rosier [Wed, 14 Dec 2011 17:55:03 +0000 (17:55 +0000)]
VFP2 is required for FP loads.  Noticed by inspection.

llvm-svn: 146569

12 years agoTidy up.
Chad Rosier [Wed, 14 Dec 2011 17:32:02 +0000 (17:32 +0000)]
Tidy up.

llvm-svn: 146568