Commit Graph

154990 Commits

Author SHA1 Message Date
Matt Arsenault 0e5df35556 Teach EmitGEPOffset about address spaces
llvm-svn: 187662
2013-08-02 18:33:34 +00:00
Fariborz Jahanian c4291852a4 ObjectiveC migrator: Fixes public buildbot failures,
in my previous patch which was reverted in r187657

llvm-svn: 187661
2013-08-02 18:00:53 +00:00
Matt Kopec 9c99030dea Mark additional icc test failures as expected fail.
llvm-svn: 187660
2013-08-02 17:53:28 +00:00
Howard Hinnant 2f51de568f debug mode for unordered_map. Also picked up a missing check and test in unordered_multimap. This wraps up debug mode for the unordered containers.
llvm-svn: 187659
2013-08-02 17:50:49 +00:00
Renato Golin 0178a25fc5 Fixes ARM LNT bot from SLP change in O3
This patch fixes the multiple breakages on ARM test-suite after the SLP
vectorizer was introduced by default on O3. The problem was an illegal
vector type on ARMTTI::getCmpSelInstrCost() <3 x i1> which is not simple.

The guard protects this code from breaking (cause of the problems) but
doesn't fix the issue that is generating the odd vector in the first
place, which also needs to be investigated.

llvm-svn: 187658
2013-08-02 17:10:04 +00:00
Fariborz Jahanian 87dc0bc078 revert patch I added in r187655. It still breaks public
buildbot.

llvm-svn: 187657
2013-08-02 16:25:41 +00:00
Carlo Kok 4382da983a Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB (with fix for 64bits msvc)
llvm-svn: 187656
2013-08-02 16:14:15 +00:00
Fariborz Jahanian 11fe914549 ObjectiveC migration. Check-in patch reverted in r187634.
Also removed check for "NS" prefix for class name.

llvm-svn: 187655
2013-08-02 16:00:08 +00:00
Rafael Espindola 6df7083be4 Convert last use of st_dev in clang.
llvm-svn: 187654
2013-08-02 15:31:35 +00:00
Evgeniy Stepanov 44b77c26e4 [msan] Allocator statistics interface and malloc hooks.
llvm-svn: 187653
2013-08-02 14:26:58 +00:00
Tim Northover 0389d883fc Remove rather oddly merged logic from AArch64 commit.
We seem to have ended up with both an inlined check of permitted NEON base
types and a call to a function.

Since the outer if was (I believe) strictly weaker than the one in the
function, there's no actual user-visible behaviour change, so no tests.

llvm-svn: 187652
2013-08-02 11:38:46 +00:00
Tim Northover cf708c3284 Fix handling of CHECK-DAG combined with CHECK-NOT
Patch by Daniel Sanders.

llvm-svn: 187651
2013-08-02 11:32:50 +00:00
Daniel Jasper 3dcd7eca7a clang-format: Fix string breaking after "<<".
Before, clang-format would not break overly long string literals
following a "<<" with FormatStyle::AlwaysBreakBeforeMultilineStrings
being set.

llvm-svn: 187650
2013-08-02 11:01:15 +00:00
Duncan Sands 3194fca45f Pacify GCC, which worries about falling off the end of the switch.
llvm-svn: 187649
2013-08-02 09:37:20 +00:00
Evgeniy Stepanov 90daaf9132 [msan] Fix unused function warning in the tests.
llvm-svn: 187648
2013-08-02 09:09:02 +00:00
Alexey Samsonov c04b5cdbca Assume UniqueID is zero for invalid PPRegion to fix uninitialized reads reported by MSan
llvm-svn: 187647
2013-08-02 09:06:39 +00:00
Alexey Samsonov 9096968de5 Fix dereferencing end iterator in SimplifyCFG. Patch by Ye Mei.
llvm-svn: 187646
2013-08-02 08:06:43 +00:00
Rui Ueyama 8344be8407 [PECOFF] A symbol with symbol with section number 0 and non-zero value represents a BSS atom.
llvm-svn: 187645
2013-08-02 05:25:31 +00:00
Craig Topper 470059472a Fix indentation. No functional change.
llvm-svn: 187644
2013-08-02 05:10:31 +00:00
Rui Ueyama 740e402b8b [PECOFF] Simplify COFFBSSAtom.
A instance of the class always represents a BSS atom, so we don't need
to look at the symbol or the section to retrieve its attributes.

llvm-svn: 187643
2013-08-02 05:04:06 +00:00
NAKAMURA Takumi 6fda3b4b86 Revert r187597, "Bugfix for making the DWARF debug strings and labels to code emitted as secrel32 instead of long opcodes (only for coff). This makes them debuggable with GDB."
It broke x86_64-win32 builder in llvm/test/DebugInfo.

llvm-svn: 187642
2013-08-02 03:46:05 +00:00
Eric Christopher 3b5ea5178d Use @rpath for libraries rather than @executable_path on OSX.
Patch by Benjamin Scarlet!

llvm-svn: 187641
2013-08-02 01:51:52 +00:00
Hans Wennborg 007af3d14c Revert r187537 "clang-cl: add more options"
It broke the "phase1 - sanity" buildbot. Reverting until
we can figure out what's going on.

And Eric says it broke all current Mac builds actually.

llvm-svn: 187640
2013-08-02 01:29:28 +00:00
Richard Smith 7ecc31b032 When merging redeclaration chains across modules, if a declaration is visible
in one module but is only declared as a friend in another module, keep it
visible in the result of the merge.

This is incomplete on two axes:

1) Our handling of local extern declarations is basically broken (we put them
in the wrong decl context, and don't find them in redeclaration lookup, unless
they've previously been declared), and this results in them making friends
visible after a merge.

2) Eventually we'll need to mark that this has happened, and more carefully
check whether a declaration should be visible if it was only visible in some
of the modules in which it was declared. Fortunately it's rare for the
identifier namespace of a declaration to change along its redeclaration chain.

llvm-svn: 187639
2013-08-02 01:09:12 +00:00
Eric Christopher cdc78961d3 Temporarily revert "Debug Info Finder|Verifier: handle DbgLoc attached to
instructions." in an attempt to bring back some bots.

This reverts commit r187609.

llvm-svn: 187638
2013-08-02 00:49:44 +00:00
Hans Wennborg 5762a04f12 clang-cl: add more options
This adds a bunch of options to clang-cl. Notably, this includes
all the options that get passed when doing a default build of a
command-line project with msbuild.exe in Debug and Release modes,
and I believe all flags from Reid's original patch.

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

llvm-svn: 187637
2013-08-02 00:30:15 +00:00
Howard Hinnant 42a3046eef Ok, 3 major changes for debug mode in one commit:
1.  I had been detecting and trapping iterator == and \!= among iterators
    in different containers as an error.  But the trapping itself is actually
    an error.
    
    Consider:
    
    #include <iostream>
    #include <vector>
    #include <algorithm>

    template <class C>
    void
    display(const C& c)
    {
        std::cout << "{";
        bool first = true;
        for (const auto& x : c)
        {
            if (\!first)
                std::cout << ", ";
            first = false;
            std::cout << x;
        }
        std::cout << "}\n";
    }

    int
    main()
    {
        typedef std::vector<int> V;
        V v1 = {1, 3, 5};
        V v2 = {2, 4, 6};
        display(v1);
        display(v2);
        V::iterator i = std::find(v1.begin(), v1.end(), 1);
        V::iterator j = std::find(v2.begin(), v2.end(), 2);
        if (*i == *j)
            i = j;    // perfectly legal
        // ...
        if (i \!= j)   // the only way to check
            v2.push_back(*i);
        display(v1);
        display(v2);
    }

    It is legal to assign an iterator from one container to another of the
    same type.  This is required to work.  One might want to test whether or
    not such an assignment had been made.  The way one performs such a check
    is using the iterator's ==, \!= operator.  This is a logical and necessary
    function and does not constitute an error.

2.  I had a header circular dependence bug when _LIBCPP_DEBUG2 is defined.
    This caused a problem in several of the libc++ tests.
    Fixed.

3.  There is a serious problem when _LIBCPP_DEBUG2=1 at the moment in that
    std::basic_string is inoperable.  std::basic_string uses __wrap_iterator
    to implement its iterators.  __wrap_iterator has been rigged up in debug
    mode to support vector.  But string hasn't been rigged up yet.  This means
    that one gets false positives when using std::string in debug mode.  I've
    upped std::string's priority in www/debug_mode.html.

llvm-svn: 187636
2013-08-02 00:26:35 +00:00
Matt Arsenault 1c349ef7e8 Teach InstructionSimplify about pointer address spaces
llvm-svn: 187635
2013-08-02 00:10:44 +00:00
Rafael Espindola 6cbcc10e84 Revert "ObjectiveC migrator. Migrate to instancetype return type for mehods with certain prefix selector matching their class names' suffix."
This reverts commit r187626.

It is breaking the bots.

llvm-svn: 187634
2013-08-02 00:01:14 +00:00
Rafael Espindola f818ef4c37 Revert "If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag is given, enable it for -O3."
This reverts commit r187630.

Looks like it is breaking the bots.

llvm-svn: 187633
2013-08-01 23:56:42 +00:00
Akira Hatanaka 21f334372e [mips] Make load/store accumulator pseudo instructions codeGenOnly. Also,
remove lines that are setting DecoderNamespace for pseudo atomic instructions.

No intended functionality change.

llvm-svn: 187632
2013-08-01 23:14:16 +00:00
Daniel Jasper 7cdc78b39b clang-format: Operator precendence in ObjC method exprs.
Patch (mostly) by Adam Strzelecki. Thanks!

Before:
  [self aaaaaa:bbbbbbbbbbbbb
      aaaaaaaaaa:bbbbbbbbbbbbbbbbb
           aaaaa:bbbbbbbbbbb +
      bbbbbbbbbbbb aaaa:bbb];

After:
  [self aaaaaa:bbbbbbbbbbbbb
      aaaaaaaaaa:bbbbbbbbbbbbbbbbb
           aaaaa:bbbbbbbbbbb + bbbbbbbbbbbb
            aaaa:bbb];

This fixes llvm.org/PR16150.

llvm-svn: 187631
2013-08-01 23:13:03 +00:00
Nadav Rotem 9562d4a2d7 If -fslp-vectorize or -fno-slp-vectorize are given, honor this selection. If no flag is given, enable it for -O3.
llvm-svn: 187630
2013-08-01 22:56:53 +00:00
Matt Arsenault 87dc60761f Teach getOrEnforceKnownAlignment about address spaces
llvm-svn: 187629
2013-08-01 22:42:18 +00:00
Nadav Rotem e4e6e9ed47 Move the optlevel check to the frontend.
llvm-svn: 187628
2013-08-01 22:41:58 +00:00
Fariborz Jahanian 8234d40843 ObjectiveC migrator. Migrate to instancetype return type
for mehods with certain prefix selector matching their class names'
suffix.

llvm-svn: 187626
2013-08-01 22:29:32 +00:00
Jordan Rose 7699e4a50b [analyzer] Don't process autorelease counts in synthesized function bodies.
We process autorelease counts when we exit functions, but if there's an
issue in a synthesized body the report will get dropped. Just skip the
processing for now and let it get handled when the caller gets around to
processing autoreleases.

(This is still suboptimal: objects autoreleased in the caller context
should never be warned about when exiting a callee context, synthesized
or not.)

Second half of <rdar://problem/14611722>

llvm-svn: 187625
2013-08-01 22:16:36 +00:00
Jordan Rose 5fbe7f9766 [analyzer] Silently drop all reports within synthesized bodies.
Much of our diagnostic machinery is set up to assume that the report
end path location is valid. Moreover, the user may be quite confused
when something goes wrong in our BodyFarm-synthesized function bodies,
which may be simplified or modified from the real implementations.
Rather than try to make this all work somehow, just drop the report so
that we don't try to go on with an invalid source location.

Note that we still handle reports whose /paths/ go through invalid
locations, just not those that are reported in one.

We do have to be careful not to lose warnings because of this.
The impetus for this change was an autorelease being processed within
the synthesized body, and there may be other possible issues that are
worth reporting in some way. We'll take these as they come, however.

<rdar://problem/14611722>

llvm-svn: 187624
2013-08-01 22:16:30 +00:00
Carlo Kok 3e8c33cff5 fix for LLVM debug info on llvm-mips-linux where the label name uses % instead of L as a prefix.
llvm-svn: 187623
2013-08-01 22:15:34 +00:00
Daniel Jasper b1ae734ffc clang-format: Don't break empty 2nd operand of ternary expr.
Before:
  some_quite_long_variable_name_ptr
      ?
      : argv[9] ? ptr : argv[8] ? : argv[7] ? ptr : argv[6];
After:
  some_quite_long_variable_name_ptr
      ?: argv[9] ? ptr : argv[8] ?: argv[7] ? ptr : argv[6];

Patch by Adam Strzelecki, thank you!!

This fixed llvm.org/PR16758.

llvm-svn: 187622
2013-08-01 22:05:00 +00:00
Jason Molenda 975abffee7 Re-enable fast stepping for arm targets. The issue being worked
around was fixed in llvm commit r186846.
<rdar://problem/14489274> 

llvm-svn: 187620
2013-08-01 21:50:20 +00:00
Rafael Espindola f8f91b8976 Use llvm::sys::fs::UniqueID for windows and unix.
This unifies the unix and windows versions of FileManager::UniqueDirContainer
and FileManager::UniqueFileContainer by using UniqueID.

We cannot just replace "struct stat" with llvm::sys::fs::file_status, since we
want to be able to construct fake ones, and file_status has different members
on unix and windows.

What the patch does is:

* Record only the information that clang is actually using.
* Use llvm::sys::fs::status instead of stat and fstat.
* Use llvm::sys::fs::UniqueID
* Delete the old windows versions of UniqueDirContainer and
UniqueFileContainer since the "unix" one now works on windows too.

llvm-svn: 187619
2013-08-01 21:42:11 +00:00
Bill Wendling a5c536e1ee Use function attributes to indicate that we don't want to realign the stack.
Function attributes are the future! So just query whether we want to realign the
stack directly from the function instead of through a random target options
structure.

llvm-svn: 187618
2013-08-01 21:42:05 +00:00
Bill Wendling d8f4950862 Use function attributes to indicate if we don't want to realign the stack.
llvm-svn: 187617
2013-08-01 21:41:02 +00:00
Rafael Espindola 4d305dca52 Expose that the unique file ID has a device and a file component.
The use of sd_dev and st_ino has reached libclang, so expose the two components
in UniqueID so that we can use it in clang.

llvm-svn: 187616
2013-08-01 21:36:02 +00:00
Daniel Malea a3d4245a72 Fixed the Intel-syntax X86 disassembler to respect the (existing) option for hexadecimal immediates, to match AT&T syntax. This also brings a new option for C-vs-MASM-style hex.
Patch by Richard Mitton
Reviewed: http://llvm-reviews.chandlerc.com/D1243

llvm-svn: 187614
2013-08-01 21:18:16 +00:00
Reed Kotler 83f879ddb2 Fix some issues with Mips16 floating when certain intrinsics are present.
This is actually an LLVM bug in the way it generates signatures for these
when soft float is enabled. For example, floor ends up having the signature
of int64(int64). The signature part is not the same as where the actual
parameter types are recorded, and those ARE of course int64(int64) when
soft float is enabled. (Yes, Mips16 hard float uses soft float but with
different runtime rounes but then has to interoperate with Mips32 using
normal floating point). This logic will eventually be moved to the 
Mips16HardFloat pass so it's not worth sorting out these issues in LLVM
since nobody but Mips16 cares about these signatures, as far as I know,
and even I won't eventually either.

llvm-svn: 187613
2013-08-01 21:17:53 +00:00
David Blaikie 79af384d72 DebugInfo: Don't prefer declarations over definitions in -flimit-debug-info in C
Without an ODR, the -flimit-debug-info debug info size optimization of
emitting declarations for fully defined types when only a declaration is
needed by the TU, is incorrect. Emit the full definition whenever it's
available in non-C++.

llvm-svn: 187611
2013-08-01 20:57:40 +00:00
Carlo Kok aad6a6a3e0 ARM/Hexagon testcases can't compile x86 only testcase. Reverting change to testcase & fixing check for all.
llvm-svn: 187610
2013-08-01 20:53:57 +00:00
Manman Ren 4c065e779c Debug Info Finder|Verifier: handle DbgLoc attached to instructions.
Also remove checking of llvm.dbg.sp since it is not used in generating dwarf.

Current state of Finder:
DebugInfoFinder tries to list all debug info MDNodes used in a module. To
list debug info MDNodes used by an instruction, DebugInfoFinder provides
processDeclare, processValue and processLocation to handle DbgDeclareInst,
DbgValueInst and DbgLoc attached to instructions. processModule will go
through all DICompileUnits in llvm.dbg.cu and list debug info MDNodes
used by the CUs.

TODO:
1> Finder has a list of CUs, SPs, Types, Scopes and global variables. We
need to add a list of variables that are used by DbgDeclareInst and
DbgValueInst.
2> MDString fields should be null or isa<MDString> and MDNode fields should be
null or isa<MDNode>. We currently use empty string or int 0 to represent null.
3> Go though Verify functions and make sure that they check field types.
4> Clean up existing testing cases to remove llvm.dbg.sp and make sure each
testing case has a llvm.dbg.cu.

llvm-svn: 187609
2013-08-01 20:52:39 +00:00