platform/upstream/llvm.git
11 years agoChange the default of 'platform.plugin.darwin-kernel.search-locally-for-kexts'
Jason Molenda [Sat, 6 Apr 2013 05:25:38 +0000 (05:25 +0000)]
Change the default of 'platform.plugin.darwin-kernel.search-locally-for-kexts'
to 'off' for a week or so while we test the behavior in different environments.

llvm-svn: 178951

11 years agoWhen an internal-linkage function or variable is declared within an extern "C"
Richard Smith [Sat, 6 Apr 2013 05:00:46 +0000 (05:00 +0000)]
When an internal-linkage function or variable is declared within an extern "C"
linkage specification, and is marked as __attribute__((used)), try to also give
it the unmangled name (by emitting an internal linkage alias) if nothing else
within the translation unit would use that name. This allows inline asm in that
translation unit to use the entity via its unmangled name, which people
apparently rely on.

llvm-svn: 178950

11 years agotypo
Nadav Rotem [Sat, 6 Apr 2013 04:24:12 +0000 (04:24 +0000)]
typo

llvm-svn: 178949

11 years agoRemove last use of InMemoryStruct from MachOObjectFile.cpp.
Rafael Espindola [Sat, 6 Apr 2013 03:50:05 +0000 (03:50 +0000)]
Remove last use of InMemoryStruct from MachOObjectFile.cpp.

llvm-svn: 178948

11 years agoDon't use InMemoryStruct<macho::SymtabLoadCommand>.
Rafael Espindola [Sat, 6 Apr 2013 03:31:08 +0000 (03:31 +0000)]
Don't use InMemoryStruct<macho::SymtabLoadCommand>.

This also required not using the RegisterStringTable API, which is also a
good thing.

llvm-svn: 178947

11 years agoDon't use InMemoryStruct in getSymbol64TableEntry.
Rafael Espindola [Sat, 6 Apr 2013 02:15:44 +0000 (02:15 +0000)]
Don't use InMemoryStruct in getSymbol64TableEntry.

llvm-svn: 178946

11 years agoDon't use InMemoryStruct in getSymbolTableEntry.
Rafael Espindola [Sat, 6 Apr 2013 01:59:05 +0000 (01:59 +0000)]
Don't use InMemoryStruct in getSymbolTableEntry.

llvm-svn: 178945

11 years ago[analyzer] When creating a trimmed graph, preserve whether a node is a sink.
Jordan Rose [Sat, 6 Apr 2013 01:42:02 +0000 (01:42 +0000)]
[analyzer] When creating a trimmed graph, preserve whether a node is a sink.

This is important because sometimes two nodes are identical, except the
second one is a sink.

This bug has probably been around for a while, but it wouldn't have been an
issue in the old report graph algorithm. I'm ashamed to say I actually looked
at this the first time around and thought it would never be a problem...and
then didn't include an assertion to back that up.

PR15684

llvm-svn: 178944

11 years agoDon't use InMemoryStruct in getRelocation.
Rafael Espindola [Sat, 6 Apr 2013 01:24:11 +0000 (01:24 +0000)]
Don't use InMemoryStruct in getRelocation.

llvm-svn: 178943

11 years ago[objcmt] Fix a mishandled conversion to objc directory literal.
Argyrios Kyrtzidis [Sat, 6 Apr 2013 01:13:17 +0000 (01:13 +0000)]
[objcmt] Fix a mishandled conversion to objc directory literal.

rdar://13181413

llvm-svn: 178942

11 years agoDwarf: use utostr on CUID to append to SmallString.
Manman Ren [Sat, 6 Apr 2013 01:02:38 +0000 (01:02 +0000)]
Dwarf: use utostr on CUID to append to SmallString.

We used to do "SmallString += CUID", which is incorrect, since CUID will
be truncated to a char.

rdar://problem/13573833

llvm-svn: 178941

11 years agoAdd VTune as an optional external dependency and add task tracking.
Michael J. Spencer [Sat, 6 Apr 2013 00:56:40 +0000 (00:56 +0000)]
Add VTune as an optional external dependency and add task tracking.

llvm-svn: 178940

11 years ago<rdar://problem/13325066> Destroy std::initializer_list temporaries whose lifetime...
Douglas Gregor [Sat, 6 Apr 2013 00:46:20 +0000 (00:46 +0000)]
<rdar://problem/13325066> Destroy std::initializer_list temporaries whose lifetime has been extended by reference binding.

llvm-svn: 178939

11 years ago[analyzer] Shorten the malloc checker’s leak message
Anna Zaks [Sat, 6 Apr 2013 00:41:36 +0000 (00:41 +0000)]
[analyzer] Shorten the malloc checker’s leak message

As per Ted’s suggestion!

llvm-svn: 178938

11 years agoRework how ObjC method inherit deprecated/availability.
Ted Kremenek [Sat, 6 Apr 2013 00:34:27 +0000 (00:34 +0000)]
Rework how ObjC method inherit deprecated/availability.

New rule:
- Method decls in @implementation are considered "redeclarations"
  and inherit deprecated/availability from the @interface.
- All other cases are consider overrides, which do not inherit
  deprecated/availability.  For example:

  (a) @interface redeclares a method in an adopted protocol.
  (b) A subclass redeclares a method in a superclass.
  (c) A protocol redeclares a method from another protocol it adopts.

The idea is that API authors should have the ability to easily
move availability/deprecated up and down a class/protocol hierarchy.
A redeclaration means that the availability/deprecation is a blank
slate.

Fixes <rdar://problem/13574571>

llvm-svn: 178937

11 years agoDon't call DisableBreakpointSite (i.e. don't try to remove the breakpoint from the...
Jim Ingham [Sat, 6 Apr 2013 00:16:39 +0000 (00:16 +0000)]
Don't call DisableBreakpointSite (i.e. don't try to remove the breakpoint from the target process) if the target
process is no longer alive.

<rdar://problem/13320991>

llvm-svn: 178936

11 years ago[analyzer] Reword error messages for nil keys and values of NSMutableDictionary.
Anna Zaks [Fri, 5 Apr 2013 23:50:18 +0000 (23:50 +0000)]
[analyzer] Reword error messages for nil keys and values of NSMutableDictionary.

llvm-svn: 178935

11 years ago[analyzer] Remove another redundancy from trackNullOrUndef
Anna Zaks [Fri, 5 Apr 2013 23:50:14 +0000 (23:50 +0000)]
[analyzer] Remove another redundancy from trackNullOrUndef

llvm-svn: 178934

11 years ago[analyzer] Fix null tracking for the given test case, by using the proper state and...
Anna Zaks [Fri, 5 Apr 2013 23:50:11 +0000 (23:50 +0000)]
[analyzer] Fix null tracking for the given test case, by using the proper state and removing redundant code.

llvm-svn: 178933

11 years agoRemoved trailing whitespace.
Michael Gottesman [Fri, 5 Apr 2013 23:46:45 +0000 (23:46 +0000)]
Removed trailing whitespace.

llvm-svn: 178932

11 years agoR600/SI: Add support for buffer stores v2
Tom Stellard [Fri, 5 Apr 2013 23:31:51 +0000 (23:31 +0000)]
R600/SI: Add support for buffer stores v2

v2:
  - Use the ADDR64 bit

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178931

11 years agoR600/SI: Use same names for corresponding MUBUF operands and encoding fields
Tom Stellard [Fri, 5 Apr 2013 23:31:44 +0000 (23:31 +0000)]
R600/SI: Use same names for corresponding MUBUF operands and encoding fields

The code emitter knows how to encode operands whose name matches one of
the encoding fields.  If there is no match, the code emitter relies on
the order of the operand and field definitions to determine how operands
should be encoding.  Matching by order makes it easy to accidentally break
the instruction encodings, so we prefer to match by name.

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178930

11 years agoR600: Add RV670 processor
Tom Stellard [Fri, 5 Apr 2013 23:31:40 +0000 (23:31 +0000)]
R600: Add RV670 processor

This is an R600 GPU with double support.

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178929

11 years agoR600/SI: Add processor types for each SI variant
Tom Stellard [Fri, 5 Apr 2013 23:31:35 +0000 (23:31 +0000)]
R600/SI: Add processor types for each SI variant

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178928

11 years agoR600/SI: Avoid generating S_MOVs with 64-bit immediates v2
Tom Stellard [Fri, 5 Apr 2013 23:31:20 +0000 (23:31 +0000)]
R600/SI: Avoid generating S_MOVs with 64-bit immediates v2

SITargetLowering::analyzeImmediate() was converting the 64-bit values
to 32-bit and then checking if they were an inline immediate.  Some
of these conversions caused this check to succeed and produced
S_MOV instructions with 64-bit immediates, which are illegal.

v2:
  - Clean up logic

Reviewed-by: Christian König <christian.koenig@amd.com>
llvm-svn: 178927

11 years agoEnable early if conversion on PPC
Hal Finkel [Fri, 5 Apr 2013 23:29:01 +0000 (23:29 +0000)]
Enable early if conversion on PPC

On cores for which we know the misprediction penalty, and we have
the isel instruction, we can profitably perform early if conversion.
This enables us to replace some small branch sequences with selects
and avoid the potential stalls from mispredicting the branches.

Enabling this feature required implementing canInsertSelect and
insertSelect in PPCInstrInfo; isel code in PPCISelLowering was
refactored to use these functions as well.

llvm-svn: 178926

11 years agoCorrect the PPC A2 misprediction penalty
Hal Finkel [Fri, 5 Apr 2013 23:28:58 +0000 (23:28 +0000)]
Correct the PPC A2 misprediction penalty

The manual states that there is a minimum of 13 cycles from when the
mispredicted branch is issued to when the correct branch target is
issued.

llvm-svn: 178925

11 years agoAdded support "__attribute__((__vector_size__(B)))" and "__attribute__((ext_vector_ty...
Greg Clayton [Fri, 5 Apr 2013 23:27:21 +0000 (23:27 +0000)]
Added support "__attribute__((__vector_size__(B)))" and "__attribute__((ext_vector_type(N)))".

Now we can:
1 - see the return value for functions that return types that use the "ext_vector_size"
2 - dump values that use the vector attributes ("expr $ymm0")
3 - modified the DWARF parser to correctly parse GNU vector types from the DWARF by turning them into clang::Type::ExtVector types instead of just standard arrays

llvm-svn: 178924

11 years agoWhen -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to add
Richard Trieu [Fri, 5 Apr 2013 23:02:24 +0000 (23:02 +0000)]
When -Woverloaded-virtual is triggered, call HandleFunctionTypeMismatch to add
more information to the notes.  This information is already present on other
diagnostic messages that involves overloads.

llvm-svn: 178923

11 years agoAn objc_retain can serve as a use for a different pointer.
Michael Gottesman [Fri, 5 Apr 2013 22:54:32 +0000 (22:54 +0000)]
An objc_retain can serve as a use for a different pointer.

This is the counterpart to commit r160637, except it performs the action
in the bottomup portion of the data flow analysis.

llvm-svn: 178922

11 years agoProperly model precise lifetime when given an incomplete dataflow sequence.
Michael Gottesman [Fri, 5 Apr 2013 22:54:28 +0000 (22:54 +0000)]
Properly model precise lifetime when given an incomplete dataflow sequence.

The normal dataflow sequence in the ARC optimizer consists of the following
states:

    Retain -> CanRelease -> Use -> Release

The optimizer before this patch stored the uses that determine the lifetime of
the retainable object pointer when it bottom up hits a retain or when top down
it hits a release. This is correct for an imprecise lifetime scenario since what
we are trying to do is remove retains/releases while making sure that no
``CanRelease'' (which is usually a call) deallocates the given pointer before we
get to the ``Use'' (since that would cause a segfault).

If we are considering the precise lifetime scenario though, this is not
correct. In such a situation, we *DO* care about the previous sequence, but
additionally, we wish to track the uses resulting from the following incomplete
sequences:

  Retain -> CanRelease -> Release   (TopDown)
  Retain <- Use <- Release          (BottomUp)

*NOTE* This patch looks large but the most of it consists of updating
test cases. Additionally this fix exposed an additional bug. I removed
the test case that expressed said bug and will recommit it with the fix
in a little bit.

llvm-svn: 178921

11 years agoReorder the Platform plugin settings so that they're now
Jason Molenda [Fri, 5 Apr 2013 22:40:42 +0000 (22:40 +0000)]
Reorder the Platform plugin settings so that they're now

platform.plugin.darwin-kernel.kext-directories
platform.plugin.darwin-kernel.search-locally-for-kexts

and fix a few FileSpec handling issues for the kext-directories setting.

llvm-svn: 178920

11 years agoReapply r178845 with fix - Fix bug in PEI's virtual-register scavenging
Hal Finkel [Fri, 5 Apr 2013 22:31:56 +0000 (22:31 +0000)]
Reapply r178845 with fix - Fix bug in PEI's virtual-register scavenging

This fixes PEI as previously described, but correctly handles the case where
the instruction defining the virtual register to be scavenged is the first in
the block. Arnold provided me with a bugpoint-reduced test case, but even that
seems too large to use as a regression test. If I'm successful in cleaning it
up then I'll commit that as well.

Original commit message:

    This change fixes a bug that I introduced in r178058. After a register is
    scavenged using one of the available spills slots the instruction defining the
    virtual register needs to be moved to after the spill code. The scavenger has
    already processed the defining instruction so that registers killed by that
    instruction are available for definition in that same instruction. Unfortunately,
    after this, the scavenger needs to iterate through the spill code and then
    visit, again, the instruction that defines the now-scavenged register. In order
    to avoid confusion, the register scavenger needs the ability to 'back up'
    through the spill code so that it can again process the instructions in the
    appropriate order. Prior to this fix, once the scavenger reached the
    just-moved instruction, it would assert if it killed any registers because,
    having already processed the instruction, it believed they were undefined.

    Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
    for diagnosing the problem and testing this fix.

llvm-svn: 178919

11 years agoRevert "Correctly pass ownership of MemoryBuffers."
Michael J. Spencer [Fri, 5 Apr 2013 22:04:44 +0000 (22:04 +0000)]
Revert "Correctly pass ownership of MemoryBuffers."

llvm-svn: 178918

11 years agoUse the target options specified on a function to reset the back-end.
Bill Wendling [Fri, 5 Apr 2013 21:52:40 +0000 (21:52 +0000)]
Use the target options specified on a function to reset the back-end.

During LTO, the target options on functions within the same Module may
change. This would necessitate resetting some of the back-end. Do this for X86,
because it's a Friday afternoon.

llvm-svn: 178917

11 years agoRevert r178845 - Fix bug in PEI's virtual-register scavenging
Hal Finkel [Fri, 5 Apr 2013 21:30:40 +0000 (21:30 +0000)]
Revert r178845 - Fix bug in PEI's virtual-register scavenging

Reverting because this breaks one of the LTO builders. Original commit message:

    This change fixes a bug that I introduced in r178058. After a register is
    scavenged using one of the available spills slots the instruction defining the
    virtual register needs to be moved to after the spill code. The scavenger has
    already processed the defining instruction so that registers killed by that
    instruction are available for definition in that same instruction. Unfortunately,
    after this, the scavenger needs to iterate through the spill code and then
    visit, again, the instruction that defines the now-scavenged register. In order
    to avoid confusion, the register scavenger needs the ability to 'back up'
    through the spill code so that it can again process the instructions in the
    appropriate order. Prior to this fix, once the scavenger reached the
    just-moved instruction, it would assert if it killed any registers because,
    having already processed the instruction, it believed they were undefined.

    Unfortunately, I don't yet have a small test case. Thanks to Pranav Bhandarkar
    for diagnosing the problem and testing this fix.

llvm-svn: 178916

11 years agoTidy up a bit. No functional change.
Jim Grosbach [Fri, 5 Apr 2013 21:20:12 +0000 (21:20 +0000)]
Tidy up a bit. No functional change.

llvm-svn: 178915

11 years agoCorrectly pass ownership of MemoryBuffers.
Michael J. Spencer [Fri, 5 Apr 2013 21:08:30 +0000 (21:08 +0000)]
Correctly pass ownership of MemoryBuffers.

llvm-svn: 178914

11 years agoFix uninitialized variables. Found by ubsan.
Michael J. Spencer [Fri, 5 Apr 2013 21:07:44 +0000 (21:07 +0000)]
Fix uninitialized variables. Found by ubsan.

llvm-svn: 178913

11 years agoDisable the optimization about promoting vector-element-access with symbolic index.
Shuxin Yang [Fri, 5 Apr 2013 21:07:08 +0000 (21:07 +0000)]
Disable the optimization about promoting vector-element-access with symbolic index.

This optimization is unstable at this moment; it
  1) block us on a very important application
  2) PR15200
  3) test6 and test7 in test/Transforms/ScalarRepl/dynamic-vector-gep.ll
     (the CHECK command compare the output against wrong result)

   I personally believe this optimization should not have any impact on the
autovectorized code, as auto-vectorizer is supposed to put gather/scatter
in a "right" way.  Although in theory downstream optimizaters might reveal
some gather/scatter optimization opportunities, the chance is quite slim.

   For the hand-crafted vectorizing code, in term of redundancy elimination,
load-CSE, copy-propagation and DSE can collectively achieve the same result,
but in much simpler way. On the other hand, these optimizers are able to
improve the code in a incremental way; in contrast, SROA is sort of all-or-none
approach. However, SROA might slighly win in stack size, as it tries to figure
out a stretch of memory tightenly cover the area accessed by the dynamic index.

 rdar://13174884
 PR15200

llvm-svn: 178912

11 years ago[libclang] Fix cursor visitation to not ignore template arguments in out-of-line...
Argyrios Kyrtzidis [Fri, 5 Apr 2013 21:04:10 +0000 (21:04 +0000)]
[libclang] Fix cursor visitation to not ignore template arguments in out-of-line member functions.

rdar://13535645

llvm-svn: 178911

11 years ago[mips] XFAIL test-interp-vec-loadstore.ll in an attempt to turn builder
Akira Hatanaka [Fri, 5 Apr 2013 20:54:46 +0000 (20:54 +0000)]
[mips] XFAIL test-interp-vec-loadstore.ll in an attempt to turn builder
llvm-mips-linux green.

llvm-mips-linux runs on a big endian machine. This test passes if I change 'e'
to 'E' in the target data layout string.

llvm-svn: 178910

11 years ago<rdar://problem/13551789> Fix a race in the LockFileManager.
Douglas Gregor [Fri, 5 Apr 2013 20:53:57 +0000 (20:53 +0000)]
<rdar://problem/13551789> Fix a race in the LockFileManager.

It's possible for the lock file to disappear and the owning process to
return before we're able to see the generated file. Spin for a little
while to see if it shows up before failing.

llvm-svn: 178909

11 years ago<rdar://problem/13551789> Fix yet another race in unique_file.
Douglas Gregor [Fri, 5 Apr 2013 20:48:36 +0000 (20:48 +0000)]
<rdar://problem/13551789> Fix yet another race in unique_file.

If the directory that will contain the unique file doesn't exist when
we tried to create the file, but another process creates it before we
get a chance to try creating it, we would bail out rather than try to
create the unique file.

llvm-svn: 178908

11 years agoFix UseNullptr fails to replace explict casts surrounded by another implicit
Ariel J. Bernal [Fri, 5 Apr 2013 20:32:36 +0000 (20:32 +0000)]
Fix UseNullptr fails to replace explict casts surrounded by another implicit
cast

UseNullptr previously matched the implicit cast to const pointer as well as
the explicit cast within that has an implicit cast to nullptr as a descendant.

-Refactored UseNullptr to avoid special-casing certain kinds of cast sequences
-Added test cases.

llvm-svn: 178907

11 years agoAdd an error to check that all program scope variables are in the constant address...
Tanya Lattner [Fri, 5 Apr 2013 20:14:50 +0000 (20:14 +0000)]
Add an error to check that all program scope variables are in the constant address space in OpenCL.

llvm-svn: 178906

11 years ago[Support][FileSystem] Fix identify_magic for big endian ELF.
Michael J. Spencer [Fri, 5 Apr 2013 20:10:04 +0000 (20:10 +0000)]
[Support][FileSystem] Fix identify_magic for big endian ELF.

llvm-svn: 178905

11 years agoMove yaml2obj to tools too.
Rafael Espindola [Fri, 5 Apr 2013 20:00:35 +0000 (20:00 +0000)]
Move yaml2obj to tools too.

llvm-svn: 178904

11 years agodoce parsing: adding few more headerdoc tags.
Fariborz Jahanian [Fri, 5 Apr 2013 19:40:53 +0000 (19:40 +0000)]
doce parsing: adding few more headerdoc tags.
// rdar://12379114

llvm-svn: 178903

11 years agoCommitting change left out of r178900
Edwin Vane [Fri, 5 Apr 2013 19:25:15 +0000 (19:25 +0000)]
Committing change left out of r178900

llvm-svn: 178902

11 years agoFix symbol dependency errors introduced with libmigrateCore
Edwin Vane [Fri, 5 Apr 2013 19:18:13 +0000 (19:18 +0000)]
Fix symbol dependency errors introduced with libmigrateCore

With cpp11-migrate core functionality moved to a separate library (for enabling
unit tests) this library contained code that referenced symbols that are still
in the main binary. On some platforms, the shared library build broke as a
result. This revision fixes the dependency problem and is safe for the eventual
lib-ification of the transforms as well.

llvm-svn: 178901

11 years agoUpdating cpp11-migrate unit tests
Edwin Vane [Fri, 5 Apr 2013 19:17:36 +0000 (19:17 +0000)]
Updating cpp11-migrate unit tests

With the lib-ification of cpp11-migrate, real unit tests can be written.
Replacing dummy tests with some simple tests for the Transform public
interface.

llvm-svn: 178900

11 years ago[analyzer] Eliminates all the cases with unknown family.
Anton Yartsev [Fri, 5 Apr 2013 19:08:04 +0000 (19:08 +0000)]
[analyzer] Eliminates all the cases with unknown family.

Now treat AF_None family as impossible in isTrackedFamily()

llvm-svn: 178899

11 years agoTry to appease the atom buildbots
Manman Ren [Fri, 5 Apr 2013 19:06:10 +0000 (19:06 +0000)]
Try to appease the atom buildbots

llvm-svn: 178898

11 years ago<rdar://problem/13563628>
Enrico Granata [Fri, 5 Apr 2013 18:49:06 +0000 (18:49 +0000)]
<rdar://problem/13563628>

Introducing a negative cache for ObjCLanguageRuntime::LookupInCompleteClassCache()
This helps speed up the (common) case of us looking for classes that are hidden deep within Cocoa internals and repeatedly failing at finding type information for them.
In order for this to work, we need to clean this cache whenever debug information is added. A new symbols loaded event is added that is triggered with add-dsym (before modules loaded would be triggered for both adding modules and adding symbols).
Interested parties can register for this event. Internally, we make sure to clean the negative cache whenever symbols are added.
Lastly, ClassDescriptor::IsTagged() has been refactored to GetTaggedPointerInfo() that also (optionally) returns info and value bits. In this way, data formatters can share tagged pointer code instead of duplicating the required arithmetic.

llvm-svn: 178897

11 years agoDefine versions of Section that are explicitly marked as little endian.
Rafael Espindola [Fri, 5 Apr 2013 18:45:28 +0000 (18:45 +0000)]
Define versions of Section that are explicitly marked as little endian.

These should really be templated like ELF, but this is a start.

llvm-svn: 178896

11 years agoAdded two debug logging messages to VisitInstructionsTopDown to match VisitInstructio...
Michael Gottesman [Fri, 5 Apr 2013 18:26:08 +0000 (18:26 +0000)]
Added two debug logging messages to VisitInstructionsTopDown to match VisitInstructionsBottomUp.

llvm-svn: 178895

11 years agoDon't use InMemoryStruct in getSection and getSection64.
Rafael Espindola [Fri, 5 Apr 2013 18:18:19 +0000 (18:18 +0000)]
Don't use InMemoryStruct in getSection and getSection64.

llvm-svn: 178894

11 years agoCleaned up whitespace and made debug logging less verbose.
Michael Gottesman [Fri, 5 Apr 2013 18:10:41 +0000 (18:10 +0000)]
Cleaned up whitespace and made debug logging less verbose.

llvm-svn: 178893

11 years agoFix bug in __libcpp_db::__iterator_copy. Add debug test for swaping lists.
Howard Hinnant [Fri, 5 Apr 2013 17:58:52 +0000 (17:58 +0000)]
Fix bug in __libcpp_db::__iterator_copy.  Add debug test for swaping lists.

llvm-svn: 178892

11 years ago[analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks).
Jordan Rose [Fri, 5 Apr 2013 17:55:07 +0000 (17:55 +0000)]
[analyzer] Re-enable cplusplus.NewDelete (but not NewDeleteLeaks).

As mentioned in the previous commit message, the use-after-free and
double-free warnings for 'delete' are worth enabling even while the
leak warnings still have false positives.

llvm-svn: 178891

11 years ago[analyzer] Split new/delete checker into use-after-free and leaks parts.
Jordan Rose [Fri, 5 Apr 2013 17:55:00 +0000 (17:55 +0000)]
[analyzer] Split new/delete checker into use-after-free and leaks parts.

This splits the leak-checking part of alpha.cplusplus.NewDelete into a
separate user-level checker, alpha.cplusplus.NewDeleteLeaks. All the
difficult false positives we've seen with the new/delete checker have been
spurious leak warnings; the use-after-free warnings and mismatched
deallocator warnings, while rare, have always been valid.

<rdar://problem/6194569>

llvm-svn: 178890

11 years agoFixme comment.
Jim Ingham [Fri, 5 Apr 2013 17:39:29 +0000 (17:39 +0000)]
Fixme comment.

llvm-svn: 178889

11 years agoAllow breaking after 'class' for classes with looong names.
Daniel Jasper [Fri, 5 Apr 2013 17:22:09 +0000 (17:22 +0000)]
Allow breaking after 'class' for classes with looong names.

(Don't ask, this was a user request).

llvm-svn: 178888

11 years agoFix bad formatting of overloaded operator definitions.
Daniel Jasper [Fri, 5 Apr 2013 17:21:59 +0000 (17:21 +0000)]
Fix bad formatting of overloaded operator definitions.

Before:
bool operator<
    (const aaaaaaaaaaaaaaaaaaaaa &left, const aaaaaaaaaaaaaaaaaaaaa &right) {
  return left.group < right.group;
}

After:
bool operator<(const aaaaaaaaaaaaaaaaaaaaa &left,
               const aaaaaaaaaaaaaaaaaaaaa &right) {
  return left.group < right.group;
}

llvm-svn: 178887

11 years agoAdd triple to testing case to appease poewrpc64 buildbots
Manman Ren [Fri, 5 Apr 2013 17:11:45 +0000 (17:11 +0000)]
Add triple to testing case to appease poewrpc64 buildbots

llvm-svn: 178886

11 years agoMake the test/CodeGen/X86/win32_sret.ll reliable on any CPU by explicitly specifying...
Timur Iskhodzhanov [Fri, 5 Apr 2013 17:05:56 +0000 (17:05 +0000)]
Make the test/CodeGen/X86/win32_sret.ll reliable on any CPU by explicitly specifying the -mcpu

llvm-svn: 178885

11 years agoReverting 178851 as it broke buildbots
Renato Golin [Fri, 5 Apr 2013 16:39:53 +0000 (16:39 +0000)]
Reverting 178851 as it broke buildbots

llvm-svn: 178883

11 years agoAdd test case for r178881.
Chad Rosier [Fri, 5 Apr 2013 16:29:17 +0000 (16:29 +0000)]
Add test case for r178881.

llvm-svn: 178882

11 years ago[ms-inline asm] Add support for numeric displacement expressions in bracketed
Chad Rosier [Fri, 5 Apr 2013 16:28:55 +0000 (16:28 +0000)]
[ms-inline asm] Add support for numeric displacement expressions in bracketed
memory operands.

Essentially, this layers an infix calculator on top of the parsing state
machine.  The scale on the index register is still expected to be an immediate

 __asm mov eax, [eax + ebx*4]

and will not work with more complex expressions.  For example,

 __asm mov eax, [eax + ebx*(2*2)]

The plus and minus binary operators assume the numeric value of a register is
zero so as to not change the displacement.  Register operands should never
be an operand for a multiply or divide operation; the scale*indexreg
expression is always replaced with a zero on the operand stack to prevent
such a case.
rdar://13521380

llvm-svn: 178881

11 years ago[Support] Disable assertion dialogs from the MSVC debug CRT
Reid Kleckner [Fri, 5 Apr 2013 16:18:03 +0000 (16:18 +0000)]
[Support] Disable assertion dialogs from the MSVC debug CRT

Summary:
Sets a report hook that emulates pressing "retry" in the "abort, retry,
ignore" dialog box that _CrtDbgReport normally raises.  There are many
other ways to disable assertion reports, but this was the only way I
could find that still calls our exception handler.

Reviewers: Bigcheese

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

llvm-svn: 178880

11 years agoUse ScalarBitSetTraits.
Rafael Espindola [Fri, 5 Apr 2013 16:00:31 +0000 (16:00 +0000)]
Use ScalarBitSetTraits.

What was missing was were the type strong operator|.

llvm-svn: 178879

11 years agoProper prefix for doxygen comments
Eli Bendersky [Fri, 5 Apr 2013 15:35:12 +0000 (15:35 +0000)]
Proper prefix for doxygen comments

llvm-svn: 178878

11 years agoFix include guards to match new location.
Rafael Espindola [Fri, 5 Apr 2013 15:31:16 +0000 (15:31 +0000)]
Fix include guards to match new location.

llvm-svn: 178877

11 years ago[asan] make huge_negative_hea_oob more meaningful
Kostya Serebryany [Fri, 5 Apr 2013 15:16:48 +0000 (15:16 +0000)]
[asan] make huge_negative_hea_oob more meaningful

llvm-svn: 178876

11 years agoDon't fetch pointers from a InMemoryStruct.
Rafael Espindola [Fri, 5 Apr 2013 15:15:22 +0000 (15:15 +0000)]
Don't fetch pointers from a InMemoryStruct.

InMemoryStruct is extremely dangerous as it returns data from an internal
buffer when the endiannes doesn't match. This should fix the tests on big
endian hosts.

llvm-svn: 178875

11 years ago[asan] add a test for huge left oob
Kostya Serebryany [Fri, 5 Apr 2013 15:13:23 +0000 (15:13 +0000)]
[asan] add a test for huge left oob

llvm-svn: 178874

11 years agoMore list debug mode tests.
Howard Hinnant [Fri, 5 Apr 2013 15:04:10 +0000 (15:04 +0000)]
More list debug mode tests.

llvm-svn: 178873

11 years ago[sanitizer] found a bug by code inspection: CHECK(a=b) instead of CHECK(a==b). Was...
Kostya Serebryany [Fri, 5 Apr 2013 14:40:25 +0000 (14:40 +0000)]
[sanitizer] found a bug by code inspection: CHECK(a=b) instead of CHECK(a==b). Was puzzled why lint did not catch it. Turns out this check was disabled for asan source. fix all cases and enable the check

llvm-svn: 178872

11 years agoEnable JIT/MCJIT unit tests for targets with JIT support.
Jyotsna Verma [Fri, 5 Apr 2013 14:26:16 +0000 (14:26 +0000)]
Enable JIT/MCJIT unit tests for targets with JIT support.
Change unittests/ExecutionEngine/Makefile to include Makefile.config before
TARGET_HAS_JIT flag is checked.

Fixes bug: http://llvm.org/bugs/show_bug.cgi?id=15669

llvm-svn: 178871

11 years agoAArch64: bring predefines in line with most recent ACLE document
Tim Northover [Fri, 5 Apr 2013 14:08:55 +0000 (14:08 +0000)]
AArch64: bring predefines in line with most recent ACLE document

The prefixes and names used are now identical to 32-bit ARM, which is also
expected to remain unchanged.

If we made this change after a release, we'd probably have to support both
variants for a while, but I think since AArch64 exists only on trunk now, it's
acceptable to simply swap them now.

llvm-svn: 178870

11 years agoRespect Addend when processing MCJIT relocations to local/global symbols.
Ulrich Weigand [Fri, 5 Apr 2013 13:29:04 +0000 (13:29 +0000)]
Respect Addend when processing MCJIT relocations to local/global symbols.

When the RuntimeDyldELF::processRelocationRef routine finds the target
symbol of a relocation in the local or global symbol table, it performs
a section-relative relocation:

    Value.SectionID = lsi->second.first;
    Value.Addend = lsi->second.second;

At this point, however, any Addend that might have been specified in
the original relocation record is lost.  This is somewhat difficult to
trigger for relocations within the code section since they usually
do not contain non-zero Addends (when built with the default JIT code
model, in any case).  However, the problem can be reliably triggered
by a relocation within the data section caused by code like:

 int test[2] = { -1, 0 };
 int *p = &test[1];

The initializer of "p" will need a relocation to "test + 4".  On
platforms using RelA relocations this means an Addend of 4 is required.
Current code ignores this addend when processing the relocation,
resulting in incorrect execution.

Fixed by taking the Addend into account when processing relocations
to symbols found in the local or global symbol table.

Tested on x86_64-linux and powerpc64-linux.

llvm-svn: 178869

11 years ago[msan] Fix sigaction interceptor.
Evgeniy Stepanov [Fri, 5 Apr 2013 12:58:07 +0000 (12:58 +0000)]
[msan] Fix sigaction interceptor.

llvm-svn: 178868

11 years ago[msan] Conditionally disable new() and delete() wrappers.
Evgeniy Stepanov [Fri, 5 Apr 2013 12:03:47 +0000 (12:03 +0000)]
[msan] Conditionally disable new() and delete() wrappers.

To be used with static libstdc++.

llvm-svn: 178866

11 years ago[msan] A runtime option to disable wrapping of signal handlers.
Evgeniy Stepanov [Fri, 5 Apr 2013 11:59:16 +0000 (11:59 +0000)]
[msan] A runtime option to disable wrapping of signal handlers.

llvm-svn: 178865

11 years ago[Sanitizer] enquote the module name when passing it to external symbolizer
Alexey Samsonov [Fri, 5 Apr 2013 11:54:23 +0000 (11:54 +0000)]
[Sanitizer] enquote the module name when passing it to external symbolizer

llvm-svn: 178864

11 years ago[analyzer] Path notes for the MismatchedDeallocator checker.
Anton Yartsev [Fri, 5 Apr 2013 11:25:10 +0000 (11:25 +0000)]
[analyzer] Path notes for the MismatchedDeallocator checker.

llvm-svn: 178862

11 years ago[analyzer] Better name for the test.
Anton Yartsev [Fri, 5 Apr 2013 10:49:41 +0000 (10:49 +0000)]
[analyzer] Better name for the test.

llvm-svn: 178861

11 years agoImprove formatting of multi-variable DeclStmts.
Daniel Jasper [Fri, 5 Apr 2013 09:38:50 +0000 (09:38 +0000)]
Improve formatting of multi-variable DeclStmts.

This fixed llvm.org/PR15670

Before:
aaaaaaaaa a = aaaaaaaaaaaaaaaaaaaa, b = bbbbbbbbbbbbbbbbbbbb,
                                    c = cccccccccccccccccccc,
                                    d = dddddddddddddddddddd;
aaaaaaaaa *a = aaaaaaaaaaaaaaaaaaa, *b = bbbbbbbbbbbbbbbbbbb,
                                     *c = ccccccccccccccccccc,
                                      *d = ddddddddddddddddddd;

After:
aaaaaaaaa a = aaaaaaaaaaaaaaaaaaaa, b = bbbbbbbbbbbbbbbbbbbb,
          c = cccccccccccccccccccc, d = dddddddddddddddddddd;
aaaaaaaaa *a = aaaaaaaaaaaaaaaaaaa, *b = bbbbbbbbbbbbbbbbbbb,
          *c = ccccccccccccccccccc, *d = ddddddddddddddddddd;

llvm-svn: 178860

11 years agollvm-symbolizer: correctly parse filenames given in quotes
Alexey Samsonov [Fri, 5 Apr 2013 09:22:24 +0000 (09:22 +0000)]
llvm-symbolizer: correctly parse filenames given in quotes

llvm-svn: 178859

11 years agoAdd a basic test for llvm-symbolizer tool
Alexey Samsonov [Fri, 5 Apr 2013 08:30:13 +0000 (08:30 +0000)]
Add a basic test for llvm-symbolizer tool

llvm-svn: 178858

11 years ago[ASan] init-order checker tests: move constexpr test that requires -std=c++11 to...
Alexey Samsonov [Fri, 5 Apr 2013 07:51:49 +0000 (07:51 +0000)]
[ASan] init-order checker tests: move constexpr test that requires -std=c++11 to a separate test case. Check that structs with no ctor but non-trivial dtor are ignored.

llvm-svn: 178857

11 years agoAllow EmitConstantInit() to emit constant initializers for objects with trivial const...
Alexey Samsonov [Fri, 5 Apr 2013 07:47:28 +0000 (07:47 +0000)]
Allow EmitConstantInit() to emit constant initializers for objects with trivial constructors and non-trivial destructors. Test that such objects are ignored by init-order checker.

llvm-svn: 178856

11 years agoRemove InternalAlloc/InternalFree calls from StopTheWorld. Patch by Sergey Matveev.
Alexey Samsonov [Fri, 5 Apr 2013 07:41:21 +0000 (07:41 +0000)]
Remove InternalAlloc/InternalFree calls from StopTheWorld. Patch by Sergey Matveev.

llvm-svn: 178855

11 years agoBuildbot fix for r178851: mistake was in wrong TargetRegisterInfo::getRegClass usage.
Stepan Dyatkovskiy [Fri, 5 Apr 2013 07:34:08 +0000 (07:34 +0000)]
Buildbot fix for r178851: mistake was in wrong TargetRegisterInfo::getRegClass usage.

llvm-svn: 178854

11 years ago[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers...
Alexey Samsonov [Fri, 5 Apr 2013 07:30:29 +0000 (07:30 +0000)]
[Sanitizer] Use a common mutex to prevent mixing reports from different sanitizers. This fixes PR15516

llvm-svn: 178853

11 years agoAdd obj2yaml to test dependencies
Alexey Samsonov [Fri, 5 Apr 2013 07:26:37 +0000 (07:26 +0000)]
Add obj2yaml to test dependencies

llvm-svn: 178852

11 years agoFix for PR14824: "Optimization arm_ldst_opt inserts newly generated instruction vldmi...
Stepan Dyatkovskiy [Fri, 5 Apr 2013 05:52:14 +0000 (05:52 +0000)]
Fix for PR14824: "Optimization arm_ldst_opt inserts newly generated instruction vldmia at incorrect position".
Patch introduces memory operands tracking in ARMLoadStoreOpt::LoadStoreMultipleOpti. For each register it keeps the order of load operations as it was before optimization pass.
It is kind of deep improvement of fix proposed by Hao: http://llvm.org/bugs/show_bug.cgi?id=14824#c4
But it also tracks conflicts between different register classes (e.g. D2 and S5).
For more details see:
Bug description: http://llvm.org/bugs/show_bug.cgi?id=14824
LLVM Commits discussion:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130311/167936.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130318/168688.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130325/169376.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130401/170238.html

llvm-svn: 178851

11 years agoAdd a SchedMachineModel for the PPC G5
Hal Finkel [Fri, 5 Apr 2013 05:49:18 +0000 (05:49 +0000)]
Add a SchedMachineModel for the PPC G5

llvm-svn: 178850

11 years agoThe ppc bots say this is the last broken line, so lets try one more :-(
Rafael Espindola [Fri, 5 Apr 2013 05:36:37 +0000 (05:36 +0000)]
The ppc bots say this is the last broken line, so lets try one more :-(

llvm-svn: 178849