platform/upstream/llvm.git
12 years agoFixed an oddity in the Objective-C class descriptors
Sean Callanan [Fri, 21 Sep 2012 02:09:51 +0000 (02:09 +0000)]
Fixed an oddity in the Objective-C class descriptors
where the descriptor took a pointer to an object and
expected the Initialize function to dereference that
pointer and extract the isa value.  This caused one
of our tests to fail.

llvm-svn: 164353

12 years ago<rdar://problem/9959501>
Greg Clayton [Fri, 21 Sep 2012 01:55:30 +0000 (01:55 +0000)]
<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

12 years ago[PCH] After deserializing a DeclContext, if it has external lexical decls but not
Argyrios Kyrtzidis [Fri, 21 Sep 2012 01:30:00 +0000 (01:30 +0000)]
[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

12 years agollvm/test/CodeGen/ARM/fast-isel.ll: Fix possible typos, s/@unaligned_i16_store/@unali...
NAKAMURA Takumi [Fri, 21 Sep 2012 01:15:05 +0000 (01:15 +0000)]
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

12 years agoProperly save and restore RA and Mips16 callee save registers S0,S1
Akira Hatanaka [Fri, 21 Sep 2012 01:08:16 +0000 (01:08 +0000)]
Properly save and restore RA and Mips16 callee save registers S0,S1

Patch by Reed Kotler.

llvm-svn: 164349

12 years agoAdd faux-body support for dispatch_once().
Ted Kremenek [Fri, 21 Sep 2012 00:52:24 +0000 (00:52 +0000)]
Add faux-body support for dispatch_once().

llvm-svn: 164348

12 years agoTestcase does not need to be this strict.
Chad Rosier [Fri, 21 Sep 2012 00:47:08 +0000 (00:47 +0000)]
Testcase does not need to be this strict.

llvm-svn: 164347

12 years agoAdd newline.
Chad Rosier [Fri, 21 Sep 2012 00:43:18 +0000 (00:43 +0000)]
Add newline.

llvm-svn: 164346

12 years ago[fast-isel] Fallback to SelectionDAG isel if we require strict alignment for
Chad Rosier [Fri, 21 Sep 2012 00:41:42 +0000 (00:41 +0000)]
[fast-isel] Fallback to SelectionDAG isel if we require strict alignment for
non-halfword-aligned i16 loads/stores.
rdar://12304911

llvm-svn: 164345

12 years agoTidy up. Whitespace.
Jim Grosbach [Fri, 21 Sep 2012 00:36:42 +0000 (00:36 +0000)]
Tidy up. Whitespace.

llvm-svn: 164344

12 years agoTidy up. Formatting.
Jim Grosbach [Fri, 21 Sep 2012 00:26:53 +0000 (00:26 +0000)]
Tidy up. Formatting.

llvm-svn: 164343

12 years agoARM: Use a dedicated intrinsic for vector bitwise select.
Jim Grosbach [Fri, 21 Sep 2012 00:18:30 +0000 (00:18 +0000)]
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

12 years agoTidy up. Trailing whitespace and 80 columns.
Jim Grosbach [Fri, 21 Sep 2012 00:18:27 +0000 (00:18 +0000)]
Tidy up. Trailing whitespace and 80 columns.

llvm-svn: 164341

12 years agoARM: Use a dedicated intrinsic for vector bitwise select.
Jim Grosbach [Fri, 21 Sep 2012 00:18:20 +0000 (00:18 +0000)]
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

12 years agoImplement faux-body-synthesis of well-known functions in the static analyzer when
Ted Kremenek [Fri, 21 Sep 2012 00:09:11 +0000 (00:09 +0000)]
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

12 years agoConstify method.
Ted Kremenek [Fri, 21 Sep 2012 00:09:05 +0000 (00:09 +0000)]
Constify method.

llvm-svn: 164338

12 years agoEnsure that the Decl* wrapped by an AnalysisDeclContext cannot be changed after
Ted Kremenek [Fri, 21 Sep 2012 00:09:03 +0000 (00:09 +0000)]
Ensure that the Decl* wrapped by an AnalysisDeclContext cannot be changed after
construction.

llvm-svn: 164337

12 years agoRemove unused fields.
Ted Kremenek [Fri, 21 Sep 2012 00:09:01 +0000 (00:09 +0000)]
Remove unused fields.

llvm-svn: 164336

12 years agoSerialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.
Douglas Gregor [Thu, 20 Sep 2012 23:43:29 +0000 (23:43 +0000)]
Serialize the 'IsConstexpr' bit of VarDecls. Fixes <rdar://problem/12328814>.

llvm-svn: 164335

12 years agoFixing a logic error where we would incorrectly show the newly crafted function not...
Enrico Granata [Thu, 20 Sep 2012 23:23:55 +0000 (23:23 +0000)]
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

12 years agoFixed a problem where persistent variables did
Sean Callanan [Thu, 20 Sep 2012 23:21:16 +0000 (23:21 +0000)]
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

12 years agoThread-safety analysis: fix bug where shared trylock was treated
DeLesley Hutchins [Thu, 20 Sep 2012 23:14:43 +0000 (23:14 +0000)]
Thread-safety analysis: fix bug where shared trylock was treated
as exclusive.

llvm-svn: 164332

12 years agoRe-adding this previously removed file.
Greg Clayton [Thu, 20 Sep 2012 23:08:52 +0000 (23:08 +0000)]
Re-adding this previously removed file.

llvm-svn: 164331

12 years agoIgnore PHI-defs for -new-coalescer interference checks.
Jakob Stoklund Olesen [Thu, 20 Sep 2012 23:08:42 +0000 (23:08 +0000)]
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

12 years agoExtend -new-coalescer SSA update to handle mapped values as well.
Jakob Stoklund Olesen [Thu, 20 Sep 2012 23:08:39 +0000 (23:08 +0000)]
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

12 years agoThis file is causing problems. I am going to remove it and try re-adding it.
Greg Clayton [Thu, 20 Sep 2012 23:08:12 +0000 (23:08 +0000)]
This file is causing problems. I am going to remove it and try re-adding it.

llvm-svn: 164328

12 years agoShow the size of what we are dematerializing in the output log for "lldb expr".
Greg Clayton [Thu, 20 Sep 2012 23:07:44 +0000 (23:07 +0000)]
Show the size of what we are dematerializing in the output log for "lldb expr".

llvm-svn: 164327

12 years agoOnly emit DW_AT_object_pointer if this is a definition.
Eric Christopher [Thu, 20 Sep 2012 22:51:57 +0000 (22:51 +0000)]
Only emit DW_AT_object_pointer if this is a definition.

llvm-svn: 164326

12 years agoSimplifyCFG: sink common codes from IF, ELSE blocks down to END block.
Manman Ren [Thu, 20 Sep 2012 22:37:36 +0000 (22:37 +0000)]
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

12 years agoThread safety analysis: properly canonicalize calls to virtual methods within
DeLesley Hutchins [Thu, 20 Sep 2012 22:18:02 +0000 (22:18 +0000)]
Thread safety analysis: properly canonicalize calls to virtual methods within
lock expressions.

llvm-svn: 164324

12 years agoIf the range in a for range statement doesn't have a viable begin/end function,
Richard Smith [Thu, 20 Sep 2012 21:52:32 +0000 (21:52 +0000)]
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

12 years agoCompile shared libraries with dSYM files when requested on darwin. Prior to this...
Greg Clayton [Thu, 20 Sep 2012 21:43:11 +0000 (21:43 +0000)]
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

12 years ago<rdar://problem/12315386>
Greg Clayton [Thu, 20 Sep 2012 21:38:45 +0000 (21:38 +0000)]
<rdar://problem/12315386>

Test suite to catch fragile base class ivar issues.

llvm-svn: 164321

12 years agoTry to make these tests more portable.
Evan Cheng [Thu, 20 Sep 2012 21:35:21 +0000 (21:35 +0000)]
Try to make these tests more portable.

llvm-svn: 164320

12 years agoFix typo. (s/Explided/Exploded/)
David Blaikie [Thu, 20 Sep 2012 20:59:21 +0000 (20:59 +0000)]
Fix typo. (s/Explided/Exploded/)

Patch by Sean McBride.

llvm-svn: 164318

12 years agoFix broken check lines.
Benjamin Kramer [Thu, 20 Sep 2012 19:54:13 +0000 (19:54 +0000)]
Fix broken check lines.

llvm-svn: 164317

12 years agoImprovements to my patch in r164143 per
Fariborz Jahanian [Thu, 20 Sep 2012 19:36:41 +0000 (19:36 +0000)]
Improvements to my patch in r164143 per
Richard's comments. // rdar://12202422

llvm-svn: 164316

12 years agoMake the wchar_t promotion test consistent across different hosts by specifying a...
David Blaikie [Thu, 20 Sep 2012 18:57:53 +0000 (18:57 +0000)]
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

12 years agoRemove a test that is non-portable (cannot be execute on cross builds, for example)
David Blaikie [Thu, 20 Sep 2012 18:42:02 +0000 (18:42 +0000)]
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

12 years agoInclude types when a definition's type differs from a prior declaration.
David Blaikie [Thu, 20 Sep 2012 18:38:57 +0000 (18:38 +0000)]
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

12 years agoFix function names in coding style examples
Andrew Trick [Thu, 20 Sep 2012 17:02:04 +0000 (17:02 +0000)]
Fix function names in coding style examples

llvm-svn: 164311

12 years agoMore work for reading the Objective-C runtime.
Sean Callanan [Thu, 20 Sep 2012 17:01:52 +0000 (17:01 +0000)]
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

12 years agoRevert r164308 to fix buildbots.
Bill Wendling [Thu, 20 Sep 2012 16:59:57 +0000 (16:59 +0000)]
Revert r164308 to fix buildbots.

llvm-svn: 164309

12 years agoMake the 'get*AlignmentFromAttr' functions into member functions within the Attribute...
Bill Wendling [Thu, 20 Sep 2012 16:27:05 +0000 (16:27 +0000)]
Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class.

llvm-svn: 164308

12 years agoRemove more bare uses of the different Attribute enums.
Bill Wendling [Thu, 20 Sep 2012 15:20:36 +0000 (15:20 +0000)]
Remove more bare uses of the different Attribute enums.

llvm-svn: 164307

12 years agoSpecify cpu to get the correct instruction ordering. Remove XFAIL.
Roman Divacky [Thu, 20 Sep 2012 14:59:42 +0000 (14:59 +0000)]
Specify cpu to get the correct instruction ordering. Remove XFAIL.

llvm-svn: 164306

12 years agoMake the 'getAsString' function a method of the Attributes class.
Bill Wendling [Thu, 20 Sep 2012 14:44:42 +0000 (14:44 +0000)]
Make the 'getAsString' function a method of the Attributes class.

llvm-svn: 164305

12 years agoAdd some matchers for basic AST nodes.
Daniel Jasper [Thu, 20 Sep 2012 14:12:57 +0000 (14:12 +0000)]
Add some matchers for basic AST nodes.

Patch by Gábor Horváth.
Review: http://llvm-reviews.chandlerc.com/D45

llvm-svn: 164304

12 years agoStmtPrinter: Print floating point literals with the right suffix to disambiguate...
Benjamin Kramer [Thu, 20 Sep 2012 14:07:17 +0000 (14:07 +0000)]
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

12 years agoBe more consistent about ending suggestions with a '?'
Nico Weber [Thu, 20 Sep 2012 13:02:00 +0000 (13:02 +0000)]
Be more consistent about ending suggestions with a '?'

llvm-svn: 164301

12 years agoclang/test/Analysis: Fix the declaration of strlen() for 32 bit targets.
NAKAMURA Takumi [Thu, 20 Sep 2012 11:03:56 +0000 (11:03 +0000)]
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

12 years agoDisable source fortification on Darwin with AddressSanitizer.
Alexander Potapenko [Thu, 20 Sep 2012 10:10:01 +0000 (10:10 +0000)]
Disable source fortification on Darwin with AddressSanitizer.

ASan doesn't play well with -D_FORTIFY_SOURCE, which is enabled by default starting at OS X 10.7

llvm-svn: 164299

12 years agoProvide better error messages for incorrect matchers.
Daniel Jasper [Thu, 20 Sep 2012 09:24:58 +0000 (09:24 +0000)]
Provide better error messages for incorrect matchers.

By changing the conversion operator into a conversion constructor, we
can enabled based on the template parameters leading to better error
messages. E.g.: stmt(decl()) will now create an error message including:

  note: candidate function not viable: no known conversion from
  'clang::ast_matchers::internal::BindableMatcher<clang::Decl>' to 'const
  clang::ast_matchers::internal::Matcher<clang::Stmt>' for 1st argument

llvm-svn: 164298

12 years agoFix 80-col violations.
Nadav Rotem [Thu, 20 Sep 2012 08:53:31 +0000 (08:53 +0000)]
Fix 80-col violations.

llvm-svn: 164297

12 years agoMake sure lli compiles all code before invalidating instruction caches.
Tim Northover [Thu, 20 Sep 2012 08:46:30 +0000 (08:46 +0000)]
Make sure lli compiles all code before invalidating instruction caches.

Patch from Amara Emerson.

llvm-svn: 164296

12 years agotest/Analysis/malloc-interprocedural.c: Mark it as XFAIL: cygwin,mingw,msvc for now...
NAKAMURA Takumi [Thu, 20 Sep 2012 08:44:12 +0000 (08:44 +0000)]
test/Analysis/malloc-interprocedural.c: Mark it as XFAIL: cygwin,mingw,msvc for now. Investigating.

llvm-svn: 164295

12 years agoBump to lldb-168, debugserver-193.
Jason Molenda [Thu, 20 Sep 2012 06:42:30 +0000 (06:42 +0000)]
Bump to lldb-168, debugserver-193.

llvm-svn: 164291

12 years agoBoth OpenBSD and Bitrig need to include machine/endian.h to get the
Eric Christopher [Thu, 20 Sep 2012 06:19:20 +0000 (06:19 +0000)]
Both OpenBSD and Bitrig need to include machine/endian.h to get the
_BYTE_ORDER define.

Patch by David Hill.

llvm-svn: 164286

12 years agoChange enum type in a static table to uint8_t instead. Saves about 700 hundred bytes...
Craig Topper [Thu, 20 Sep 2012 06:14:08 +0000 (06:14 +0000)]
Change enum type in a static table to uint8_t instead. Saves about 700 hundred bytes of static data. Change unsigned char in same table to uint8_t for explicitness.

llvm-svn: 164285

12 years agoUpdate the LLDB_DISABLE_PYTHON ifdef in FormatManager::LoadObjCFormatters to
Jason Molenda [Thu, 20 Sep 2012 06:06:59 +0000 (06:06 +0000)]
Update the LLDB_DISABLE_PYTHON ifdef in FormatManager::LoadObjCFormatters to
get FormatManager.cpp to build on no-python platforms again.

llvm-svn: 164284

12 years agoSpecify CPu to prevent failure on ATOM due to different code scheduling
Michael Liao [Thu, 20 Sep 2012 03:34:04 +0000 (03:34 +0000)]
Specify CPu to prevent failure on ATOM due to different code scheduling

llvm-svn: 164283

12 years agoFix Sphinx warnings.
Sean Silva [Thu, 20 Sep 2012 03:20:53 +0000 (03:20 +0000)]
Fix Sphinx warnings.

Toctree was not being interlinked properly.

llvm-svn: 164282

12 years agoRe-work X86 code generation of atomic ops with spin-loop
Michael Liao [Thu, 20 Sep 2012 03:06:15 +0000 (03:06 +0000)]
Re-work X86 code generation of atomic ops with spin-loop

- Rewrite/merge pseudo-atomic instruction emitters to address the
  following issue:
  * Reduce one unnecessary load in spin-loop

    previously the spin-loop looks like

        thisMBB:
        newMBB:
          ld  t1 = [bitinstr.addr]
          op  t2 = t1, [bitinstr.val]
          not t3 = t2  (if Invert)
          mov EAX = t1
          lcs dest = [bitinstr.addr], t3  [EAX is implicit]
          bz  newMBB
          fallthrough -->nextMBB

    the 'ld' at the beginning of newMBB should be lift out of the loop
    as lcs (or CMPXCHG on x86) will load the current memory value into
    EAX. This loop is refined as:

        thisMBB:
          EAX = LOAD [MI.addr]
        mainMBB:
          t1 = OP [MI.val], EAX
          LCMPXCHG [MI.addr], t1, [EAX is implicitly used & defined]
          JNE mainMBB
        sinkMBB:

  * Remove immopc as, so far, all pseudo-atomic instructions has
    all-register form only, there is no immedidate operand.

  * Remove unnecessary attributes/modifiers in pseudo-atomic instruction
    td

  * Fix issues in PR13458

- Add comprehensive tests on atomic ops on various data types.
  NOTE: Some of them are turned off due to missing functionality.

- Revise tests due to the new spin-loop generated.

llvm-svn: 164281

12 years agoSphinxify DebuggingJITedCode
Sean Silva [Thu, 20 Sep 2012 03:05:26 +0000 (03:05 +0000)]
Sphinxify DebuggingJITedCode

LGTM by Michael Spencer

llvm-svn: 164280

12 years agoThe keywords "true" and "false" shouldn't warn under -Wundef.
Eli Friedman [Thu, 20 Sep 2012 02:38:38 +0000 (02:38 +0000)]
The keywords "true" and "false" shouldn't warn under -Wundef.

llvm-svn: 164279

12 years agoFix static function names in CodingStandards examples.
Andrew Trick [Thu, 20 Sep 2012 02:01:06 +0000 (02:01 +0000)]
Fix static function names in CodingStandards examples.

Try not to violate conventions immediately before explaining them.

llvm-svn: 164278

12 years ago[analyzer] MallocChecker should not do post-call checks on inlined functions.
Jordan Rose [Thu, 20 Sep 2012 01:55:32 +0000 (01:55 +0000)]
[analyzer] MallocChecker should not do post-call checks on inlined functions.

If someone provides their own function called 'strdup', or 'reallocf', or
even 'malloc', and we inlined it, the inlining should have given us all the
malloc-related information we need. If we then try to attach new information
to the return value, we could end up with spurious warnings.

<rdar://problem/12317671>

llvm-svn: 164276

12 years agoRevert "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."
Jordan Rose [Thu, 20 Sep 2012 01:54:56 +0000 (01:54 +0000)]
Revert "[analyzer] Remove constraints on dead symbols as part of removeDeadBindings."

While we definitely want this optimization in the future, we're not
currently handling constraints on symbolic /expressions/ correctly.
These should stay live even if the SymExpr itself is no longer referenced
because could recreate an identical SymExpr later. Only once the SymExpr
can no longer be recreated -- i.e. a component symbol is dead -- can we
safely remove the constraints on it.

This liveness issue is tracked by <rdar://problem/12333297>.

This reverts r163444 / 24c7f98828e039005cff3bd847e7ab404a6a09f8.

llvm-svn: 164275

12 years agoHandle lambdas where the lambda-declarator is an explicit "(void)". PR13854.
Eli Friedman [Thu, 20 Sep 2012 01:40:23 +0000 (01:40 +0000)]
Handle lambdas where the lambda-declarator is an explicit "(void)".  PR13854.

llvm-svn: 164274

12 years agoPer C++11 [class.friend]p3, the 'friend' keyword must appear first in a
Richard Smith [Thu, 20 Sep 2012 01:31:00 +0000 (01:31 +0000)]
Per C++11 [class.friend]p3, the 'friend' keyword must appear first in a
non-function friend declaration. Patch by Josh Magee!

llvm-svn: 164273

12 years agoPR13881: Add -Wzero-length-array for zero length array extension, and move it into...
Richard Smith [Thu, 20 Sep 2012 01:02:05 +0000 (01:02 +0000)]
PR13881: Add -Wzero-length-array for zero length array extension, and move it into -Wgnu.

llvm-svn: 164272

12 years agoConvert some attribute existence queries over to use the predicate methods.
Bill Wendling [Wed, 19 Sep 2012 23:54:18 +0000 (23:54 +0000)]
Convert some attribute existence queries over to use the predicate methods.

llvm-svn: 164268

12 years agoFix a small FIXME involving template partial ordering and
Eli Friedman [Wed, 19 Sep 2012 23:52:13 +0000 (23:52 +0000)]
Fix a small FIXME involving template partial ordering and
member function templates with an rvalue ref qualifier.

llvm-svn: 164267

12 years agoAdd overflow check to tanh(complex) and reduce to finite answer. Fixes http://llvm...
Howard Hinnant [Wed, 19 Sep 2012 23:51:47 +0000 (23:51 +0000)]
Add overflow check to tanh(complex) and reduce to finite answer.  Fixes llvm.org/bugs/show_bug.cgi?id=13874

llvm-svn: 164266

12 years agoARM: Tidy up IntrinsicsARM.td a bit.
Jim Grosbach [Wed, 19 Sep 2012 23:39:03 +0000 (23:39 +0000)]
ARM: Tidy up IntrinsicsARM.td a bit.

Make the TargetPrefix setting one big setting instead of being spread out
everywhere. No functional change.

llvm-svn: 164265

12 years agoAdd predicates for queries on whether an attribute exists.
Bill Wendling [Wed, 19 Sep 2012 23:35:21 +0000 (23:35 +0000)]
Add predicates for queries on whether an attribute exists.

llvm-svn: 164264

12 years agoFix function template partial ordering rules for static vs. non-static
Eli Friedman [Wed, 19 Sep 2012 23:27:04 +0000 (23:27 +0000)]
Fix function template partial ordering rules for static vs. non-static
functions.

llvm-svn: 164263

12 years agoccc-analyzer: pass -stdlib=libc++ through to the analyzer.
Benjamin Kramer [Wed, 19 Sep 2012 22:56:24 +0000 (22:56 +0000)]
ccc-analyzer: pass -stdlib=libc++ through to the analyzer.

Otherwise clang can't analyze code that relies on features provided by libc++.

llvm-svn: 164262

12 years agoAdd in new data types that are used by AMDIL/ANL among others.
Micah Villmow [Wed, 19 Sep 2012 22:47:07 +0000 (22:47 +0000)]
Add in new data types that are used by AMDIL/ANL among others.

llvm-svn: 164261

12 years agoGrammar.
Eric Christopher [Wed, 19 Sep 2012 22:40:44 +0000 (22:40 +0000)]
Grammar.

llvm-svn: 164260

12 years agoA patch that allows for mach-o architectures to be specified as "<number>-<number...
Greg Clayton [Wed, 19 Sep 2012 22:25:17 +0000 (22:25 +0000)]
A patch that allows for mach-o architectures to be specified as "<number>-<number>" where the first number is the cpu type and the second is the cpu subtype. Also added code to allow use of mach-o architectures that aren't in our tables so that symbolication and static file introspection (crashlogs) can work with them.

llvm-svn: 164258

12 years agoDon't get everything when resolving the symbol context of the ObjC Class symbol,...
Greg Clayton [Wed, 19 Sep 2012 22:23:30 +0000 (22:23 +0000)]
Don't get everything when resolving the symbol context of the ObjC Class symbol, just the module + symbol.

llvm-svn: 164257

12 years agoSoften the pattern-can-never-match error in TableGen into a warning. This pattern...
Owen Anderson [Wed, 19 Sep 2012 22:15:06 +0000 (22:15 +0000)]
Soften the pattern-can-never-match error in TableGen into a warning. This pattern can be very useful in cases where you want to define a multiclass that covers both commutative and non-commutative operators (say, add and sub).

llvm-svn: 164256

12 years agoFix to the project file, to prevent it from using
Sean Callanan [Wed, 19 Sep 2012 22:10:40 +0000 (22:10 +0000)]
Fix to the project file, to prevent it from using
an out-of-date compiler in certain cases.

llvm-svn: 164255

12 years agoUpdate and expand comment.
Eric Christopher [Wed, 19 Sep 2012 22:01:42 +0000 (22:01 +0000)]
Update and expand comment.

llvm-svn: 164254

12 years agoHandle a captured this for the debug information as well.
Eric Christopher [Wed, 19 Sep 2012 21:47:34 +0000 (21:47 +0000)]
Handle a captured this for the debug information as well.

llvm-svn: 164253

12 years agoFix awkward comment.
Eric Christopher [Wed, 19 Sep 2012 21:47:29 +0000 (21:47 +0000)]
Fix awkward comment.

llvm-svn: 164252

12 years agoImplement a correct copy constructor for Record. Now that we're using the ID number...
Owen Anderson [Wed, 19 Sep 2012 21:34:18 +0000 (21:34 +0000)]
Implement a correct copy constructor for Record.  Now that we're using the ID number as a key in maps (for determinism), it is imperative that ID numbers be globally unique, even when we copy construct a Record.
This fixes some obscure failure cases involving registers defined inside multiclasses or foreach constructs that would not receive a unique ID, and would end up being omitted from the AsmMatcher tables.

llvm-svn: 164251

12 years agoResolve conflicts involving dead vector lanes for -new-coalescer.
Jakob Stoklund Olesen [Wed, 19 Sep 2012 21:29:18 +0000 (21:29 +0000)]
Resolve conflicts involving dead vector lanes for -new-coalescer.

A common coalescing conflict in vector code is lane insertion:

  %dst = FOO
  %src = BAR
  %dst:ssub0 = COPY %src

The live range of %src interferes with the ssub0 lane of %dst, but that
lane is never read after %src would have clobbered it. That makes it
safe to merge the live ranges and eliminate the COPY:

  %dst = FOO
  %dst:ssub0 = BAR

This patch teaches the new coalescer to resolve conflicts where dead
vector lanes would be clobbered, at least as long as the clobbered
vector lanes don't escape the basic block.

llvm-svn: 164250

12 years agoThis patch adds memory support functions which will later be used to implement sectio...
Andrew Kaylor [Wed, 19 Sep 2012 20:46:12 +0000 (20:46 +0000)]
This patch adds memory support functions which will later be used to implement section-specific protection handling in MCJIT.

llvm-svn: 164249

12 years agoAdd support for macro parameters/arguments delimited by spaces,
Preston Gurd [Wed, 19 Sep 2012 20:36:12 +0000 (20:36 +0000)]
Add support for macro parameters/arguments delimited by spaces,
to improve compatibility with GNU as.

Based on a patch by PaX Team.

Fixed assertion failures on non-Darwin and added additional test cases.

llvm-svn: 164248

12 years agoAdd support for accessing an MDNode's operands via the C binding. Patch by
Duncan Sands [Wed, 19 Sep 2012 20:29:39 +0000 (20:29 +0000)]
Add support for accessing an MDNode's operands via the C binding.  Patch by
Anthony Bryant.

llvm-svn: 164247

12 years agoSupport default parameters/arguments for assembler macros.
Preston Gurd [Wed, 19 Sep 2012 20:29:04 +0000 (20:29 +0000)]
Support default parameters/arguments for assembler macros.
This patch is based on the one by PaX Team.

Patch by Andy Zhang!

llvm-svn: 164246

12 years agoEnhance unmatched '.endr' directive error message in assembler.
Preston Gurd [Wed, 19 Sep 2012 20:23:43 +0000 (20:23 +0000)]
Enhance unmatched '.endr' directive error message in assembler.
The directive can be matched with directives other than '.rept'

Patch by Andy Zhang!

llvm-svn: 164245

12 years agoThread-safety analysis: Fix warning when EXCLUSIVE_LOCKS_REQUIRED
DeLesley Hutchins [Wed, 19 Sep 2012 19:49:40 +0000 (19:49 +0000)]
Thread-safety analysis:  Fix warning when EXCLUSIVE_LOCKS_REQUIRED
is placed on a function that has no path to the exit block.

llvm-svn: 164244

12 years agoUnify the logic in SelectAtomicLoadAdd and SelectAtomicLoadArith
Michael Liao [Wed, 19 Sep 2012 19:36:58 +0000 (19:36 +0000)]
Unify the logic in SelectAtomicLoadAdd and SelectAtomicLoadArith

- Merge the processing of LOAD_ADD with other atomic load-arith
  operations
- Separate the logic getting target constant for atomic-load-op and add
  an optimization for atomic-load-add on i16 with negative value
- Optimize a minor case for atomic-fetch-add i16 with negative operand. Test
  case is revised.

llvm-svn: 164243

12 years agoThread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED or
DeLesley Hutchins [Wed, 19 Sep 2012 19:18:29 +0000 (19:18 +0000)]
Thread-safety analysis: fix ICE when EXCLUSIVE_LOCKS_REQUIRED or
LOCKS_EXCLUDED is used on a method with a name that is is not a simple
identifier.

llvm-svn: 164242

12 years agoOverloaded __pad_and_output on ostreambuf_iterator and in this overload call sputn...
Howard Hinnant [Wed, 19 Sep 2012 19:14:15 +0000 (19:14 +0000)]
Overloaded __pad_and_output on ostreambuf_iterator and in this overload call sputn instead of dereferencing the iterator which calls sputc.  This is intended to be purely a performance optimization, especially for clients who may have overloaded the virtual function xsputn.

llvm-svn: 164241

12 years agoFix ABI dependent tests by providing an explicit target triple.
David Blaikie [Wed, 19 Sep 2012 18:46:03 +0000 (18:46 +0000)]
Fix ABI dependent tests by providing an explicit target triple.

Patch by Joey Gouly.

llvm-svn: 164239

12 years agoRenaming functions to match coding style guidelines
Michael Ilseman [Wed, 19 Sep 2012 18:14:45 +0000 (18:14 +0000)]
Renaming functions to match coding style guidelines

llvm-svn: 164238