platform/upstream/llvm.git
11 years agoRevert r166971. It causes buildbot failure. To be investigated.
Jakub Staszak [Mon, 29 Oct 2012 23:13:50 +0000 (23:13 +0000)]
Revert r166971. It causes buildbot failure. To be investigated.

llvm-svn: 166979

11 years agoEnsuring that the swig typemaps for SBData set the size to 0 along with the pointer...
Enrico Granata [Mon, 29 Oct 2012 23:06:44 +0000 (23:06 +0000)]
Ensuring that the swig typemaps for SBData set the size to 0 along with the pointer to NULL
There should be no functional changes as SBData creation functions already checked for NULL regardless of size - but it ensures consistency

llvm-svn: 166978

11 years ago[analyzer] Malloc checker cleanup/refactor
Anna Zaks [Mon, 29 Oct 2012 22:51:54 +0000 (22:51 +0000)]
[analyzer] Malloc checker cleanup/refactor

No need for the auxiliary flag. No need to generate a leak node when
there is no error.

llvm-svn: 166977

11 years ago[analyzer] Add SimpleStreamChecker.
Anna Zaks [Mon, 29 Oct 2012 22:51:50 +0000 (22:51 +0000)]
[analyzer] Add SimpleStreamChecker.

This is an example checker for catching fopen fclose API misuses.

llvm-svn: 166976

11 years ago[analyzer] Add checker helpers to CheckerContext.
Anna Zaks [Mon, 29 Oct 2012 22:51:44 +0000 (22:51 +0000)]
[analyzer] Add checker helpers to CheckerContext.

- Adding Immutable Map to GDM and getIdentifierInfo helper method.

llvm-svn: 166975

11 years agollvm/test/CodeGen/X86/vec_shuffle-30.ll: Try to unbreak builds - assuming +avx.
NAKAMURA Takumi [Mon, 29 Oct 2012 22:45:18 +0000 (22:45 +0000)]
llvm/test/CodeGen/X86/vec_shuffle-30.ll: Try to unbreak builds - assuming +avx.

llvm-svn: 166974

11 years agoRemove unused variable.
Jakub Staszak [Mon, 29 Oct 2012 22:04:32 +0000 (22:04 +0000)]
Remove unused variable.

llvm-svn: 166973

11 years agoSimplify code. No functionality change.
Jakub Staszak [Mon, 29 Oct 2012 22:02:26 +0000 (22:02 +0000)]
Simplify code. No functionality change.

llvm-svn: 166972

11 years agoAllow to fold vector load if there is more than one bitcast, so in the case:
Jakub Staszak [Mon, 29 Oct 2012 21:56:35 +0000 (21:56 +0000)]
Allow to fold vector load if there is more than one bitcast, so in the case:

%0 = load <8 x i16>* %dest
%1 = shufflevector <8 x i16> %0, <8 x i16> %in,
      <8 x i32> < i32 0, i32 1, i32 2, i32 3, i32 13, i32 undef, i32 14, i32 14>
store <8 x i16> %1, <8 x i16>* %dest

We get:
  vmovlpd (%eax), %xmm0, %xmm0

instead of:
  vmovaps (%eax), %xmm1
  vmovsd  %xmm1, %xmm0, %xmm0

No extra test-case is added. I just fixed the existing one
(also it uses FileCheck now).

llvm-svn: 166971

11 years agoLoopVectorize: Update and preserve the dominator tree info.
Nadav Rotem [Mon, 29 Oct 2012 21:52:38 +0000 (21:52 +0000)]
LoopVectorize: Update and preserve the dominator tree info.

llvm-svn: 166970

11 years agoTypo.
Jakub Staszak [Mon, 29 Oct 2012 21:49:46 +0000 (21:49 +0000)]
Typo.

llvm-svn: 166969

11 years agoThis patch solves a problem with passing varargs parameters under the PPC64
Bill Schmidt [Mon, 29 Oct 2012 21:18:16 +0000 (21:18 +0000)]
This patch solves a problem with passing varargs parameters under the PPC64
ELF ABI.

A varargs parameter consisting of a single-precision floating-point value,
or of a single-element aggregate containing a single-precision floating-point
value, must be passed in the low-order (rightmost) four bytes of the
doubleword stack slot reserved for that parameter.  If there are GPR protocol
registers remaining, the parameter must also be mirrored in the low-order
four bytes of the reserved GPR.

Prior to this patch, such parameters were being passed in the high-order
four bytes of the stack slot and the mirrored GPR.

The patch adds a new test case to verify the correct code generation.

llvm-svn: 166968

11 years ago<rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it does...
Enrico Granata [Mon, 29 Oct 2012 21:18:03 +0000 (21:18 +0000)]
<rdar://problem/11449953> Change Debugger::SetOutputFileHandle() so that it does not automatically initialize the script interpreter in order to transfer its output file handle to it
This should delay initialization of Python until strictly necessary and speed-up debugger startup
Also, convert formatters for SEL and BOOL ObjC data-types from Python to C++, in order to reap more performance benefits from the above changes

llvm-svn: 166967

11 years agoConsistently declare 'extern "C"' variable in namespace __ubsan. No functionality...
Richard Smith [Mon, 29 Oct 2012 21:01:59 +0000 (21:01 +0000)]
Consistently declare 'extern "C"' variable in namespace __ubsan. No functionality change.

llvm-svn: 166966

11 years agoDon't define an extern "C" variable in its first declaration, to appease a
Richard Smith [Mon, 29 Oct 2012 20:54:34 +0000 (20:54 +0000)]
Don't define an extern "C" variable in its first declaration, to appease a
bogus gcc warning. Take this opportunity to move the declaration to the header,
since it's part of the API of this file.

llvm-svn: 166965

11 years ago<rdar://problem/12500785>
Greg Clayton [Mon, 29 Oct 2012 20:52:08 +0000 (20:52 +0000)]
<rdar://problem/12500785>

I tracked down a leak that could happen when detaching from a process where the lldb_private::Process objects would stay around forever. This was caused by a eStateDetached event that was queued up on the lldb_private::Process private state thread listener. Since process events contain shared pointers to the process, this is dangerous if they don't get consume or cleared as having the lldb_private::Process class contain a collection of things that have a shared pointer to yourself is obviously bad.

To fix this I modified the Process::Finalize() function to clear this list. The actual thing that was holding onto the ModuleSP and thus the static archive, was a stack frame. Since the process wasn't going away, it still had thread objects and they still had frames. I modified the Thread::Destroy() to clear the stack frames to ensure this further doesn't happen.

llvm-svn: 166964

11 years agoAdd mips64-* and mips64el-* triples to configure scripts
Simon Atanasyan [Mon, 29 Oct 2012 19:49:45 +0000 (19:49 +0000)]
Add mips64-* and mips64el-* triples to configure scripts
as valid triples denote  Mips target.

llvm-svn: 166961

11 years agoImplement patterns for extloadi8 and extloadi16
Reed Kotler [Mon, 29 Oct 2012 19:39:04 +0000 (19:39 +0000)]
Implement patterns for extloadi8 and extloadi16

llvm-svn: 166960

11 years agoFix an incorrect comment...
Jim Ingham [Mon, 29 Oct 2012 19:24:56 +0000 (19:24 +0000)]
Fix an incorrect comment...

llvm-svn: 166959

11 years agoIn various places throughout the code generator, there were special
Ulrich Weigand [Mon, 29 Oct 2012 18:35:49 +0000 (18:35 +0000)]
In various places throughout the code generator, there were special
checks to avoid performing compile-time arithmetic on PPCDoubleDouble.

Now that APFloat supports arithmetic on PPCDoubleDouble, those checks
are no longer needed, and we can treat the type like any other.

llvm-svn: 166958

11 years agoRevert commit r166946
Quentin Colombet [Mon, 29 Oct 2012 18:28:57 +0000 (18:28 +0000)]
Revert commit r166946

llvm-svn: 166957

11 years agoPartially roll back r166898; it exposed a bug in the standard.
Richard Smith [Mon, 29 Oct 2012 18:26:47 +0000 (18:26 +0000)]
Partially roll back r166898; it exposed a bug in the standard.

The problem is as follows: C++11 has contexts which are not
potentially-evaluated, and yet in which we are required or encouraged to
perform constant evaluation. In such contexts, we are not permitted to
implicitly define special member functions for literal types, therefore
we cannot evalaute those constant expressions.

Punt on this in one more context for now by skipping checking constexpr
variable initializers if they occur in dependent contexts.

llvm-svn: 166956

11 years agoAPFloat cleanup: Remove now unused "arithmeticOK" logic.
Ulrich Weigand [Mon, 29 Oct 2012 18:18:44 +0000 (18:18 +0000)]
APFloat cleanup: Remove now unused "arithmeticOK" logic.

llvm-svn: 166954

11 years agoRemove redundant test case from r166949, per Eli's suggestion.
Chad Rosier [Mon, 29 Oct 2012 18:18:26 +0000 (18:18 +0000)]
Remove redundant test case from r166949, per Eli's suggestion.

llvm-svn: 166953

11 years agoAPFloat cleanup: Remove now unused fields "sign2" and "exponent2".
Ulrich Weigand [Mon, 29 Oct 2012 18:17:42 +0000 (18:17 +0000)]
APFloat cleanup: Remove now unused fields "sign2" and "exponent2".

llvm-svn: 166952

11 years agoImplement arithmetic on APFloat with PPCDoubleDouble semantics by
Ulrich Weigand [Mon, 29 Oct 2012 18:09:01 +0000 (18:09 +0000)]
Implement arithmetic on APFloat with PPCDoubleDouble semantics by
treating it as if it were an IEEE floating-point type with 106-bit
mantissa.

This makes compile-time arithmetic on "long double" for PowerPC
in clang (in particular parsing of floating point constants)
work, and fixes all "long double" related failures in the test
suite.

llvm-svn: 166951

11 years agoImprove the broadcast event dumping.
Greg Clayton [Mon, 29 Oct 2012 18:08:18 +0000 (18:08 +0000)]
Improve the broadcast event dumping.

llvm-svn: 166950

11 years ago[ms-inline asm] Add support for the [] operator. Essentially, [expr1][expr2] is
Chad Rosier [Mon, 29 Oct 2012 18:01:54 +0000 (18:01 +0000)]
[ms-inline asm] Add support for the [] operator.  Essentially, [expr1][expr2] is
equivalent to [expr1 + expr2].  See test cases for more examples.
rdar://12470392

llvm-svn: 166949

11 years agoRename the BB-vectorize flag to match the dragonegg name
Nadav Rotem [Mon, 29 Oct 2012 18:01:14 +0000 (18:01 +0000)]
Rename the BB-vectorize flag to match the dragonegg name

llvm-svn: 166948

11 years agoFix PR14204
Michael Liao [Mon, 29 Oct 2012 17:57:12 +0000 (17:57 +0000)]
Fix PR14204

- Add missing pattern on X86ISD::VZEXT from VR256 to VR256 when AVX2 is enabled.

llvm-svn: 166947

11 years agoMake forcesizeopt attribute available to the end user
Quentin Colombet [Mon, 29 Oct 2012 17:56:23 +0000 (17:56 +0000)]
Make forcesizeopt attribute available to the end user

llvm-svn: 166946

11 years agoFix typo
Joerg Sonnenberger [Mon, 29 Oct 2012 17:56:15 +0000 (17:56 +0000)]
Fix typo

llvm-svn: 166945

11 years agoCompletely disallow partial copies in adjustCopiesBackFrom().
Jakob Stoklund Olesen [Mon, 29 Oct 2012 17:51:52 +0000 (17:51 +0000)]
Completely disallow partial copies in adjustCopiesBackFrom().

Partial copies can show up even when CoalescerPair.isPartial() returns
false. For example:

   %vreg24:dsub_0<def> = COPY %vreg31:dsub_0; QPR:%vreg24,%vreg31

Such a partial-partial copy is not good enough for the transformation
adjustCopiesBackFrom() needs to do.

llvm-svn: 166944

11 years agoAllow i32/i64 for 'f' constraint on PowerPC.
Ulrich Weigand [Mon, 29 Oct 2012 17:49:34 +0000 (17:49 +0000)]
Allow i32/i64 for 'f' constraint on PowerPC.
This fixes PR12757.

llvm-svn: 166943

11 years ago-Warc-repeated-use-of-weak: allow single reads in loops from local variables.
Jordan Rose [Mon, 29 Oct 2012 17:46:47 +0000 (17:46 +0000)]
-Warc-repeated-use-of-weak: allow single reads in loops from local variables.

Previously, the warning would erroneously fire on this:

for (Test *a in someArray)
  use(a.weakProp);

...because it looks like the same property is being accessed over and over.
However, clearly this is not the case. We now ignore loops like this for
local variables, but continue to warn if the base object is a parameter,
global variable, or instance variable, on the assumption that these are
not repeatedly usually assigned to within loops.

Additionally, do-while loops where the condition is 'false' are not really
loops at all; usually they're just used for semicolon-swallowing macros or
using "break" like "goto".

<rdar://problem/12578785&12578849>

llvm-svn: 166942

11 years ago[analyzer] New option to not suppress null return paths if an argument is null.
Jordan Rose [Mon, 29 Oct 2012 17:31:59 +0000 (17:31 +0000)]
[analyzer] New option to not suppress null return paths if an argument is null.

Our one basic suppression heuristic is to assume that functions do not
usually return NULL. However, when one of the arguments is NULL it is
suddenly much more likely that NULL is a valid return value. In this case,
we don't suppress the report here, but we do attach /another/ visitor to
go find out if this NULL argument also comes from an inlined function's
error path.

This new behavior, controlled by the 'avoid-suppressing-null-argument-paths'
analyzer-config option, is turned off by default. Turning it on produced
two false positives and no new true positives when running over LLVM/Clang.

This is one of the possible refinements to our suppression heuristics.
<rdar://problem/12350829>

llvm-svn: 166941

11 years ago[analyzer] Use the CallEnter node to get a value for tracked null arguments.
Jordan Rose [Mon, 29 Oct 2012 17:31:53 +0000 (17:31 +0000)]
[analyzer] Use the CallEnter node to get a value for tracked null arguments.

Additionally, don't collect PostStore nodes -- they are often used in
path diagnostics.

Previously, we tried to track null arguments in the same way as any other
null values, but in many cases the necessary nodes had already been
collected (a memory optimization in ExplodedGraph). Now, we fall back to
using the value of the argument at the time of the call, which may not
always match the actual contents of the region, but often will.

This is a precursor to improving our suppression heuristic.
<rdar://problem/12350829>

llvm-svn: 166940

11 years agoRemove a wrapper around getIntPtrType added to GVN by Hal in commit 166624 (the
Duncan Sands [Mon, 29 Oct 2012 17:31:46 +0000 (17:31 +0000)]
Remove a wrapper around getIntPtrType added to GVN by Hal in commit 166624 (the
wrapper returns a vector of integers when passed a vector of pointers) by having
getIntPtrType itself return a vector of integers in this case.  Outside of this
wrapper, I didn't find anywhere in the codebase that was relying on the old
behaviour for vectors of pointers, so give this a whirl through the buildbots.

llvm-svn: 166939

11 years agoRemove code to saturate profile counts.
Bob Wilson [Mon, 29 Oct 2012 17:27:39 +0000 (17:27 +0000)]
Remove code to saturate profile counts.

We may need to change the way profile counter values are stored, but
saturation is the wrong thing to do.  Just remove it for now.

Patch by Alastair Murray!

llvm-svn: 166938

11 years agoChange the PassManagerBuilder (used by -O3) loop vectorizer flag from -vectorize...
Nadav Rotem [Mon, 29 Oct 2012 16:36:25 +0000 (16:36 +0000)]
Change the PassManagerBuilder (used by -O3) loop vectorizer flag from -vectorize to -vectorize-loops because we dont want to share the same flag as the bb-vectorizer.

llvm-svn: 166937

11 years agoMinor style fixes for TargetTransformationInfo and TargetTransformImpl
Hans Wennborg [Mon, 29 Oct 2012 16:26:52 +0000 (16:26 +0000)]
Minor style fixes for TargetTransformationInfo and TargetTransformImpl

llvm-svn: 166936

11 years agoExpand all atomic ops for mips16.
Reed Kotler [Mon, 29 Oct 2012 16:16:54 +0000 (16:16 +0000)]
Expand all atomic ops for mips16.

llvm-svn: 166935

11 years agollvm/Config/config.h.cmake: Good bye, Kevin! We won't honor authors in comments.
NAKAMURA Takumi [Mon, 29 Oct 2012 16:07:28 +0000 (16:07 +0000)]
llvm/Config/config.h.cmake: Good bye, Kevin! We won't honor authors in comments.

llvm-svn: 166934

11 years agoPPCSubtarget.h: Add explicit braces.
NAKAMURA Takumi [Mon, 29 Oct 2012 15:51:42 +0000 (15:51 +0000)]
PPCSubtarget.h: Add explicit braces.

llvm-svn: 166932

11 years agoPPCSubtarget.h: Whitespace.
NAKAMURA Takumi [Mon, 29 Oct 2012 15:51:35 +0000 (15:51 +0000)]
PPCSubtarget.h: Whitespace.

llvm-svn: 166931

11 years agoThis patch addresses a problem with the Post RA scheduler generating an
Preston Gurd [Mon, 29 Oct 2012 15:01:23 +0000 (15:01 +0000)]
This patch addresses a problem with the Post RA scheduler generating an
incorrect instruction sequence due to it not being aware that an
inline assembly instruction may reference memory.

This patch fixes the problem by causing the scheduler to always assume that any
inline assembly code instruction could access memory. This is necessary because
the internal representation of the inline instruction does not include
any information about memory accesses.

This should fix PR13504.

llvm-svn: 166929

11 years agoThis patch adds alignment information for long double to the 64-bit PowerPC
Bill Schmidt [Mon, 29 Oct 2012 14:59:36 +0000 (14:59 +0000)]
This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing logic is used as a fallback to avoid any changes to the Darwin
ABI.  PPC64 ELF now has two possible data layout strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in Clang, which I am committing now as well.

llvm-svn: 166928

11 years agoThis patch adds alignment information for long double to the 64-bit PowerPC
Bill Schmidt [Mon, 29 Oct 2012 14:59:24 +0000 (14:59 +0000)]
This patch adds alignment information for long double to the 64-bit PowerPC
ELF subtarget.

The existing description string is moved from PPC64TargetInfo to its
DarwinTargetInfo subclass, to avoid any changes to the Darwin ABI.
PPC64TargetInfo now has two possible description strings: one for FreeBSD,
which requires 8-byte alignment, and a default string that requires
16-byte alignment.

I've added a test for PPC64 Linux to verify the 16-byte alignment.  If
somebody wants to add a separate test for FreeBSD, that would be great.

Note that there is a companion patch to update the alignment information
in LLVM, which I am committing now as well.

llvm-svn: 166927

11 years agoFactorize code: rather than duplication the logic in getPointerTypeSizeInBits,
Duncan Sands [Mon, 29 Oct 2012 14:30:05 +0000 (14:30 +0000)]
Factorize code: rather than duplication the logic in getPointerTypeSizeInBits,
just call getPointerTypeSizeInBits.  No functionality change.

llvm-svn: 166926

11 years agoLoads and stores without an explicit alignment use the abi alignment not the
Duncan Sands [Mon, 29 Oct 2012 14:12:44 +0000 (14:12 +0000)]
Loads and stores without an explicit alignment use the abi alignment not the
preferred alignment.  Correct the documentation.

llvm-svn: 166925

11 years agoHandle '*' and '#' asm constraint modifiers.
Ulrich Weigand [Mon, 29 Oct 2012 12:20:54 +0000 (12:20 +0000)]
Handle '*' and '#' asm constraint modifiers.

llvm-svn: 166924

11 years agoRather than duplicating the getPointerSize code just call getPointerSize.
Duncan Sands [Mon, 29 Oct 2012 12:19:04 +0000 (12:19 +0000)]
Rather than duplicating the getPointerSize code just call getPointerSize.

llvm-svn: 166923

11 years agoSilence a GCC warning about comparing signed and unsigned types.
Duncan Sands [Mon, 29 Oct 2012 11:29:53 +0000 (11:29 +0000)]
Silence a GCC warning about comparing signed and unsigned types.

llvm-svn: 166922

11 years agoFix ASTMatchersTests to not create an overloaded-virtual warning.
Daniel Jasper [Mon, 29 Oct 2012 10:48:25 +0000 (10:48 +0000)]
Fix ASTMatchersTests to not create an overloaded-virtual warning.

llvm-svn: 166921

11 years agoAlign the data section correctly when loading an ELF file.
Tim Northover [Mon, 29 Oct 2012 10:47:07 +0000 (10:47 +0000)]
Align the data section correctly when loading an ELF file.

Patch by Amara Emerson.

llvm-svn: 166920

11 years agoMake use of common-symbol alignment info in ELF loader.
Tim Northover [Mon, 29 Oct 2012 10:47:04 +0000 (10:47 +0000)]
Make use of common-symbol alignment info in ELF loader.

Patch by Amara Emerson.

llvm-svn: 166919

11 years agoAdd interface for querying object files for symbol values.
Tim Northover [Mon, 29 Oct 2012 10:47:00 +0000 (10:47 +0000)]
Add interface for querying object files for symbol values.

Currently only implemented for ELF.

Patch by Amara Emerson.

llvm-svn: 166918

11 years agoImplement has(), hasDescendant(), forEach() and forEachDescendant() for
Daniel Jasper [Mon, 29 Oct 2012 10:14:44 +0000 (10:14 +0000)]
Implement has(), hasDescendant(), forEach() and forEachDescendant() for
Types, QualTypes and TypeLocs.

Review: http://llvm-reviews.chandlerc.com/D83
llvm-svn: 166917

11 years agova_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.
Evgeniy Stepanov [Mon, 29 Oct 2012 09:39:03 +0000 (09:39 +0000)]
va_start, va_end, va_copy: InstrinsicInst subclasses and InstVisitor support.

llvm-svn: 166916

11 years agoRemove spurious mode marker from .cpp file.
Nick Lewycky [Mon, 29 Oct 2012 06:05:01 +0000 (06:05 +0000)]
Remove spurious mode marker from .cpp file.

llvm-svn: 166915

11 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:03:58 +0000 (06:03 +0000)]
Add missing emacs major mode marker.

llvm-svn: 166914

11 years agoFix name of this file.
Nick Lewycky [Mon, 29 Oct 2012 06:03:40 +0000 (06:03 +0000)]
Fix name of this file.

llvm-svn: 166913

11 years agoAdd missing emacs major mode marker.
Nick Lewycky [Mon, 29 Oct 2012 06:02:59 +0000 (06:02 +0000)]
Add missing emacs major mode marker.

llvm-svn: 166912

11 years agoCalling TLI->getNumRegisters creates a circular dependency when building LLVM using...
Nadav Rotem [Mon, 29 Oct 2012 05:28:35 +0000 (05:28 +0000)]
Calling TLI->getNumRegisters creates a circular dependency when building LLVM using cmake.

Get the number of registers by calling getTypeLegalizationCost.

PR14199.

llvm-svn: 166911

11 years agoRemove unused typedef.
Lang Hames [Mon, 29 Oct 2012 04:57:52 +0000 (04:57 +0000)]
Remove unused typedef.

llvm-svn: 166910

11 years agoAdd -alias and -ralias options to match what we have for functions and
Rafael Espindola [Mon, 29 Oct 2012 02:23:07 +0000 (02:23 +0000)]
Add -alias and -ralias options to match what we have for functions and
globals.

llvm-svn: 166909

11 years agollvm-extract changes linkages so that functions on both sides of the
Rafael Espindola [Mon, 29 Oct 2012 01:59:03 +0000 (01:59 +0000)]
llvm-extract changes linkages so that functions on both sides of the
split module can see each other. If it is keeping a symbol that already has
a non local linkage, it doesn't need to change it.

llvm-svn: 166908

11 years agollvm-extract was unable to handle aliases. It would leave a copy on the
Rafael Espindola [Mon, 29 Oct 2012 00:27:55 +0000 (00:27 +0000)]
llvm-extract was unable to handle aliases. It would leave a copy on the
output of both

llvm-extract foo.ll -func=bar
and
llvm-extract foo.ll -func=bar -delete

so the two new files could not be linked together anymore. With this change
alias are handled almost like functions and global variables. Almost because
with alias we cannot just clear the initializer/body, we have to create a new
declaration and replace the alias with it.

The net result is that now the output of the above commands can be linked
even if foo.ll has aliases.

llvm-svn: 166907

11 years agoImplement brind operator for mips16.
Reed Kotler [Sun, 28 Oct 2012 23:08:07 +0000 (23:08 +0000)]
Implement brind operator for mips16.

llvm-svn: 166903

11 years agoRemove TargetELFWriterInfo.
Rafael Espindola [Sun, 28 Oct 2012 21:34:43 +0000 (21:34 +0000)]
Remove TargetELFWriterInfo.
All the credit goes to Jan Voung for noticing it was dead!

llvm-svn: 166902

11 years agoimprove highlighting of invalid string encodings
Seth Cantrell [Sun, 28 Oct 2012 18:24:46 +0000 (18:24 +0000)]
improve highlighting of invalid string encodings

limit highlight to exactly the bad encoding, and highlight every
bad encoding in a string.

llvm-svn: 166900

11 years agoRevert functional part of r166896 and just suppress -Wunneeded-internal-declaration...
Richard Smith [Sun, 28 Oct 2012 07:39:29 +0000 (07:39 +0000)]
Revert functional part of r166896 and just suppress -Wunneeded-internal-declaration for reference types for now. This needs more work; the cases we currently miss are a bit random.

llvm-svn: 166899

11 years agoWhen determining whether to try evaluating the initializer of a variable, check
Richard Smith [Sun, 28 Oct 2012 06:18:02 +0000 (06:18 +0000)]
When determining whether to try evaluating the initializer of a variable, check
whether the initializer is value-dependent rather than whether we are in a
dependent context. This allows us to detect some errors sooner, and fixes a
crash-on-invalid if a dependent type leaks out to a non-dependent context in
error recovery.

llvm-svn: 166898

11 years agoThis patch is for the implementation of mips16 complex pattern addr16.
Reed Kotler [Sun, 28 Oct 2012 06:02:37 +0000 (06:02 +0000)]
This patch is for the implementation of mips16 complex pattern addr16.
Previously mips16 was sharing the pattern addr which is used for mips32
and mips64. This had a number of problems:
1) Storing and loading byte and halfword quantities for mips16 has particular
problems due to the primarily non mips16 nature of SP. When we must
load/store byte/halfword stack objects in a function, we must create a mips16
alias register for SP. This functionality is tested in stchar.ll.
2) We need to have an FP register under certain conditions (such as
dynamically sized alloca). We use mips16 register S0 for this purpose.
In this case, we also use this register when accessing frame objects so this
issue also affects the complex pattern addr16. This functionality is
tested in alloca16.ll.

The Mips16InstrInfo.td has been updated to use addr16 instead of addr.

The complex pattern C++ function for addr has been copied to addr16 and
updated to reflect the above issues.

llvm-svn: 166897

11 years agoIn -Wunneeded-internal-declaration, suppress the warning for variables which
Richard Smith [Sun, 28 Oct 2012 04:47:21 +0000 (04:47 +0000)]
In -Wunneeded-internal-declaration, suppress the warning for variables which
might have been used in constant expressions, rather than suppressing it for
variables which are const. The important thing here is that such variables
can have their values used without actually being marked as 'used'.

llvm-svn: 166896

11 years agoFix invalid jump scopes again. This time without trying to find out if an
Rafael Espindola [Sun, 28 Oct 2012 02:44:03 +0000 (02:44 +0000)]
Fix invalid jump scopes again. This time without trying to find out if an
incomplete type has a destructor or not.

llvm-svn: 166895

11 years agoAdd a testcase from the previous bootstrap problem.
Rafael Espindola [Sun, 28 Oct 2012 02:25:27 +0000 (02:25 +0000)]
Add a testcase from the previous bootstrap problem.

llvm-svn: 166894

11 years agoFix crash on missing namespace name in namespace alias definition -- PR14085.
Nico Weber [Sat, 27 Oct 2012 23:44:27 +0000 (23:44 +0000)]
Fix crash on missing namespace name in namespace alias definition -- PR14085.

Patch from Brian Brooks <brooks.brian@gmail.com>!

llvm-svn: 166893

11 years agoobjective-C arc/mrr: Patch for the new block variable layout meta-data.
Fariborz Jahanian [Sat, 27 Oct 2012 21:10:38 +0000 (21:10 +0000)]
objective-C arc/mrr: Patch for the new block variable layout meta-data.
It is currently off (so no tests). This is wip.

llvm-svn: 166892

11 years agoCurrently the initial value of Tok is dependent an the stack contents
Chris Lattner [Sat, 27 Oct 2012 19:49:20 +0000 (19:49 +0000)]
Currently the initial value of Tok is dependent an the stack contents
and could cause the Parser to crash on the first ConsumeToken().

Patcy by Bas van den Berg!

llvm-svn: 166891

11 years agoNever attempt to join an early-clobber def with a regular kill.
Jakob Stoklund Olesen [Sat, 27 Oct 2012 17:41:27 +0000 (17:41 +0000)]
Never attempt to join an early-clobber def with a regular kill.

This fixes PR14194.

llvm-svn: 166880

11 years agoRevert 166876 while I debug a bootstrap problem.
Rafael Espindola [Sat, 27 Oct 2012 16:49:47 +0000 (16:49 +0000)]
Revert 166876 while I debug a bootstrap problem.

llvm-svn: 166878

11 years agoLoopIdiom: Add checks to avoid turning memmove into an infinite loop.
Benjamin Kramer [Sat, 27 Oct 2012 15:18:28 +0000 (15:18 +0000)]
LoopIdiom: Add checks to avoid turning memmove into an infinite loop.

I don't think this is possible with the current implementation but that may change eventually.

llvm-svn: 166877

11 years agoReapply 166855 with an early exit on null QualTypes.
Rafael Espindola [Sat, 27 Oct 2012 14:56:08 +0000 (14:56 +0000)]
Reapply 166855 with an early exit on null QualTypes.

llvm-svn: 166876

11 years agoLoopIdiom: Recognize memmove loops.
Benjamin Kramer [Sat, 27 Oct 2012 14:25:51 +0000 (14:25 +0000)]
LoopIdiom: Recognize memmove loops.

This turns loops like
  for (unsigned i = 0; i != n; ++i)
    p[i] = p[i+1];
into memmove, which has a highly optimized implementation in most libcs.

This was really easy with the new DependenceAnalysis :)

llvm-svn: 166875

11 years agoLoopIdiom: Replace custom dependence analysis with DependenceAnalysis.
Benjamin Kramer [Sat, 27 Oct 2012 14:25:44 +0000 (14:25 +0000)]
LoopIdiom: Replace custom dependence analysis with DependenceAnalysis.

Requires a lot less code and complexity on loop-idiom's side and the more
precise analysis can catch more cases, like the one I included as a test case.
This also fixes the edge-case miscompilation from PR9481.

Compile time performance seems to be slightly worse, but this is mostly due
to an extra LCSSA run scheduled by the PassManager and should be fixed there.

llvm-svn: 166874

11 years agoSCEV validator: Ignore CouldNotCompute/undef on both sides. This is mostly noise...
Benjamin Kramer [Sat, 27 Oct 2012 11:36:07 +0000 (11:36 +0000)]
SCEV validator: Ignore CouldNotCompute/undef on both sides. This is mostly noise and blocks finding more severe bugs.

llvm-svn: 166873

11 years agoSCEV validator: Add workarounds for some common false positives due to the way it...
Benjamin Kramer [Sat, 27 Oct 2012 10:45:01 +0000 (10:45 +0000)]
SCEV validator: Add workarounds for some common false positives due to the way it handles strings.

llvm-svn: 166872

11 years agoReverted back the changes made in 166868 and in 166869
Mahesha S [Sat, 27 Oct 2012 10:44:42 +0000 (10:44 +0000)]
Reverted back the changes made in 166868 and in 166869

llvm-svn: 166871

11 years agoClarify that there is an option other than OAuth for Phabricator and
Chandler Carruth [Sat, 27 Oct 2012 09:47:33 +0000 (09:47 +0000)]
Clarify that there is an option other than OAuth for Phabricator and
offer up my email to the spam lords for it. Hopefully this will
eventually be more automatic, but we don't want people to think there is
only one option.

llvm-svn: 166870

11 years agoFeature:
Mahesha S [Sat, 27 Oct 2012 09:05:45 +0000 (09:05 +0000)]
Feature:
  OpenMP support.

Sub-Feature:
  Support for "#pragma omp ..." registration with
  Preprocessor.

Files Changed/Added:
  * include/clang/Basic/DiagnosticGroups.td (C)
  * include/clang/Basic/DiagnosticParseKinds.td (C)
  * include/clang/Basic/TokenKinds.def (C)
  * include/clang/Parse/Parser.h (C)
  * lib/Parse/Parser.cpp (C)

Test Cases Changed/Added:
  * test/Preprocessor/pragma_omp.c (A)
  * test/Preprocessor/pragma_omp_ignored_warning.c (A)

llvm-svn: 166869

11 years ago-------------------------------------------------
Mahesha S [Sat, 27 Oct 2012 07:47:56 +0000 (07:47 +0000)]
-------------------------------------------------
Feature:
  OpenMP support in CLANG:

Sub-Feature:
  Support for option -fopenmp

Files Changed/Added:
  * include/clang/Driver/Options.td (C)
  * include/clang/Basic/LangOptions.def (C)
  * lib/Driver/Tools.cpp (C)
  * lib/Frontend/CompilerInvocation.cpp (C)

Test Cases Changed/Added:
  * test/Driver/clang_fopenmp_opt.c (A)
-------------------------------------------------

llvm-svn: 166868

11 years agoRemoved an extra blank line.
Mahesha S [Sat, 27 Oct 2012 07:23:58 +0000 (07:23 +0000)]
Removed an extra blank line.

llvm-svn: 166867

11 years agoAdd a reduced testcase of the last bootstrap failure.
Rafael Espindola [Sat, 27 Oct 2012 04:54:49 +0000 (04:54 +0000)]
Add a reduced testcase of the last bootstrap failure.

llvm-svn: 166866

11 years agoUpdate BBVectorize to use the new VTTI instr. cost interfaces.
Hal Finkel [Sat, 27 Oct 2012 04:33:48 +0000 (04:33 +0000)]
Update BBVectorize to use the new VTTI instr. cost interfaces.

The monolithic interface for instruction costs has been split into
several functions. This is the corresponding change. No functionality
change is intended.

llvm-svn: 166865

11 years ago1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to return...
Nadav Rotem [Sat, 27 Oct 2012 04:11:32 +0000 (04:11 +0000)]
1. Fix a bug in getTypeConversion. When a *simple* type is split, we need to return the type of the split result.
2. Change the maximum vectorization width from 4 to 8.
3. A test for both.

llvm-svn: 166864

11 years agoRevert r166855. I can reproduce the bootstrap failure and have a testcase
Rafael Espindola [Sat, 27 Oct 2012 03:06:02 +0000 (03:06 +0000)]
Revert r166855. I can reproduce the bootstrap failure and have a testcase
to reduce.

llvm-svn: 166863

11 years agoThis is the first phase of supporting the DW_AT_object_pointer tag. I expanded the...
Jim Ingham [Sat, 27 Oct 2012 02:54:13 +0000 (02:54 +0000)]
This is the first phase of supporting the DW_AT_object_pointer tag.  I expanded the decl metadata
so it could hold this information, and then used it to look up unfound names in the object pointer
if it exists.  This gets "frame var" to work for unqualified references to ivars captured in blocks.
But the expression parser is ignoring this information still.

llvm-svn: 166860

11 years agoIf we got what looks like a single step exception but we weren't single stepping...
Jim Ingham [Sat, 27 Oct 2012 02:52:04 +0000 (02:52 +0000)]
If we got what looks like a single step exception but we weren't single stepping then just report
the raw exception.

llvm-svn: 166859

11 years agoAdd a test case for the stack overflow in rdar://12542261
Argyrios Kyrtzidis [Sat, 27 Oct 2012 02:13:28 +0000 (02:13 +0000)]
Add a test case for the stack overflow in rdar://12542261

llvm-svn: 166858