platform/upstream/llvm.git
11 years agoPropagate CharUnits through CGObjCMac.cpp.
Eli Friedman [Tue, 6 Nov 2012 03:41:04 +0000 (03:41 +0000)]
Propagate CharUnits through CGObjCMac.cpp.

llvm-svn: 167437

11 years agoMinor fix to ObjC layout bitmap metadata. Found while I was trying to
Eli Friedman [Tue, 6 Nov 2012 03:38:02 +0000 (03:38 +0000)]
Minor fix to ObjC layout bitmap metadata.  Found while I was trying to
refactor the code.

llvm-svn: 167436

11 years agoScheduleDAG interface. Added OrderKind to distinguish nonregister dependencies.
Andrew Trick [Tue, 6 Nov 2012 03:13:46 +0000 (03:13 +0000)]
ScheduleDAG interface. Added OrderKind to distinguish nonregister dependencies.

This is in preparation for adding "weak" DAG edges, but generally
simplifies the design.

llvm-svn: 167435

11 years agoUpdate compiler-rt tests to match flag renaming/deprecation in Clang.
Richard Smith [Tue, 6 Nov 2012 02:31:42 +0000 (02:31 +0000)]
Update compiler-rt tests to match flag renaming/deprecation in Clang.

llvm-svn: 167434

11 years agoClassify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as -fsanitiz...
Richard Smith [Tue, 6 Nov 2012 02:30:30 +0000 (02:30 +0000)]
Classify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as -fsanitize=divide-by-zero.

llvm-svn: 167433

11 years ago[c-index-test] Do install c-index-test because it's not just for tests,
Argyrios Kyrtzidis [Tue, 6 Nov 2012 02:12:21 +0000 (02:12 +0000)]
[c-index-test] Do install c-index-test because it's not just for tests,
it's also setup as 'INTERNAL_TOOL'.

llvm-svn: 167432

11 years agoPropagate CharUnits into ObjC CodeGen. No intended functional change.
Eli Friedman [Tue, 6 Nov 2012 01:51:20 +0000 (01:51 +0000)]
Propagate CharUnits into ObjC CodeGen.  No intended functional change.

llvm-svn: 167431

11 years agoAdd a workaround to problems with the clang debug info for
Jim Ingham [Tue, 6 Nov 2012 01:14:52 +0000 (01:14 +0000)]
Add a workaround to problems with the clang debug info for
inlined subroutine ranges.

<rdar://problem/12588579>

llvm-svn: 167430

11 years agoPer discussion on cfe-commits, treat -faddress-sanitizer,
Richard Smith [Tue, 6 Nov 2012 01:12:02 +0000 (01:12 +0000)]
Per discussion on cfe-commits, treat -faddress-sanitizer,
-fno-address-sanitizer, -fthread-sanitizer, -fno-thread-sanitizer, and
-fcatch-undefined-behavior as deprecated: produce a warning if they are used
pointing to the corresponding -fsanitize= option. In passing add the missing
'-' to some diagnostics.

llvm-svn: 167429

11 years ago[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.
Argyrios Kyrtzidis [Tue, 6 Nov 2012 00:35:04 +0000 (00:35 +0000)]
[PCH] Take into account the 'include' source location of a SM_SLOC_BUFFER_ENTRY.

llvm-svn: 167426

11 years ago[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
Argyrios Kyrtzidis [Tue, 6 Nov 2012 00:35:02 +0000 (00:35 +0000)]
[PCH] Write out the ClassTemplateDecl::Common::InjectedClassNameType type
reference instead of relying on computing it.

In general, if storage is no issue, it is preferable to deserialize info from
the PCH instead of trying to recompute it after the PCH was loaded.

The incentive to change this now was due to r155303 changing how friend template
classes in dependent contexts are handled; such classes can now be chained to
a previous template class but the computed InjectedClassNameType may be different
due to the extra template parameters from the dependent context.

The new handling requires more investigation but, in the meantime, writing out
InjectedClassNameType fixes PCH issue in rdar://12627738.

llvm-svn: 167425

11 years ago<rdar://problem/12582031>
Greg Clayton [Tue, 6 Nov 2012 00:20:41 +0000 (00:20 +0000)]
<rdar://problem/12582031>

Unnamed bitfields cause struct layout problems

Synthesize unnamed bitfields when required. Most compilers don't mention unnamed bitfields in the DWARF, so we need to create them to keep clang happy with the types we create from the DWARF. We currently can't do this for ObjC since the DW_AT_bit_offset value for any direct ivars of ObjC classes as the values for these attributes are bogus. A bug has been filed on Clang to fix this, and another bug has been filed on LLDB to make sure we fix the DWARF parser once the clang fix is in by looking the the DW_AT_producer in the compile unit attributes and finding the compiler version and only enabling it for newer versions of clang.

llvm-svn: 167424

11 years agoHave the parser initialize Sema before it consumes the first
Douglas Gregor [Mon, 5 Nov 2012 23:58:27 +0000 (23:58 +0000)]
Have the parser initialize Sema before it consumes the first
token. This is important because the first token could actually be
after an #include that triggers a module import, which might use
either Sema or the AST consumer before it would have been initialized.

llvm-svn: 167423

11 years agoRefactor the getTypeLegalizationCost interface. No functionality change.
Nadav Rotem [Mon, 5 Nov 2012 23:57:45 +0000 (23:57 +0000)]
Refactor the getTypeLegalizationCost interface. No functionality change.

llvm-svn: 167422

11 years agoCostModel: Add tables for the common x86 compares.
Nadav Rotem [Mon, 5 Nov 2012 23:48:20 +0000 (23:48 +0000)]
CostModel: Add tables for the common x86 compares.

llvm-svn: 167421

11 years agoSplit the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
Douglas Gregor [Mon, 5 Nov 2012 23:30:26 +0000 (23:30 +0000)]
Split the instrinsic header wmmintrin.h into AES and PCLMUL parts, so
that we can model them as separate submodules.

llvm-svn: 167420

11 years agoFrontend: Add support for reading named pipes as the main file.
Daniel Dunbar [Mon, 5 Nov 2012 22:53:33 +0000 (22:53 +0000)]
Frontend: Add support for reading named pipes as the main file.

 - The whole {File,Source}Manager is built around wanting to pre-determine the
   size of files, so we can't fit this in naturally. Instead, we handle it like
   we do STDIN, where we just replace the main file contents upfront.

llvm-svn: 167419

11 years agoDelete comment I forgot to delete in my last change.
Nico Weber [Mon, 5 Nov 2012 22:50:26 +0000 (22:50 +0000)]
Delete comment I forgot to delete in my last change.

llvm-svn: 167418

11 years agoUse Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.
Nico Weber [Mon, 5 Nov 2012 22:49:03 +0000 (22:49 +0000)]
Use Richard's BE_THE_HEADER trick to simplify a test. No intended behavior change.

llvm-svn: 167417

11 years agoARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
Manman Ren [Mon, 5 Nov 2012 22:42:46 +0000 (22:42 +0000)]
ARM byval: when type alignment is bigger than ABI alignment, we can't guarantee
the type alignment of the byval argument. This patch will disable byval in this case,
it also increases the size threshold for turning on byval.

A backend fix will be attempted.

rdar://12596507

llvm-svn: 167416

11 years agoUse the individual -fsanitize=<...> arguments to control which of the UBSan
Richard Smith [Mon, 5 Nov 2012 22:21:05 +0000 (22:21 +0000)]
Use the individual -fsanitize=<...> arguments to control which of the UBSan
checks to enable. Remove frontend support for -fcatch-undefined-behavior,
-faddress-sanitizer and -fthread-sanitizer now that they don't do anything.

llvm-svn: 167413

11 years agoCode Model: Improve the accuracy of the zext/sext/trunc vector cost estimation.
Nadav Rotem [Mon, 5 Nov 2012 22:20:53 +0000 (22:20 +0000)]
Code Model: Improve the accuracy of the zext/sext/trunc vector cost estimation.

llvm-svn: 167412

11 years agoAdd -fsanitize=<sanitizers> argument to driver and frontend, and add
Richard Smith [Mon, 5 Nov 2012 22:04:41 +0000 (22:04 +0000)]
Add -fsanitize=<sanitizers> argument to driver and frontend, and add
-fno-sanitize=<sanitizers> argument to driver. These allow ASan, TSan, and the
various UBSan checks to be enabled and disabled separately. Right now, the
different modes can't be combined, but the intention is that combining UBSan
and the other sanitizers will be permitted in the near future.

Currently, the UBSan checks will all be enabled if any of them is; that will be
fixed by the next patch.

llvm-svn: 167411

11 years agoSuppress signed/unsigned comparison warning.
Richard Smith [Mon, 5 Nov 2012 22:01:44 +0000 (22:01 +0000)]
Suppress signed/unsigned comparison warning.

llvm-svn: 167410

11 years agoFix for PR14264 cause by commit r167237 which did not take into account a
Kevin Enderby [Mon, 5 Nov 2012 21:55:41 +0000 (21:55 +0000)]
Fix for PR14264 cause by commit r167237 which did not take into account a
possible buffer change with a .macro directive.

rdar://12637628

llvm-svn: 167408

11 years agoMemoryBuffer: Support reading named pipes in getFile().
Daniel Dunbar [Mon, 5 Nov 2012 21:55:40 +0000 (21:55 +0000)]
MemoryBuffer: Support reading named pipes in getFile().

 - We only support this when the client didn't claim to know the file size.

llvm-svn: 167407

11 years agoRename LangOptions members for address sanitizer and thread sanitizer from
Richard Smith [Mon, 5 Nov 2012 21:48:12 +0000 (21:48 +0000)]
Rename LangOptions members for address sanitizer and thread sanitizer from
*Sanitizer to Sanitize* in preparation for later patches.

llvm-svn: 167405

11 years agoCost Model: Normalize the insert/extract index when splitting types
Nadav Rotem [Mon, 5 Nov 2012 21:12:13 +0000 (21:12 +0000)]
Cost Model: Normalize the insert/extract index when splitting types

llvm-svn: 167402

11 years agoCost Model: teach the cost model about expanding integers.
Nadav Rotem [Mon, 5 Nov 2012 21:11:10 +0000 (21:11 +0000)]
Cost Model: teach the cost model about expanding integers.

llvm-svn: 167401

11 years agoAdd a method to indicate section address re-assignment is finished.
Andrew Kaylor [Mon, 5 Nov 2012 20:57:16 +0000 (20:57 +0000)]
Add a method to indicate section address re-assignment is finished.

Prior to this patch RuntimeDyld attempted to re-apply relocations every time reassignSectionAddress was called (via MCJIT::mapSectionAddress).  In addition to being inefficient and redundant, this led to a problem when a section was temporarily moved too far away from another section with a relative relocation referencing the section being moved.  To fix this, I'm adding a new method (finalizeObject) which the client can call to indicate that it is finished rearranging section addresses so the relocations can safely be applied.

llvm-svn: 167400

11 years agoFix module map for SSE4a builtins
Douglas Gregor [Mon, 5 Nov 2012 20:41:30 +0000 (20:41 +0000)]
Fix module map for SSE4a builtins

llvm-svn: 167399

11 years agoMake cpuid.h actually work with -std=c99 <rdar://problem/12552716>.
Douglas Gregor [Mon, 5 Nov 2012 20:11:10 +0000 (20:11 +0000)]
Make cpuid.h actually work with -std=c99 <rdar://problem/12552716>.

While we're here, extend the module map to cover most of the
newly-added instrinsic headers. Only wmmintrin.h is missing, because
it needs to be split into AES/PCLMUL subheaders (as a separate commit).

llvm-svn: 167398

11 years agoHash the various compiler version, target, preprocessor, and
Douglas Gregor [Mon, 5 Nov 2012 19:45:09 +0000 (19:45 +0000)]
Hash the various compiler version, target, preprocessor, and
header-search options into the module hash. We're just using
ADT/Hashing.hpp for this, which isn't as cryptographically strong as
I'd like, but it'll do. If someone contributes (say) and MD4
implementation, we'd happily switch to that.

llvm-svn: 167397

11 years agoOn PowerPC64, integer return values (as well as arguments) are supposed
Ulrich Weigand [Mon, 5 Nov 2012 19:39:45 +0000 (19:39 +0000)]
On PowerPC64, integer return values (as well as arguments) are supposed
to be extended to a full register.   This is modeled in the IR by marking
the return value (or argument) with a signext or zeroext attribute.

However, while these attributes are respected for function arguments,
they are currently ignored for function return values by the PowerPC
back-end.  This patch updates PPCCallingConv.td to ask for the promotion
to i64, and fixes LowerReturn and LowerCallResult to implement it.

The new test case verifies that both arguments and return values are
properly extended when passing them; and also that the optimizers
understand incoming argument and return values are in fact guaranteed
by the ABI to be extended.

The patch caused a spurious breakage in CodeGen/PowerPC/coalesce-ext.ll,
since the test case used a "ret" instruction to create a use of an i32
value at the end of the function (to set up data flow as required for
what the test is intended to test).  Since there's now an implicit
promotion to i64, that data flow no longer works as expected.  To fix
this, this patch now adds an extra "add" to ensure we have an appropriate
use of the i32 value.

llvm-svn: 167396

11 years agoImplement the cost of abnormal x86 instruction lowering as a table.
Nadav Rotem [Mon, 5 Nov 2012 19:32:46 +0000 (19:32 +0000)]
Implement the cost of abnormal x86 instruction lowering as a table.

llvm-svn: 167395

11 years agoAdd absolute symbol scope recognition in lld/Core
Hemant Kulkarni [Mon, 5 Nov 2012 19:13:54 +0000 (19:13 +0000)]
Add absolute symbol scope recognition in lld/Core

llvm-svn: 167394

11 years agoOn PowerPC64, integer arguments and return values need to be sign- or
Ulrich Weigand [Mon, 5 Nov 2012 19:13:42 +0000 (19:13 +0000)]
On PowerPC64, integer arguments and return values need to be sign- or
zero-extended to 64 bits.  This information is currently provided to
the back end by setting "signext" or "zeroext" attributes.  However,
this is done only for integer types *smaller* than i32, not for i32
itself.  This causes clang to generate code violating the ABI, which
results in a failure of the tramp3d-v4 test case (due to calling a
system library routine without ABI-required extension).

This patch implements custom versions of classifyArgumentType and
classifyReturnType for PPC64_SVR4_ABIInfo, which are the same as the
default versions except that they also classify "int" and "unsigned int"
as types needing extending.  This fixed tramp3d-v4 on PowerPC64.

llvm-svn: 167393

11 years agolli: Initialize the native asm parser for inline assembly.
Jim Grosbach [Mon, 5 Nov 2012 19:06:05 +0000 (19:06 +0000)]
lli: Initialize the native asm parser for inline assembly.

MCJIT supports inline assembly, but requires the asm parser to do so.
Make sure to link it in and initialize it.

llvm-svn: 167392

11 years agoAvoid potentially disastrous mistakes when removing a file.
Filipe Cabecinhas [Mon, 5 Nov 2012 18:41:33 +0000 (18:41 +0000)]
Avoid potentially disastrous mistakes when removing a file.

llvm-svn: 167391

11 years agoFollowing the example from loop-convert tests, simplifying the remove-cstr-calls...
Manuel Klimek [Mon, 5 Nov 2012 18:28:45 +0000 (18:28 +0000)]
Following the example from loop-convert tests, simplifying the remove-cstr-calls lit script.

Patch by Edwin Vane.

llvm-svn: 167390

11 years agoCleaned up the code signing instructions:
Greg Clayton [Mon, 5 Nov 2012 18:23:25 +0000 (18:23 +0000)]
Cleaned up the code signing instructions:
- make sure to delet the .cer file on the desktop
- added section that describes what to do when you re-install a new OS where
  you still have an old code signing certificate around.

llvm-svn: 167389

11 years agoAdd support for the PowerPC-specific inline asm Z constraint and y modifier.
Hal Finkel [Mon, 5 Nov 2012 18:18:42 +0000 (18:18 +0000)]
Add support for the PowerPC-specific inline asm Z constraint and y modifier.

The Z constraint specifies an r+r memory address, and the y modifier expands
to the "r, r" in the asm string. For this initial implementation, the base
register is forced to r0 (which has the special meaning of 0 for r+r addressing
on PowerPC) and the full address is taken in the second register. In the
future, this should be improved.

llvm-svn: 167388

11 years agoTests for 32bit version of block ivar layout metadata.
Fariborz Jahanian [Mon, 5 Nov 2012 18:14:34 +0000 (18:14 +0000)]
Tests for 32bit version of block ivar layout metadata.

llvm-svn: 167387

11 years ago[PATCH] PowerPC: Expand load extend vector operations
Adhemerval Zanella [Mon, 5 Nov 2012 17:15:56 +0000 (17:15 +0000)]
[PATCH] PowerPC: Expand load extend vector operations

This patch expands the SEXTLOAD, ZEXTLOAD, and EXTLOAD operations for
vector types when altivec is enabled.

llvm-svn: 167386

11 years ago[analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h
Jordan Rose [Mon, 5 Nov 2012 16:58:00 +0000 (16:58 +0000)]
[analyzer] Move convenience REGISTER_*_WITH_PROGRAMSTATE to CheckerContext.h

As Anna pointed out, ProgramStateTrait.h is a relatively obscure header,
and checker writers may not know to look there to add their own custom
state.

The base macro that specializes the template remains in ProgramStateTrait.h
(REGISTER_TRAIT_WITH_PROGRAMSTATE), which allows the analyzer core to keep
using it.

llvm-svn: 167385

11 years agoAdd missing this->. Fixes pr14238.
Rafael Espindola [Mon, 5 Nov 2012 14:57:21 +0000 (14:57 +0000)]
Add missing this->. Fixes pr14238.

llvm-svn: 167383

11 years agoDon't infer whether a value is captured in the current function from the
Richard Osborne [Mon, 5 Nov 2012 10:48:24 +0000 (10:48 +0000)]
Don't infer whether a value is captured in the current function from the
'nocapture' attribute.

The nocapture attribute only specifies that no copies are made that
outlive the function. This isn't the same as there being no copies at all.
This fixes PR14045.

llvm-svn: 167381

11 years agoAdd a couple of stubs to the release notes for things I noticed while
Chandler Carruth [Mon, 5 Nov 2012 10:17:00 +0000 (10:17 +0000)]
Add a couple of stubs to the release notes for things I noticed while
clearing out my backlog of commit mail.

llvm-svn: 167380

11 years agoOur style for diagnostic messages is to not include a trailing dot.
Matt Beaumont-Gay [Mon, 5 Nov 2012 05:32:00 +0000 (05:32 +0000)]
Our style for diagnostic messages is to not include a trailing dot.

llvm-svn: 167379

11 years agoPR14256: SelectionDAGLowering was renamed to SelectionDAGBuilder a long time ago...
Eli Bendersky [Mon, 5 Nov 2012 02:59:23 +0000 (02:59 +0000)]
PR14256: SelectionDAGLowering was renamed to SelectionDAGBuilder a long time ago.  Fix references to it in documentation and comments.

llvm-svn: 167378

11 years agoConstantFolding.cpp: Whitespace.
NAKAMURA Takumi [Mon, 5 Nov 2012 00:11:11 +0000 (00:11 +0000)]
ConstantFolding.cpp: Whitespace.

llvm-svn: 167377

11 years agoPut the usage-directive inside the nearest namespace or TU decl. We don't want
Nick Lewycky [Sun, 4 Nov 2012 20:21:54 +0000 (20:21 +0000)]
Put the usage-directive inside the nearest namespace or TU decl. We don't want
to have UsingDirectiveDecl inside anything other than those two.

No user-visible functionality change.

llvm-svn: 167376

11 years agoFixes liftime of captured block variables in mrr mode, per John's feedback, as
Fariborz Jahanian [Sun, 4 Nov 2012 18:19:40 +0000 (18:19 +0000)]
Fixes liftime of captured block variables in mrr mode, per John's feedback, as
well as couple of tests which were not being excercised because of TYPOs.

llvm-svn: 167374

11 years agoTests: Pipe test files into 'opt'
Tobias Grosser [Sun, 4 Nov 2012 16:56:20 +0000 (16:56 +0000)]
Tests: Pipe test files into 'opt'

Use 'opt < %s' instead of just 'opt %s' to ensure that no temporary files are
created.

llvm-svn: 167372

11 years agoApply the patch from PR14160. I failed to construct a testcase for this, but
Duncan Sands [Sun, 4 Nov 2012 09:02:45 +0000 (09:02 +0000)]
Apply the patch from PR14160.  I failed to construct a testcase for this, but
I'm applying it anyway since it seems to be obviously correct.

llvm-svn: 167370

11 years agoTest case for r167363.
Lang Hames [Sun, 4 Nov 2012 05:08:08 +0000 (05:08 +0000)]
Test case for r167363.

llvm-svn: 167369

11 years agoRemove alignments from folding tables for scalar FMA4 instructions.
Craig Topper [Sun, 4 Nov 2012 04:40:08 +0000 (04:40 +0000)]
Remove alignments from folding tables for scalar FMA4 instructions.

llvm-svn: 167366

11 years agoAdd new ArchSpec methods, IsCompatibleMatch() and IsExactMatch().
Jason Molenda [Sun, 4 Nov 2012 03:20:05 +0000 (03:20 +0000)]
Add new ArchSpec methods, IsCompatibleMatch() and IsExactMatch().
The operator== method is a synonym for IsExactMatch().

The essential difference between these two is that IsCompatibleMatch()
will say that armv7 and armv7s are compatible and return true.
IsExactMatch() will say that armv7 and armv7s are not a match.

An armv7s cpu can run either generic armv7 binaries or armv7s binaries
(the latter being tuned for it).  When we're picking the slice of a
universal Mach-O file to load in an armv7s Target, we need to be able to
first look for an exact cpu subtype match (armv7s == armv7s) and failing
that, looking for a slice with a compatible architecture.

Update ObjectContainerUniversalMachO::GetObjectFile to prefer an exact
match of the cpu type, falling back to a compatible match if necessary.

<rdar://problem/12593515>

llvm-svn: 167365

11 years agoonly truncate source lines in text diagnostics when
Seth Cantrell [Sat, 3 Nov 2012 23:56:43 +0000 (23:56 +0000)]
only truncate source lines in text diagnostics when
the ellipsis is shorter than the text it replaces

llvm-svn: 167364

11 years agoSupport interleaving of other pragmas with FP_CONTRACT at the beginning of a
Lang Hames [Sat, 3 Nov 2012 22:29:05 +0000 (22:29 +0000)]
Support interleaving of other pragmas with FP_CONTRACT at the beginning of a
compound statement.

llvm-svn: 167363

11 years agoAddress review comments for r167358: explicitly check for CK_BitCast instead of
Dmitri Gribenko [Sat, 3 Nov 2012 22:10:18 +0000 (22:10 +0000)]
Address review comments for r167358: explicitly check for CK_BitCast instead of
checking against a blacklist.

llvm-svn: 167362

11 years agodon't step into the middle of multibyte sequences
Seth Cantrell [Sat, 3 Nov 2012 21:21:17 +0000 (21:21 +0000)]
don't step into the middle of multibyte sequences

llvm-svn: 167361

11 years agofix bug in SourceColumnMap::startOfPreviousColumn
Seth Cantrell [Sat, 3 Nov 2012 21:21:14 +0000 (21:21 +0000)]
fix bug in SourceColumnMap::startOfPreviousColumn

llvm-svn: 167360

11 years agoEscape trigraphs in unittest.
Benjamin Kramer [Sat, 3 Nov 2012 20:58:26 +0000 (20:58 +0000)]
Escape trigraphs in unittest.

llvm-svn: 167359

11 years agoHandle CK_NullToPointer casts in -Wtype-safety properly. Fixes PR14249.
Dmitri Gribenko [Sat, 3 Nov 2012 16:07:49 +0000 (16:07 +0000)]
Handle CK_NullToPointer casts in -Wtype-safety properly.  Fixes PR14249.

llvm-svn: 167358

11 years agoRemove a const_cast by propagating constness to the member function.
Dmitri Gribenko [Sat, 3 Nov 2012 14:24:57 +0000 (14:24 +0000)]
Remove a const_cast by propagating constness to the member function.

llvm-svn: 167357

11 years agoFix the IntegersSubsetTest unit test when compiled with gcc-4.7. The issue here
Duncan Sands [Sat, 3 Nov 2012 14:04:04 +0000 (14:04 +0000)]
Fix the IntegersSubsetTest unit test when compiled with gcc-4.7.  The issue here
is that the unit test doesn't have IntTy equal to APInt, instead it uses a class
derived from APInt.  When, as in these lines, an IntTy& reference is returned
but is assigned to an APInt&, the compiler destroys the temporary the IntTy& was
referring to, leaving the APInt& referring to garbage.  This causes the unittest
to fail systematically on my machine; it can also be caught by running the test
under valgrind.

llvm-svn: 167356

11 years agoStaticAnalyzer/Core/ExprEngineCallAndReturn.cpp: Appease msvc.
NAKAMURA Takumi [Sat, 3 Nov 2012 13:59:36 +0000 (13:59 +0000)]
StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp: Appease msvc.

0 (as nullptr) is incompatible to pointer in type matching on msvc.

llvm-svn: 167355

11 years agoGeneralize the transform that boosts GEP indices to the size of a pointer to
Duncan Sands [Sat, 3 Nov 2012 11:44:17 +0000 (11:44 +0000)]
Generalize the transform that boosts GEP indices to the size of a pointer to
also do it for vectors of pointers.

llvm-svn: 167354

11 years agoAdd a proper algorithm to compute accurate source ranges for diagnostics with
Eli Friedman [Sat, 3 Nov 2012 03:36:51 +0000 (03:36 +0000)]
Add a proper algorithm to compute accurate source ranges for diagnostics with
caret locations and source ranges in macros.  Makes ranges more accurate
in some cases, and fixes an assertion failure.

Fixes <rdar://problem/12472249>.

llvm-svn: 167353

11 years ago[analyzer] Run remove dead on end of path.
Anna Zaks [Sat, 3 Nov 2012 02:54:20 +0000 (02:54 +0000)]
[analyzer] Run remove dead on end of path.

This will simplify checkers that need to register for leaks. Currently,
they have to register for both: check dead and check end of path.

I've modified the SymbolReaper to consider everything on the stack dead
if the input StackLocationContext is 0.

(This is a bit disruptive, so I'd like to flash out all the issues
asap.)

llvm-svn: 167352

11 years ago[analyzer] add LocationContext::inTopFrame() helper.
Anna Zaks [Sat, 3 Nov 2012 02:54:16 +0000 (02:54 +0000)]
[analyzer] add LocationContext::inTopFrame() helper.

llvm-svn: 167351

11 years ago[analyzer] Refactor: Remove Pred from NodeBuilderContext.
Anna Zaks [Sat, 3 Nov 2012 02:54:11 +0000 (02:54 +0000)]
[analyzer] Refactor: Remove Pred from NodeBuilderContext.

Node builders should manage the nodes, not the context.

llvm-svn: 167350

11 years agoFix a little think-o. In FileSpec::operator== we were trying to figure out whether...
Jim Ingham [Sat, 3 Nov 2012 02:12:46 +0000 (02:12 +0000)]
Fix a little think-o.  In FileSpec::operator== we were trying to figure out whether the rhs file was resolved or not by comparing
the resolved version of the rhs FileSpec's directory name with the lhs FileSpec's directory name.  We really meant to compare it
with the rhs FileSpec's directory name...

<rdar://problem/12438838>

llvm-svn: 167349

11 years ago[mips] Set flag neverHasSideEffects flag on floating point conversion
Akira Hatanaka [Sat, 3 Nov 2012 00:53:12 +0000 (00:53 +0000)]
[mips] Set flag neverHasSideEffects flag on floating point conversion
instructions.

llvm-svn: 167348

11 years agoX86 CostModel: Add support for a some of the common arithmetic instructions for SSE4...
Nadav Rotem [Sat, 3 Nov 2012 00:39:56 +0000 (00:39 +0000)]
X86 CostModel: Add support for a some of the common arithmetic instructions for SSE4, AVX and AVX2.

llvm-svn: 167347

11 years agoSimplify these tests again, now that we're past the version skew.
David Blaikie [Sat, 3 Nov 2012 00:27:14 +0000 (00:27 +0000)]
Simplify these tests again, now that we're past the version skew.

llvm-svn: 167346

11 years ago[mips] Set flag isAsCheapAsAMove flag on instruction LUi.
Akira Hatanaka [Sat, 3 Nov 2012 00:26:02 +0000 (00:26 +0000)]
[mips] Set flag isAsCheapAsAMove flag on instruction LUi.

llvm-svn: 167345

11 years agoBe careful not to optimize a SELECT_CC into a SETCC post-legalization if the SETCC...
Owen Anderson [Sat, 3 Nov 2012 00:17:26 +0000 (00:17 +0000)]
Be careful not to optimize a SELECT_CC into a SETCC post-legalization if the SETCC node would be illegal.

llvm-svn: 167344

11 years agoMake sure users know that "target variable" can read variables while running a proces...
Greg Clayton [Sat, 3 Nov 2012 00:10:22 +0000 (00:10 +0000)]
Make sure users know that "target variable" can read variables while running a process by changing the documentation string.

llvm-svn: 167343

11 years agoCaught two cases where we were passing a Stream* without checking for NULL
Enrico Granata [Sat, 3 Nov 2012 00:09:46 +0000 (00:09 +0000)]
Caught two cases where we were passing a Stream* without checking for NULL

llvm-svn: 167342

11 years ago[mips] Stop reserving register AT and use register scavenger when a scratch
Akira Hatanaka [Sat, 3 Nov 2012 00:05:43 +0000 (00:05 +0000)]
[mips] Stop reserving register AT and use register scavenger when a scratch
register is needed.

llvm-svn: 167341

11 years ago[analyzer] Convert SimpleStreamChecker over to CallEvent.
Jordan Rose [Fri, 2 Nov 2012 23:49:35 +0000 (23:49 +0000)]
[analyzer] Convert SimpleStreamChecker over to CallEvent.

llvm-svn: 167340

11 years ago[analyzer] CheckerDocumentation: Change examples for PreStmt and PostStmt.
Jordan Rose [Fri, 2 Nov 2012 23:49:33 +0000 (23:49 +0000)]
[analyzer] CheckerDocumentation: Change examples for PreStmt and PostStmt.

llvm-svn: 167339

11 years ago[analyzer] Add some convenience accessors to CallEvent, and use them.
Jordan Rose [Fri, 2 Nov 2012 23:49:29 +0000 (23:49 +0000)]
[analyzer] Add some convenience accessors to CallEvent, and use them.

These are CallEvent-equivalents of helpers already accessible in
CheckerContext, as part of making it easier for new checkers to be written
using CallEvent rather than raw CallExprs.

llvm-svn: 167338

11 years ago[analyzer] isCLibraryFunction: check that the function is at TU-scope.
Jordan Rose [Fri, 2 Nov 2012 23:49:24 +0000 (23:49 +0000)]
[analyzer] isCLibraryFunction: check that the function is at TU-scope.

Also, Decls already carry a pointer to the ASTContext, so there's no need
to pass an extra argument to the predicate.

llvm-svn: 167337

11 years agoEmit debug info for C++ struct definitions as DW_TAG_structure_type (instead of class...
David Blaikie [Fri, 2 Nov 2012 23:40:00 +0000 (23:40 +0000)]
Emit debug info for C++ struct definitions as DW_TAG_structure_type (instead of class_type).

llvm-svn: 167336

11 years ago[mips] Do not reserve all 64-bit registers, but only the ones which need to be
Akira Hatanaka [Fri, 2 Nov 2012 23:36:01 +0000 (23:36 +0000)]
[mips] Do not reserve all 64-bit registers, but only the ones which need to be
reserved. Without this fix, RegScavenger::getRegsAvailable incorrectly
returns an empty set of integer registers.

llvm-svn: 167335

11 years agoInclude all the fields so we can correctly emit DW_TAG_structure_type for C++ structs.
David Blaikie [Fri, 2 Nov 2012 23:33:23 +0000 (23:33 +0000)]
Include all the fields so we can correctly emit DW_TAG_structure_type for C++ structs.

llvm-svn: 167334

11 years agoAdd a stub for the x86 cost model impl. Implement a basic cost rule for inserting...
Nadav Rotem [Fri, 2 Nov 2012 23:27:16 +0000 (23:27 +0000)]
Add a stub for the x86 cost model impl. Implement a basic cost rule for inserting/extracting from XMM registers.

llvm-svn: 167333

11 years agoAvoid version skew by making ObjC strict metadata tests resilient to new field.
David Blaikie [Fri, 2 Nov 2012 23:07:41 +0000 (23:07 +0000)]
Avoid version skew by making ObjC strict metadata tests resilient to new field.

llvm-svn: 167332

11 years agoobjective-C mrr block. Block variable layout metadata in
Fariborz Jahanian [Fri, 2 Nov 2012 22:51:18 +0000 (22:51 +0000)]
objective-C mrr block. Block variable layout metadata in
mrr mode.

llvm-svn: 167331

11 years agoRemove empty directory
Nadav Rotem [Fri, 2 Nov 2012 22:35:50 +0000 (22:35 +0000)]
Remove empty directory

llvm-svn: 167330

11 years agoCostModel: add support for Vector Insert and Extract.
Nadav Rotem [Fri, 2 Nov 2012 22:31:56 +0000 (22:31 +0000)]
CostModel: add support for Vector Insert and Extract.

llvm-svn: 167329

11 years agoremove empty directories
Chris Lattner [Fri, 2 Nov 2012 22:29:53 +0000 (22:29 +0000)]
remove empty directories

llvm-svn: 167328

11 years agoFixed a problem where we mistook normal result
Sean Callanan [Fri, 2 Nov 2012 22:28:08 +0000 (22:28 +0000)]
Fixed a problem where we mistook normal result
variables for guard variables because the current
class or method named contained the letters "GV".

llvm-svn: 167327

11 years ago[mips] Fix disassembler test cases.
Akira Hatanaka [Fri, 2 Nov 2012 22:20:10 +0000 (22:20 +0000)]
[mips] Fix disassembler test cases.

llvm-svn: 167326

11 years agoWhen code-completing don't disable the preprocessing record if modules are enabled.
Argyrios Kyrtzidis [Fri, 2 Nov 2012 22:18:44 +0000 (22:18 +0000)]
When code-completing don't disable the preprocessing record if modules are enabled.

llvm-svn: 167325

11 years agoAdd a cost model analysis that allows us to estimate the cost of IR-level instructions.
Nadav Rotem [Fri, 2 Nov 2012 21:48:17 +0000 (21:48 +0000)]
Add a cost model analysis that allows us to estimate the cost of IR-level instructions.

llvm-svn: 167324

11 years agoScalar Bitcasts and Truncs are usually free
Nadav Rotem [Fri, 2 Nov 2012 21:47:47 +0000 (21:47 +0000)]
Scalar Bitcasts and Truncs are usually free

llvm-svn: 167323