Commit Graph

134140 Commits

Author SHA1 Message Date
Greg Clayton 4b1b8b3e1d <rdar://problem/9959501>
KDP -- now with rudimentary process control (continue only) and read + write registers (which means we can see stack frames) for x86_64, i386 and ARM.

llvm-svn: 164352
2012-09-21 01:55:30 +00:00
Argyrios Kyrtzidis 6fa1682368 [PCH] After deserializing a DeclContext, if it has external lexical decls but not
external visible decls, call DeclContext::setMustBuildLookupTable so that the
"lazy decls" bit of the LookupPtr is set.

Previously, in non-C++, if there were no new declarations causing the "lazy decls" bit
to be set, then DeclContext::lookups_begin() would fail to return the decls from the PCH.

Fixes rdar://12316296.

llvm-svn: 164351
2012-09-21 01:30:00 +00:00
NAKAMURA Takumi 1a38004c1b llvm/test/CodeGen/ARM/fast-isel.ll: Fix possible typos, s/@unaligned_i16_store/@unaligned_i16_load/g.
I guess this had apparently passed in +Asserts possibly due to verborsity.

llvm-svn: 164350
2012-09-21 01:15:05 +00:00
Akira Hatanaka cd04e2b8e2 Properly save and restore RA and Mips16 callee save registers S0,S1
Patch by Reed Kotler.

llvm-svn: 164349
2012-09-21 01:08:16 +00:00
Ted Kremenek d81a4a18b4 Add faux-body support for dispatch_once().
llvm-svn: 164348
2012-09-21 00:52:24 +00:00
Chad Rosier 8ff5a4aa79 Testcase does not need to be this strict.
llvm-svn: 164347
2012-09-21 00:47:08 +00:00
Chad Rosier 1fb301aa41 Add newline.
llvm-svn: 164346
2012-09-21 00:43:18 +00:00
Chad Rosier 2364f58326 [fast-isel] Fallback to SelectionDAG isel if we require strict alignment for
non-halfword-aligned i16 loads/stores.
rdar://12304911

llvm-svn: 164345
2012-09-21 00:41:42 +00:00
Jim Grosbach e2baa97d60 Tidy up. Whitespace.
llvm-svn: 164344
2012-09-21 00:36:42 +00:00
Jim Grosbach 9659ed9813 Tidy up. Formatting.
llvm-svn: 164343
2012-09-21 00:26:53 +00:00
Jim Grosbach 11b6fe5e9c ARM: Use a dedicated intrinsic for vector bitwise select.
The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

llvm-svn: 164342
2012-09-21 00:18:30 +00:00
Jim Grosbach d3608f433a Tidy up. Trailing whitespace and 80 columns.
llvm-svn: 164341
2012-09-21 00:18:27 +00:00
Jim Grosbach 74b61c398c ARM: Use a dedicated intrinsic for vector bitwise select.
The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

llvm-svn: 164340
2012-09-21 00:18:20 +00:00
Ted Kremenek 14f779c4d6 Implement faux-body-synthesis of well-known functions in the static analyzer when
their implementations are unavailable.  Start by simulating dispatch_sync().

This change is largely a bunch of plumbing around something very simple.  We
use AnalysisDeclContext to conjure up a fake function body (using the
current ASTContext) when one does not exist.  This is controlled
under the analyzer-config option "faux-bodies", which is off by default.

The plumbing in this patch is largely to pass the necessary machinery
around.  CallEvent needs the AnalysisDeclContextManager to get
the function definition, as one may get conjured up lazily.

BugReporter and PathDiagnosticLocation needed to be relaxed to handle
invalid locations, as the conjured body has no real source locations.
We do some primitive recovery in diagnostic generation to generate
some reasonable locations (for arrows and events), but it can be
improved.

llvm-svn: 164339
2012-09-21 00:09:11 +00:00
Ted Kremenek 96ea28046c Constify method.
llvm-svn: 164338
2012-09-21 00:09:05 +00:00
Ted Kremenek 108c8de2e3 Ensure that the Decl* wrapped by an AnalysisDeclContext cannot be changed after
construction.

llvm-svn: 164337
2012-09-21 00:09:03 +00:00
Ted Kremenek f9f3d60605 Remove unused fields.
llvm-svn: 164336
2012-09-21 00:09:01 +00:00
Douglas Gregor 12cda633be Serialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.
llvm-svn: 164335
2012-09-20 23:43:29 +00:00
Enrico Granata eacb4911a0 Fixing a logic error where we would incorrectly show the newly crafted function not found error for a Python function in some cases where the function actually existed and had an empty docstring
llvm-svn: 164334
2012-09-20 23:23:55 +00:00
Sean Callanan 2cb5e527f6 Fixed a problem where persistent variables did
not correctly store the contents of Objective-C
classes.  This was due to a combination of
factors:

  1) Types were only being completed if we were
     looking inside them for specific ivars
     (using FindExternalVisibleDeclsByName). 
     We now look the complete type up at every
     FindExternalLexicalDecls.

  2) Even if the types were completed properly,
     ValueObjectConstResult overrode the type
     of every ValueObject using the complete type
     for its class from the debug information.
     Superclasses of complete classes are not
     guaranteed to be complete.  Although "frame
     variable" uses the debug information,
     the expression parser does now piece together
     complete types at every level (as described
     in Bullet 1), so I provided a way for the
     expression parser to prevent overriding.

  3) Type sizes were being miscomputed by
     ClangASTContext.  It ignored the ISA pointer
     and only counted fields.  We now correctly
     count the ISA in the size of an object.

<rdar://problem/12315386>

llvm-svn: 164333
2012-09-20 23:21:16 +00:00
DeLesley Hutchins fcb0ffa622 Thread-safety analysis: fix bug where shared trylock was treated
as exclusive.

llvm-svn: 164332
2012-09-20 23:14:43 +00:00
Greg Clayton dcadc5cfb7 Re-adding this previously removed file.
llvm-svn: 164331
2012-09-20 23:08:52 +00:00
Jakob Stoklund Olesen b8707faba3 Ignore PHI-defs for -new-coalescer interference checks.
A PHI can't create interference on its own. If two live ranges interfere
at a PHI, they must also interfere when leaving one of the PHI
predecessors.

llvm-svn: 164330
2012-09-20 23:08:42 +00:00
Jakob Stoklund Olesen 09cd303655 Extend -new-coalescer SSA update to handle mapped values as well.
The old-fashioned many-to-one value mapping doesn't always work when
merging vector lanes. A value can map to multiple different values, and
it can even be necessary to insert new PHIs.

When a value number is defined by a copy from a value number that
required SSa update, include the live range of the copied value number
in the SSA update as well. It is not necessarily a copy of the original
value number any longer.

llvm-svn: 164329
2012-09-20 23:08:39 +00:00
Greg Clayton b85248da95 This file is causing problems. I am going to remove it and try re-adding it.
llvm-svn: 164328
2012-09-20 23:08:12 +00:00
Greg Clayton bb011f73f5 Show the size of what we are dematerializing in the output log for "lldb expr".
llvm-svn: 164327
2012-09-20 23:07:44 +00:00
Eric Christopher 3a3d529e0d Only emit DW_AT_object_pointer if this is a definition.
llvm-svn: 164326
2012-09-20 22:51:57 +00:00
Manman Ren 93ab64916f SimplifyCFG: sink common codes from IF, ELSE blocks down to END block.
We already have HoistThenElseCodeToIf, this patch implements
SinkThenElseCodeToEnd. When END block has only two predecessors and each
predecessor terminates with unconditional branches, we compare instructions in
IF and ELSE blocks backwards and check whether we can sink the common
instructions down.

rdar://12191395

llvm-svn: 164325
2012-09-20 22:37:36 +00:00
DeLesley Hutchins b78aeed26e Thread safety analysis: properly canonicalize calls to virtual methods within
lock expressions.

llvm-svn: 164324
2012-09-20 22:18:02 +00:00
Richard Smith a05b3b5435 If the range in a for range statement doesn't have a viable begin/end function,
but can be dereferenced to form an expression which does have viable begin/end
functions, then typo-correct the range, even if something else goes wrong with
the statement (such as inaccessible begin/end or the wrong type of loop
variable).

In order to ensure we recover correctly and produce any followup diagnostics in
this case, redo semantic analysis on the for-range statement outside of the
diagnostic trap, after issuing the typo-correction.

llvm-svn: 164323
2012-09-20 21:52:32 +00:00
Greg Clayton 0c9773c6d5 Compile shared libraries with dSYM files when requested on darwin. Prior to this, we never had dSYM files for shared libraries unless it was a dylib only Makefile.
llvm-svn: 164322
2012-09-20 21:43:11 +00:00
Greg Clayton 48e0c2c82d <rdar://problem/12315386>
Test suite to catch fragile base class ivar issues.

llvm-svn: 164321
2012-09-20 21:38:45 +00:00
Evan Cheng 363d73c518 Try to make these tests more portable.
llvm-svn: 164320
2012-09-20 21:35:21 +00:00
David Blaikie 7c70fe60aa Fix typo. (s/Explided/Exploded/)
Patch by Sean McBride.

llvm-svn: 164318
2012-09-20 20:59:21 +00:00
Benjamin Kramer 8554206652 Fix broken check lines.
llvm-svn: 164317
2012-09-20 19:54:13 +00:00
Fariborz Jahanian 2f4e33aba2 Improvements to my patch in r164143 per
Richard's comments. // rdar://12202422

llvm-svn: 164316
2012-09-20 19:36:41 +00:00
David Blaikie 85568adcee Make the wchar_t promotion test consistent across different hosts by specifying a target triple.
This test behavior differs depending (at least) on whether
sizeof(wchar_t) == sizeof(int) or not.

When they are equal, the first redeclaration will fail because decltype(+L'x')
is unsigned int instead of the expected int. This occurs on ARM.

llvm-svn: 164315
2012-09-20 18:57:53 +00:00
David Blaikie 1db86e1f6b Remove a test that is non-portable (cannot be execute on cross builds, for example)
While it might be nice to have a quick end-to-end sanity test, it's just not
really the right place for it & would require more work to enable lit to
provide a detection flag ("XFAIL: cross" or similar) than the value we get from
having this test. Early on it might've made more sense, but these days we've
got some pretty good coverage across the stack with more targeted tests.

llvm-svn: 164314
2012-09-20 18:42:02 +00:00
David Blaikie 6590220181 Include types when a definition's type differs from a prior declaration.
This is some really old code (took me a while to find the test cases) & the
diagnostic text is slightly incorrect (it should really only apply to
re/declarations/, redefinitions are an error regardless of whether the types
match). Not sure if anyone cares about it, though.

For now this just makes the diagnostic more clear in less obvious cases where
the type of a declaration might not be explicitly written (eg: because it
uses decltype)

llvm-svn: 164313
2012-09-20 18:38:57 +00:00
Andrew Trick e6af4b9a35 Fix function names in coding style examples
llvm-svn: 164311
2012-09-20 17:02:04 +00:00
Sean Callanan d0dcae08e5 More work for reading the Objective-C runtime.
We can now read the relevant data structures for
the method list, and use a callback mechanism to
report their details to the AppleObjCTypeVendor,
which constructs appropriate Clang types.

llvm-svn: 164310
2012-09-20 17:01:52 +00:00
Bill Wendling c727bacb38 Revert r164308 to fix buildbots.
llvm-svn: 164309
2012-09-20 16:59:57 +00:00
Bill Wendling abac66150c Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class.
llvm-svn: 164308
2012-09-20 16:27:05 +00:00
Bill Wendling b4e211cd19 Remove more bare uses of the different Attribute enums.
llvm-svn: 164307
2012-09-20 15:20:36 +00:00
Roman Divacky 264f504077 Specify cpu to get the correct instruction ordering. Remove XFAIL.
llvm-svn: 164306
2012-09-20 14:59:42 +00:00
Bill Wendling de74cf50da Make the 'getAsString' function a method of the Attributes class.
llvm-svn: 164305
2012-09-20 14:44:42 +00:00
Daniel Jasper 87c3d369f1 Add some matchers for basic AST nodes.
Patch by Gábor Horváth.
Review: http://llvm-reviews.chandlerc.com/D45

llvm-svn: 164304
2012-09-20 14:12:57 +00:00
Benjamin Kramer 8a52676b85 StmtPrinter: Print floating point literals with the right suffix to disambiguate them from integers.
Based on a patch by Olaf Krzikalla, UDL fixes by me.

llvm-svn: 164303
2012-09-20 14:07:17 +00:00
Nico Weber acbea3a2b4 Be more consistent about ending suggestions with a '?'
llvm-svn: 164301
2012-09-20 13:02:00 +00:00
NAKAMURA Takumi 77369457e0 clang/test/Analysis: Fix the declaration of strlen() for 32 bit targets.
- Inputs/system-header-simulator.h: Declare strlen() with size_t.

  - malloc-interprocedural.c: Move the definition of size_t into the header above.

Then XFAIL can be pruned.

llvm-svn: 164300
2012-09-20 11:03:56 +00:00