Commit Graph

147940 Commits

Author SHA1 Message Date
Alexey Samsonov d1efa5ef96 [Sanitizer] Don't die in symbolizer if it can't read /proc/self/exe link
llvm-svn: 179754
2013-04-18 12:46:33 +00:00
Benjamin Kramer 06022fc91a Add llvm_unreachable at end of fully covered switch to pacify GCC.
llvm-svn: 179753
2013-04-18 10:44:27 +00:00
Hao Liu a2ff69863e Fix for PR14824, An ARM Load/Store Optimization bug
llvm-svn: 179751
2013-04-18 09:11:08 +00:00
David Majnemer 81af06e003 Revert "Combine bit test + conditional or into simple math"
It is causing stage2 builds to fail, let's get them running again.

llvm-svn: 179750
2013-04-18 08:42:33 +00:00
Andy Gibbs a9b1125355 Remove duplicate "friend" declaration.
llvm-svn: 179749
2013-04-18 07:42:20 +00:00
David Majnemer bdf0caf6b1 Combine bit test + conditional or into simple math
Simplify:
(select (icmp eq (and X, C1), 0), Y, (or Y, C2))

Into:
(or (shl (and X, C1), C3), y)

Where:
C3 = Log(C2) - Log(C1)

If:
C1 and C2 are both powers of two

llvm-svn: 179748
2013-04-18 07:30:07 +00:00
Michael Gottesman 323964ca9e [objc-arc] Do not mismatch up retains inside a for loop with releases outside said for loop in the presense of differing provenance caused by escaping blocks.
This occurs due to an alloca representing a separate ownership from the
original pointer. Thus consider the following pseudo-IR:

  objc_retain(%a)
  for (...) {
    objc_retain(%a)
    %block <- %a
    F(%block)
    objc_release(%block)
  }
  objc_release(%a)

From the perspective of the optimizer, the %block is a separate
provenance from the original %a. Thus the optimizer pairs up the inner
retain for %a and the outer release from %a, resulting in segfaults.

This is fixed by noting that the signature of a mismatch of
retain/releases inside the for loop is a Use/CanRelease top down with an
None bottom up (since bottom up the Retain-CanRelease-Use-Release
sequence is completed by the inner objc_retain, but top down due to the
differing provenance from the objc_release said sequence is not
completed). In said case in CheckForCFGHazards, we now clear the state
of %a implying that no pairing will occur.

Additionally a test case is included.

rdar://12969722

llvm-svn: 179747
2013-04-18 05:39:45 +00:00
Michael Gottesman 9e5181393a Removed trailing whitespace.
llvm-svn: 179746
2013-04-18 04:34:11 +00:00
Michael Gottesman a15ab25238 Streamline arc-annotation test (removing some cases which do not add any extra coverage) and set it up to use FileCheck variables to make the test more robust.
llvm-svn: 179745
2013-04-18 04:34:06 +00:00
Argyrios Kyrtzidis 71c12fb4a3 [Parser] Handle #pragma pack/align inside C structs.
Fixes PR13580. Patch by Serge Pavlov!

llvm-svn: 179743
2013-04-18 01:42:35 +00:00
Richard Trieu e089497121 Switch the note order for -Woverloaded-shift-op-parentheses so that the note
with the silence fix-it comes first.  This is more consistent with the rest
of the warnings in -Wparentheses.

llvm-svn: 179742
2013-04-18 01:04:37 +00:00
Akira Hatanaka 89af58991a [mips] Rename function.
llvm-svn: 179741
2013-04-18 01:00:46 +00:00
Richard Trieu cf2a4c0653 Update the -Wparentheses tests to check that fix-its are in the correct place.
llvm-svn: 179740
2013-04-18 00:56:23 +00:00
Akira Hatanaka 59bfaf774b [mips] DSP-ASE move from HI/LO register instructions.
llvm-svn: 179739
2013-04-18 00:52:44 +00:00
Greg Clayton 10c6943ac5 Fixed a few m_private_run_lock issues when attaching and also fixed the process to not try to restart the process if the process is exited, crashed or detached. Partial patch from Carlo Kok.
llvm-svn: 179738
2013-04-18 00:42:25 +00:00
Jack Carter d0bd642464 Mips assembler: formatting and comment changes.
This patch should not have any functional changes. 

llvm-svn: 179737
2013-04-18 00:41:53 +00:00
Anna Zaks 05139fff42 [analyzer] Tweak getDerefExpr more to track DeclRefExprs to references.
In the committed example, we now see a note that tells us when the pointer
was assumed to be null.

This is the only case in which getDerefExpr returned null (failed to get
the dereferenced expr) throughout our regression tests. (There were multiple
occurrences of this one.)

llvm-svn: 179736
2013-04-18 00:15:15 +00:00
Bill Wendling 877cf534ab Add an option `-enable-old-style-attr-syntax' to print out function attributes in the "old" style.
It's sometimes beneficial to emit a testcase with the old style attribute
syntax. Allow someone to do this.
<rdar://problem/13563209>

llvm-svn: 179735
2013-04-17 23:35:59 +00:00
Anna Zaks 1baf545fa6 [analyzer] Improve dereferenced expression tracking for MemberExpr with a dot and non-reference base
llvm-svn: 179734
2013-04-17 23:17:43 +00:00
Bob Wilson fd4f39e893 Add description of -Ofast optimization option to the man page. <rdar://13660458>
llvm-svn: 179733
2013-04-17 22:32:43 +00:00
Anna Zaks 4f59835182 [analyzer] Gain more precision retrieving the right SVal by specifying the type of the expression.
Thanks to Jordan for suggesting the fix.

llvm-svn: 179732
2013-04-17 22:29:51 +00:00
Anna Zaks 54f4d01bd3 [analyzer] Allow TrackConstraintBRVisitor to work when the value it’s tracking is not live in the last node of the path
We always register the visitor on a node in which the value we are tracking is live and constrained. However,
the visitation can restart at a node, later on the path, in which the value is under constrained because
it is no longer live. Previously, we just silently stopped tracking in that case.

llvm-svn: 179731
2013-04-17 22:29:47 +00:00
Argyrios Kyrtzidis 9aca3c61c0 [Modules] Use global index to improve typo correction performance
Typo correction for an unqualified name needs to walk through all of the identifier tables of all modules.
When we have a global index, just walk its identifier table only.

rdar://13425732

llvm-svn: 179730
2013-04-17 22:10:55 +00:00
Michael Gottesman 4e88ce68ae [objc-arc] Added annotation option to only emit annotations for a specific ssa identifier.
llvm-svn: 179729
2013-04-17 21:59:41 +00:00
Nico Weber 7e2da79efa Add support for gcc's spelling of -fcolor-diagnostics.
See http://gcc.gnu.org/onlinedocs/gcc/Language-Independent-Options.html

llvm-svn: 179728
2013-04-17 21:52:44 +00:00
Ashok Thirumurthi b32f6bff30 Fix for regression in TestCPPStaticMethods.py due to refactoring in clang.
- Specify SC_Static given DIE attributes for static methods and operators.

Thanks to Wei Pan for his review and the help with root-causing.

llvm-svn: 179727
2013-04-17 21:36:33 +00:00
Rafael Espindola 035b41653e Two small cleanups for ELF's templates.
* We only ever specialize these templates with an instantiation of ELFType,
  so we don't need a template template.
* Replace LLVM_ELF_COMMA with just passing the individual parameters to the
  macro. This requires a second macro for when we only have ELFT, but that
  is still a small win.

llvm-svn: 179726
2013-04-17 21:20:55 +00:00
Peter Collingbourne 2f495b93ee Add support for subsections to the ELF assembler. Fixes PR8717.
Differential Revision: http://llvm-reviews.chandlerc.com/D598

llvm-svn: 179725
2013-04-17 21:18:16 +00:00
Chad Rosier 6241c1a63d [ms-inline asm] These should be int64_t, not uint64_t.
llvm-svn: 179724
2013-04-17 21:14:38 +00:00
Daniel Dunbar 893f3d54d9 [tests] Only include stdint.h if we are in freestanding mode.
- We shouldn't even try to include stdint.h in hosted mode, as the dependency
   on even parsing a platforms stdint.h might fail for some targets.

llvm-svn: 179723
2013-04-17 21:11:07 +00:00
Fariborz Jahanian 799a4036da [document parsing]: When tag declaration (but not definition!)
is part of the decl-specifier-seq of some other declaration, 
it doesn't get comment. // rdar://12390371

llvm-svn: 179722
2013-04-17 21:05:20 +00:00
Michael Gottesman adb921affa Fixed typo.
llvm-svn: 179721
2013-04-17 21:03:53 +00:00
Chad Rosier efd87c8f4b Test cases for r179719.
llvm-svn: 179720
2013-04-17 21:02:39 +00:00
Chad Rosier 3124627aa8 [ms-inline asm] Add support for the minus unary operator. Previously, we were
unable to handle cases such as __asm mov eax, 8*-8.

This patch also attempts to simplify the state machine.  Further, the error
reporting has been improved.  Test cases included, but more will be added to
the clang side shortly.
rdar://13668445

llvm-svn: 179719
2013-04-17 21:01:45 +00:00
Michael Gottesman 6806b51ad2 [objc-arc] Added descriptions for EnableARCAnnotations, EnableCheckForCFGHazards, EnableARCOptimizations.
llvm-svn: 179718
2013-04-17 20:48:03 +00:00
Michael Gottesman ffef24f964 [objc-arc] Added an option to arc-annotations for turning off CheckForCFGHazard.
llvm-svn: 179717
2013-04-17 20:48:01 +00:00
Eli Bendersky 239a78b835 More consistent formatting and tidying-up
llvm-svn: 179716
2013-04-17 20:17:08 +00:00
Eli Bendersky 24a36eb331 This patch teaches x86 fast-isel to generate the native div/idiv instructions
for the sdiv/srem/udiv/urem bitcode instructions.  This is done for the i8,
i16, and i32 types, as well as i64 for the x86_64 target.

Patch by Jim Stichnoth

llvm-svn: 179715
2013-04-17 20:10:13 +00:00
Arnold Schwaighofer c0c7ff4ac0 X86 cost model: Exit before calling getSimpleVT on non-simple VTs
getSimpleVT can only handle simple value types.

radar://13676022

llvm-svn: 179714
2013-04-17 20:04:53 +00:00
Bill Wendling 9ca12c137f A limit of 500 was still a bit too high for some tests.
PR15000 has a testcase where the time to compile was bordering on 30s. When I
dropped the limit value to 100, it became a much more managable 6s. The compile
time seems to increase in a roughly linear fashion based on increasing the limit
value. (See the runtimes below.)

So, let's lower the limit to 100 so that they can get a more reasonable compile
time.

Limit Value  Time
-----------  ----
10           0.9744s
20           1.8035s
30           2.3618s
40           2.9814s
50           3.6988s
60           4.5486s
70           4.9314s
80           5.8012s
90           6.4246s
100          7.0852s
110          7.6634s
120          8.3553s
130          9.0552s
140          9.6820s
150          9.8804s
160         10.8901s
170         10.9855s
180         12.0114s
190         12.6816s
200         13.2754s
210         13.9942s
220         13.8097s
230         14.3272s
240         15.7753s
250         15.6673s
260         16.0541s
270         16.7625s
280         17.3823s
290         18.8213s
300         18.6120s
310         20.0333s
320         19.5165s
330         20.2505s
340         20.7068s
350         21.1833s
360         22.9216s
370         22.2152s
380         23.9390s
390         23.4609s
400         24.0426s
410         24.6410s
420         26.5208s
430         27.7155s
440         26.4142s
450         28.5646s
460         27.3494s
470         29.7255s
480         29.4646s
490         30.5001s

llvm-svn: 179713
2013-04-17 20:02:32 +00:00
Daniel Malea bbd0581071 Silence some warnings about deprecated declarations
- auto_ptr is one example of this

llvm-svn: 179712
2013-04-17 19:27:31 +00:00
Daniel Malea 9ff5633f85 Add missing include
llvm-svn: 179711
2013-04-17 19:26:52 +00:00
Daniel Malea ffeb4b605a Fix build on Linux
- add a workaround header to define uuid_t on platforms that need it
- unbreak remote debugging of mac os x apps

llvm-svn: 179710
2013-04-17 19:24:22 +00:00
Jordan Rose 111c4a6b69 Fix off-by-one error in #pragma clang system_header.
The system_header pragma (from GCC) is implemented using line notes in the
source manager. However, a line note's line number specifies the number
not for the current line, but for the next line. This was making all
line numbers appear off by one after the pragma.

Reported by Andy Gibbs, uncovered during r179677.

llvm-svn: 179709
2013-04-17 19:09:18 +00:00
Richard Smith 3c626edda2 PR15755: don't drop parameter packs when dropping parameters with default
arguments in the formation of a candidate set of inheriting constructors.

llvm-svn: 179708
2013-04-17 19:00:52 +00:00
Quentin Colombet 6f03f624df Fix treatment of ARM unallocated hint instructions.
The reference manual defines only 5 permitted values for the immediate field of the "hint" instruction:
1. nop (imm == 0)
2. yield (imm == 1)
3. wfe (imm == 2)
4. wfi (imm == 3)
5. sev (imm == 4)

Therefore, restrict the permitted values for the "hint" instruction to 0 through 4.

Patch by Mihail Popa <Mihail.Popa@arm.com>

llvm-svn: 179707
2013-04-17 18:46:12 +00:00
Daniel Malea f41cfba510 Revert 179694 -- it breaks remote debugging of mac os x targets for some folk
- will commit a different workaround momentarily

llvm-svn: 179705
2013-04-17 18:40:42 +00:00
Sean Callanan 14cb2aaa69 Added a new API to the IRInterpreter (the old API
will be gone soon!) that lets it interpret a function
using just an llvm::Module, an llvm::Function, and a
MemoryMap.

Also added an API to IRExecutionUnit to get at its
llvm::Function, so that the IRInterpreter can work
with it.

llvm-svn: 179704
2013-04-17 18:35:47 +00:00
Bill Wendling b544363d0e Appease a gcc warning about an overflow in a constant conversion.
llvm-svn: 179703
2013-04-17 18:26:02 +00:00
Sean Callanan 182bd6c0fe Made the IRInterpreter's methods static, since
it doesn't actually hold any important state.

llvm-svn: 179702
2013-04-17 18:07:40 +00:00