Commit Graph

132273 Commits

Author SHA1 Message Date
Benjamin Kramer
a95b3ffe8f Silence a sign compare warning that only occurs on 32 bit platforms.
llvm-svn: 162168
2012-08-18 10:33:09 +00:00
Jason Molenda
8eba46c68a Some eh_frame unwind instructions will define a return address register;
when you want to find the caller's saved pc, you look up the return address
register and use that.  On arm, for instance, this would be the contents of
the link register (lr).

If the eh_frame CIE defines an RA, record that fact in the UnwindPlan.

When we're finding a saved register, if it's the pc, lok for the location
of the return address register instead.

<rdar://problem/12062310> 

llvm-svn: 162167
2012-08-18 06:53:34 +00:00
Craig Topper
0128f9bad7 Refactor code a bit to reduce number of calls in the final compiled code. No functional change intended.
llvm-svn: 162166
2012-08-18 06:39:34 +00:00
Craig Topper
2bd9c7bd2d Reorder initialization list to silence -Wreorder
llvm-svn: 162165
2012-08-18 06:20:54 +00:00
Nadav Rotem
c324af609e Revert r162160 because it made a few buildbots fail.
llvm-svn: 162164
2012-08-18 05:02:36 +00:00
John McCall
dd61f2eb6d When mangling a negative number, remember that negating it does not
always yield a positive number.  Just print the negated result as an
unsigned number.

llvm-svn: 162163
2012-08-18 04:51:52 +00:00
Johnny Chen
8115c6d45d Fix missing braces from the python-GIL merge.
llvm-svn: 162162
2012-08-18 04:24:00 +00:00
Johnny Chen
2c90e999aa Merge python-GIL bracnh (by filcab) back into trunk!
llvm-svn: 162161
2012-08-18 04:14:54 +00:00
Nadav Rotem
2cb14a5c4b The X86 backend has a number of optimizations for SETCC nodes which use
arithmetic instructions. However, when small data types are used, a truncate
node appears between the SETCC node and the arithmetic operation. This patch
adds support for this pattern.

Before:
  xorl  %esi, %edi
  testb %dil, %dil
  setne %al
  ret

After:
  xorb  %dil, %sil
  setne %al
  ret

rdar://12081007

llvm-svn: 162160
2012-08-18 02:43:28 +00:00
Richard Smith
4f605aff7f PR41111, PR5925, PR13210: Teach tentative parsing to annotate identifiers and
nested names as id-expressions, using the annot_primary_expr annotation, where
possible. This removes some redundant lookups, and also allows us to
typo-correct within tentative parsing, and to carry on disambiguating past an
identifier which we can determine will fail lookup as both a type and as a
non-type, allowing us to disambiguate more declarations (and thus offer
improved error recovery for such cases).

This also introduces to the parser the notion of a tentatively-declared name,
which is an identifier which we *might* have seen a declaration for in a
tentative parse (but only if we end up disambiguating the tokens as a
declaration). This is necessary to correctly disambiguate cases where a
variable is used within its own initializer.

llvm-svn: 162159
2012-08-18 00:55:03 +00:00
Dmitri Gribenko
edee47891c AST Matchers tests: test that member() matches member allocation functions:
declare size_t in system-independent way.

llvm-svn: 162158
2012-08-18 00:41:04 +00:00
Jordan Rose
a4309c941c [analyzer] Treat C++ 'throw' as a sink.
Our current handling of 'throw' is all CFG-based: it jumps to a 'catch' block
if there is one and the function exit block if not. But this doesn't really
get the right behavior when a function is inlined: execution will continue on
the caller's side, which is always the wrong thing to do.

Even within a single function, 'throw' completely skips any destructors that
are to be run. This is essentially the same problem as @finally -- a CFGBlock
that can have multiple entry points, whose exit points depend on whether it
was entered normally or exceptionally.

Representing 'throw' as a sink matches our current (non-)handling of @throw.
It's not a perfect solution, but it's better than continuing analysis in an
inconsistent or even impossible state.

<rdar://problem/12113713>

llvm-svn: 162157
2012-08-18 00:30:23 +00:00
Jordan Rose
a97a99736e [analyzer] Treat @throw as a sink (stop processing).
The CFG approximates @throw as a return statement, but that's not good
enough in inlined functions. Moreover, since Objective-C exceptions are
usually considered fatal, we should be suppressing leak warnings like we
do for calls to noreturn functions (like abort()).

The comments indicate that we were probably intending to do this all along;
it may have been inadvertantly changed during a refactor at one point.

llvm-svn: 162156
2012-08-18 00:30:20 +00:00
Jordan Rose
9f61f8a966 [analyzer] Remove obsolete GenericNodeBuilderRefCount from RetainCountChecker.
This was once an adapter class between callbacks that had CheckerContexts
and those that don't, but for a while now it's essentially just been a
wrapper around a ProgramPointTag. We can just pass the tag around instead.

No functionality change.

llvm-svn: 162155
2012-08-18 00:30:16 +00:00
Jordan Rose
80547386b8 [analyzer] Use PointerUnion to implement ExplodedNode::NodeGroup.
We shouldn't be reinventing our own wheels. This also paves the way for
marking different kinds of sinks.

No functionality change.

llvm-svn: 162154
2012-08-18 00:30:10 +00:00
Dmitri Gribenko
0696304a61 AST Matchers tests: test that member() matches member allocation functions.
llvm-svn: 162153
2012-08-18 00:29:27 +00:00
Johnny Chen
319e927ae1 Fix a race condition where multiple PythonInputReaderManager instances could, during destruction,
tread on the m_embedded_thread_input_reader_sp singleton maintained by the script interpreter.
Furthermore, use two additional slots under the script interpreter to store the PseudoTerminal and
the InputReaderSP pertaining to the embedded python interpreter -- resulted from the
ScriptInterpreterPython::ExecuteInterpreterLoop() call -- to facilitate separation from what is being
used by the PythonInputReaderManager instances.

llvm-svn: 162147
2012-08-17 23:44:35 +00:00
Eli Friedman
79a6b30d8a Make atomic load and store of pointers work. Tighten verification of atomic operations
so other unexpected operations don't slip through.  Based on patch by Logan Chien.
PR11786/PR13186.

llvm-svn: 162146
2012-08-17 23:24:29 +00:00
Eric Christopher
ff5760132d Reapply:
Make isa part of objc_object at metadata generation time.

Noticed on inspection.

llvm-svn: 162145
2012-08-17 22:54:57 +00:00
Douglas Gregor
c459b5178c When code completion is enabled, don't do any work in
Sema::ActOnEndOfTranslationUnit(). This is a (minor) optimization.

llvm-svn: 162144
2012-08-17 22:17:36 +00:00
Fariborz Jahanian
f85f338634 c: privide deprecated warning when __private_extern__ storage
specifier is unsed in a declaration; as it may not make the symbol
local to linkage unit as intended. Suggest using "hidden" visibility 
attribute instead. // rdar://7703982

llvm-svn: 162138
2012-08-17 21:44:55 +00:00
Richard Smith
257c5f2088 Fix undefined behavior (binding a reference to a dereferenced null pointer) if
SSAUpdater was created and destroyed without being initialized.

llvm-svn: 162137
2012-08-17 21:42:44 +00:00
Akira Hatanaka
fb21e84248 Add MipsELFWriterInfo.{h,cpp}.
llvm-svn: 162136
2012-08-17 21:38:47 +00:00
Akira Hatanaka
111174be7b Correct MCJIT functionality for MIPS32 architecture.
No new tests are added.
All tests in ExecutionEngine/MCJIT that have been failing pass after this patch
is applied (when "make check" is done on a mips board). 

Patch by Petar Jovanovic.

llvm-svn: 162135
2012-08-17 21:28:04 +00:00
Chad Rosier
571c5e91c4 [ms-inline asm] Update comment.
llvm-svn: 162134
2012-08-17 21:27:25 +00:00
Richard Smith
87deab3e6c Part of PR13618: visit the TypeLoc when RecursiveASTVisitor visits a CompoundLiteralExpr.
llvm-svn: 162133
2012-08-17 21:23:17 +00:00
Chad Rosier
0731affaca [ms-inline asm] Extract AsmStmt handling into a separate file, so as to not
pollute SemaStmt with extraneous asm handling logic.

llvm-svn: 162132
2012-08-17 21:19:40 +00:00
Bill Wendling
bfb9b7598d Implement stack protectors for structures with character arrays in them.
<rdar://problem/10545247>

llvm-svn: 162131
2012-08-17 20:59:56 +00:00
Jakob Stoklund Olesen
7b1a2e8f02 Avoid folding ADD instructions with FI operands.
PEI can't handle the pseudo-instructions. This can be removed when the
pseudo-instructions are replaced by normal predicated instructions.

Fixes PR13628.

llvm-svn: 162130
2012-08-17 20:55:34 +00:00
Fariborz Jahanian
3a4b644982 make this test case 64bit test. It fails due to
'int' vs. 'long' issue with i386.

llvm-svn: 162125
2012-08-17 20:23:06 +00:00
Akira Hatanaka
7605630c48 Add stub methods for mips assembly matcher.
Patch by Vladimir Medic.

llvm-svn: 162124
2012-08-17 20:16:42 +00:00
Jordan Rose
9844ab8992 [analyzer] Make BlockDataRegions typed, so that they have DynamicTypeInfo.
Fixes <rdar://problem/12119814>

llvm-svn: 162123
2012-08-17 20:16:34 +00:00
Benjamin Kramer
34764fe2e4 MemoryBuiltins: Properly guard ObjectSizeOffsetVisitor against cycles in the IR.
The previous fix only checked for simple cycles, use a set to catch longer
cycles too.

Drop the broken check from the ObjectSizeOffsetEvaluator. The BoundsChecking
pass doesn't have to deal with invalid IR like InstCombine does.

llvm-svn: 162120
2012-08-17 19:26:41 +00:00
Fariborz Jahanian
dbd89aedd2 Remove -Wbad-function-cast from -Wall.
llvm-svn: 162117
2012-08-17 18:50:02 +00:00
Daniel Dunbar
455a0496b2 darwin/driver: Support using SDKROOT to define the default for -isysroot.
- The SDKROOT environment variable is the de facto way to set the default SDK
   for a number of tools, join forces with them.

llvm-svn: 162116
2012-08-17 18:43:50 +00:00
Dmitri Gribenko
d394c8a83e AST Matchers: introduce functionTemplate(), classTemplate() and
isExplicitTemplateSpecialization() matchers which do what their name says.

llvm-svn: 162115
2012-08-17 18:42:47 +00:00
Bill Wendling
34bc34ecae Change the linker_private_weak_def_auto' linkage to linkonce_odr_auto_hide' to
make it more consistent with its intended semantics.

The `linker_private_weak_def_auto' linkage type was meant to automatically hide
globals which never had their addresses taken. It has nothing to do with the
`linker_private' linkage type, which outputs the symbols with a `l' (ell) prefix
among other things.

The intended semantic is more like the `linkonce_odr' linkage type.

Change the name of the linkage type to `linkonce_odr_auto_hide'. And therefore
changing the semantics so that it produces the correct output for the linker.

Note: The old linkage name `linker_private_weak_def_auto' will still parse but
is not a synonym for `linkonce_odr_auto_hide'. This should be removed in 4.0.
<rdar://problem/11754934>

llvm-svn: 162114
2012-08-17 18:33:14 +00:00
Rafael Espindola
9a16735e22 Assert that dominates is not given a multiple edge. Finding out if we have
multiple edges between two blocks is linear. If the caller is iterating all
edges leaving a BB that would be a square time algorithm. It is more efficient
to have the callers handle that case.

Currently the only callers are:
* GVN: already avoids the multiple edge case.
* Verifier: could only hit this assert when looking at an invalid invoke. Since
it already rejects the invoke, just avoid computing the dominance for it.

llvm-svn: 162113
2012-08-17 18:21:28 +00:00
Dmitry Vyukov
e2b5b5c4ac tsan: Non-executable stack for hand-coded assembly
llvm-svn: 162112
2012-08-17 18:05:28 +00:00
Howard Hinnant
a0b42cacbf Apply patches supplied by Michel Morin in http://llvm.org/bugs/show_bug.cgi?id=13601 to correct bugs in is_convertible for the case that the intrinsic __is_convertible_to is not available.
llvm-svn: 162111
2012-08-17 17:54:11 +00:00
Alexander Kornienko
2018618b4d Fixed crash and added a test and a minor output problem
llvm-svn: 162110
2012-08-17 17:38:39 +00:00
Fariborz Jahanian
91f548b04b c: implement gcc's -Wbad-function-cast which warns
on unsafe cast of a c-function call. This is
a C-only option.

llvm-svn: 162109
2012-08-17 17:22:34 +00:00
Howard Hinnant
7ee271360d Consistently label __bit_array as a struct, not a class.
llvm-svn: 162108
2012-08-17 17:10:18 +00:00
Jakob Stoklund Olesen
c1dee482c8 Add comment, clean up code. No functional change.
llvm-svn: 162107
2012-08-17 16:59:09 +00:00
Benjamin Kramer
0e72d5c3e5 Define __builtin_ffs[ll] with a signed argument instead of unsigned.
GCC documents these as unsigned, but defines them as signed.

llvm-svn: 162106
2012-08-17 16:39:13 +00:00
Chad Rosier
2da9d6d6cf [ms-inline asm] Instantiate the MCStreamer as a NullStream. We're parsing
instruction, not emitting them, so a NullStream is fine.

llvm-svn: 162105
2012-08-17 16:38:04 +00:00
Sean Callanan
433c8a1f44 Committed a simple dtrace script that tracks
process termination, which can be useful to track
debugserver's delivery of signals.

llvm-svn: 162104
2012-08-17 16:30:13 +00:00
Alexander Potapenko
dffbb3b330 Intercept siglongjmp and _longjmp under "#if ASAN_INTERCEPT_*"
llvm-svn: 162103
2012-08-17 16:27:38 +00:00
Dmitri Gribenko
546481170c Add release notes for type safety attributes.
llvm-svn: 162102
2012-08-17 16:01:54 +00:00
Benjamin Kramer
ca7ca4f6c6 TargetLowering: Use the large shift amount during legalize types. The legalizer may call us with an overly large type.
llvm-svn: 162101
2012-08-17 15:54:21 +00:00