Commit Graph

120997 Commits

Author SHA1 Message Date
Jakob Stoklund Olesen fc9dce25f7 Handle call-clobbered ymm registers on Win64.
The Win64 calling convention has xmm6-15 as callee-saved while still
clobbering all ymm registers.

Add a YMM_HI_6_15 pseudo-register that aliases the clobbered part of the
ymm registers, and mark that as call-clobbered.  This allows live xmm
registers across calls.

This hack wouldn't be necessary with RegisterMask operands representing
the call clobbers, but they are not quite operational yet.

llvm-svn: 149088
2012-01-26 22:59:28 +00:00
Joerg Sonnenberger d64c60e534 Remove the ToolTriple logic in NetBSD, which was completely broken by
the recent refactoring. All interesting NetBSD release have a GNU as
version on i386 that supports --32, so don't bother with the conditional
setting of it.

llvm-svn: 149087
2012-01-26 22:27:52 +00:00
Bob Wilson a7a61e2701 Make clz/ctz builtins defined for zero on ARM targets. rdar://10732455
ARM supports clz and ctz directly and both operations have well-defined
results for zero.  There is no disadvantage in performance to using the
defined-at-zero versions of llvm.ctlz/cttz intrinsics.  We're running into
ARM-specific code written with the assumption that __builtin_clz(0) == 32,
even though that value is technically undefined.  The code is failing now
because of llvm optimizations that are taking advantage of the undef
behavior (specifically svn r147255).  There's nothing wrong with that
optimization on x86 where any incorrect assumptions about __builtin_clz(0)
will quickly be exposed.  For ARM, though, optimizations based on that undef
behavior are likely to cause subtle bugs.  Other targets with defined-at-zero
clz/ctz support may want to override the default behavior as well.

llvm-svn: 149086
2012-01-26 22:14:27 +00:00
Eric Christopher 6a6a30d555 Use -H on darwin as well.
Patch by Liang Wang!

llvm-svn: 149085
2012-01-26 22:06:23 +00:00
Joerg Sonnenberger f8ce8575aa Remove obviously incorrect branch.
llvm-svn: 149084
2012-01-26 21:58:37 +00:00
Joerg Sonnenberger 91960f4abb Keep track of the original target the user specified before
normalization. This used to be captured in DefaultTargetTriple and is
used for the (optional) $triple-$tool lookup for cross-compilation.
Do this properly by making it an attribute of the toolchain and use it
in combination with the computed triple as index for the toolchain
lookup.

llvm-svn: 149083
2012-01-26 21:56:28 +00:00
Chris Lattner 61a1d6cb81 progress making the world safe to ConstantDataVector. While
we're at it, allow PatternMatch's "neg" pattern to match integer
vector negations, and enhance ComputeNumSigned bits to handle
shl of vectors.

llvm-svn: 149082
2012-01-26 21:37:55 +00:00
Ted Kremenek 49b1e38e4b Change references to 'const ProgramState *' to typedef 'ProgramStateRef'.
At this point this is largely cosmetic, but it opens the door to replace
ProgramStateRef with a smart pointer that more eagerly acts in the role
of reclaiming unused ProgramState objects.

llvm-svn: 149081
2012-01-26 21:29:00 +00:00
Greg Clayton 6efba4fc97 Fixed formats being able to be applied recursively when using:
target variable -f <format> [args]
frame variable -f <format> [args]
expression -f <format> -- expr

llvm-svn: 149080
2012-01-26 21:08:30 +00:00
Fariborz Jahanian 48fd81b484 objc-arc: introduce -no-finalize-removal which in gc mode,
leaves "finalize' behind and in arc mode, does not
include it. This allows the migrated source to be compiled
in both gc and arc mode. // rdar://10532441

llvm-svn: 149079
2012-01-26 20:57:58 +00:00
Chris Lattner 88fce10928 tidy up forward declarations.
llvm-svn: 149078
2012-01-26 20:44:57 +00:00
Chris Lattner a474bb265b smallvectorize and ArrayRef'ize some stuff.
llvm-svn: 149077
2012-01-26 20:40:56 +00:00
Chris Lattner 37e3835a94 Reduce a lot of code duplication by implementing
ConstantExpr::getWithOperandReplaced and ConstantExpr::replaceUsesOfWithOnConstant
 in terms of ConstantExpr::getWithOperands.  While we're at it,
make sure that ConstantExpr::getWithOperands covers all instructions: it was
missing insert/extractvalue.  

llvm-svn: 149076
2012-01-26 20:37:11 +00:00
Chad Rosier 9b61cf3167 Update comment for r149070.
llvm-svn: 149075
2012-01-26 20:19:05 +00:00
John McCall 18a962bab5 Don't suppress access-control or invalid-type diagnostics from a
declarator just because we were able to build an invalid decl
for it.  The invalid-type diagnostics, in particular, are still useful
to know, and may indicate something about why the decl is invalid.

Also, recover from an illegal pointer/reference-to-unqualified-retainable
type using __strong instead of __autoreleasing;  in general, a random
object is much more likely to be __strong, so this avoids unnecessary
cascading errors in the most common case.

llvm-svn: 149074
2012-01-26 20:04:03 +00:00
Tobias Grosser fc98d453df Remove unneeded default case
This silences a clang warning.

llvm-svn: 149073
2012-01-26 19:53:01 +00:00
Douglas Gregor 35696d1a88 Try harder to get X7 defined
llvm-svn: 149072
2012-01-26 18:38:13 +00:00
Argyrios Kyrtzidis b2e31e4443 Change HasMutableFields to HasOnlyCMembers and consider that a tag inside
another tag does not break C-like-ness. rdar://10756831

llvm-svn: 149071
2012-01-26 18:28:08 +00:00
Chad Rosier 1a1531d65e Replace the use of isPredicable() with isPredicated() in
MachineBasicBlock::canFallThrough().  We're interested in the state of the
instruction (i.e., is this a barrier or not?), not if the instruction is
predicable or not.
rdar://10501092

llvm-svn: 149070
2012-01-26 18:24:25 +00:00
Jakob Stoklund Olesen 8c139a5125 Clear kill flags before propagating a copy.
The live range of the source register may be extended when a redundant
copy is eliminated. Make sure any kill flags between the two copies are
cleared.

This fixes PR11765.

llvm-svn: 149069
2012-01-26 17:52:15 +00:00
Alexander Potapenko fabfcd8bea Darwin-specific templates for the output tests.
These should fix the output tests on Mac.

llvm-svn: 149068
2012-01-26 17:40:18 +00:00
Douglas Gregor 360a66e3d9 Don't separately serialize the list of instance variables in an
Objective-C class. The AST reader just throws away this data anyway!

llvm-svn: 149067
2012-01-26 17:31:14 +00:00
Douglas Gregor e6e5406122 Force layout of more of the unions and structures in this test
llvm-svn: 149066
2012-01-26 17:23:00 +00:00
Fariborz Jahanian 194904e499 objc: 'id' and block pointer compare in mergeTypes is
made symmetrical. // rdar://10734265

llvm-svn: 149065
2012-01-26 17:08:50 +00:00
Alexander Potapenko 02a71626e3 More accurate atos execution which depends on the file type (EXECUTE, DYLIB) of the binary.
More Linux-like output on Mac (to match more output tests).

llvm-svn: 149064
2012-01-26 17:06:50 +00:00
Alexander Potapenko 98f0c713d9 Fix a bug in AsanProcMaps on Mac: on 64 bits the program was trying to read twice as many segment load commands as the binary actually contained.
llvm-svn: 149063
2012-01-26 17:01:20 +00:00
Jim Grosbach c8f2b7877b Tidy up. Fix mismatched return types for error handling.
llvm-svn: 149062
2012-01-26 15:56:45 +00:00
Gabor Greif e0d58d36b2 comment tweaks
llvm-svn: 149060
2012-01-26 10:28:58 +00:00
NAKAMURA Takumi b8efa1e091 AST/ExprConstant.cpp: Silence a warning on ms cl.exe. "bool" does not prefer to be compared to integer.
llvm-svn: 149059
2012-01-26 09:37:36 +00:00
Chandler Carruth d0a41fead3 Suppress any warnings from this test. They aren't interesting, and they
end up in the same output file as the layout stuff. There may even be
a race condition which is causing this output to confuse the FileCheck
in some cases. I actually don't know how on earth the parsing of the
layout file even works given that there are diagnostics in the middle of
it. ;]

llvm-svn: 149058
2012-01-26 09:28:50 +00:00
James Molloy 6685c08e5f Add support for the R_ARM_TARGET1 relocation, which should be given to relocations applied to all C++ constructors and destructors.
This enables the linker to match concrete relocation types (absolute or relative) with whatever library or C++ support code is being linked against.

llvm-svn: 149057
2012-01-26 09:25:43 +00:00
Victor Umansky 5f29b0e57b Fix for the following bug in AVX codegen for double-to-int conversions:
.	"fptosi" and "fptoui" IR instructions are defined with round-to-zero rounding mode.
.	Currently for AVX mode for <4xdouble> and <8xdouble>  the "VCVTPD2DQ.128" and "VCVTPD2DQ.256" instructions are selected (for .fp_to_sint. DAG node operation ) by AVX codegen. However they use round-to-nearest-even rounding mode.
.	Consequently, the conversion produces incorrect numbers.
 
The fix is to replace selection of VCVTPD2DQ instructions with VCVTTPD2DQ instructions. The latter use truncate (i.e. round-to-zero) rounding mode. 
As .fp_to_sint. DAG node operation is used only for lowering of  "fptosi" and "fptoui" IR instructions, the fix in X86InstrSSE.td definition file doesn.t have an impact on other LLVM flows.
 
The patch includes changes in the .td file, LIT test for the changes and a fix in a legacy LIT test (which produced asm code conflicting with LLVN IR spec). 

llvm-svn: 149056
2012-01-26 08:51:39 +00:00
Douglas Gregor e9fc377a44 Extend the ExternalASTSource interface to allow the AST source to
provide the layout of records, rather than letting Clang compute
the layout itself. LLDB provides the motivation for this feature:
because various layout-altering attributes (packed, aligned, etc.)
don't get reliably get placed into DWARF, the record layouts computed
by LLDB from the reconstructed records differ from the actual layouts,
and badness occurs. This interface lets the DWARF data drive layout,
so we don't need the attributes preserved to get the answer write.

The testing methodology for this change is fun. I've introduced a
variant of -fdump-record-layouts called -fdump-record-layouts-simple
that always has the simple C format and provides size/alignment/field
offsets. There is also a -cc1 option -foverride-record-layout=<file>
to take the output of -fdump-record-layouts-simple and parse it to
produce a set of overridden layouts, which is introduced into the AST
via a testing-only ExternalASTSource (called
LayoutOverrideSource). Each test contains a number of records to lay
out, which use various layout-changing attributes, and then dumps the
layouts. We then run the test again, using the preprocessor to
eliminate the layout-changing attributes entirely (which would give us
different layouts for the records), but supplying the
previously-computed record layouts. Finally, we diff the layouts
produced from the two runs to be sure that they are identical.

Note that this code makes the assumption that we don't *have* to
provide the offsets of bases or virtual bases to get the layout right,
because the alignment attributes don't affect it. I believe this
assumption holds, but if it does not, we can extend
LayoutOverrideSource to also provide base offset information.

Fixes the Clang side of <rdar://problem/10169539>.

llvm-svn: 149055
2012-01-26 07:55:45 +00:00
Craig Topper 86e44bc829 Add HasXOP predicate check covering a bunch of XOP intrinsic patterns.
llvm-svn: 149054
2012-01-26 07:51:55 +00:00
Craig Topper 1c0e22f57a Fix AVX vs SSE patterns ordering issue for VPCMPESTRM and VPCMPISTRM.
llvm-svn: 149053
2012-01-26 07:31:30 +00:00
Craig Topper b91760eff8 Remove some more patterns by custom lowering intrinsics to target specific nodes.
llvm-svn: 149052
2012-01-26 07:18:03 +00:00
Eric Christopher f59218e5d9 Use createRecordFwdDecl here since that's what we're doing.
llvm-svn: 149051
2012-01-26 07:11:58 +00:00
Eric Christopher e6a602dfab Revert previous patch as the corresponding clang patch was reverted.
gdb's tests are too dependent upon order in debug info.

llvm-svn: 149050
2012-01-26 07:01:33 +00:00
Eric Christopher 8913bd6c63 Revert previous patch unifying all of the C++ record prep in one area,
the gdb testsuite complains too much about the ordering of items printed,
even if the offsets in the debug info are correct.

This reverts commit 027cb30af828f07750f9185782822297a5c57231.

llvm-svn: 149049
2012-01-26 07:01:04 +00:00
Bob Wilson 853b5ebfd3 Fix a minor bug in r148582, which made -ccc-host-triple into an alias option.
I'm not adding a testcase because -ccc-host-triple is slated to be removed,
but clang crashes if you try to use -ccc-host-triple without this fix.

llvm-svn: 149048
2012-01-26 06:22:30 +00:00
Eric Christopher 5720033cc1 Remove another duplicated variable.
llvm-svn: 149047
2012-01-26 06:20:57 +00:00
Greg Clayton ba728e6d7d Added some clarifications about when the __lldb_init_module would be called
and showed a work around for when this won't.

llvm-svn: 149046
2012-01-26 05:36:07 +00:00
Richard Smith a07ed4addb constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.
llvm-svn: 149045
2012-01-26 04:47:34 +00:00
Argyrios Kyrtzidis 789f373f34 Remove the headers now that ::close() is not used.
llvm-svn: 149044
2012-01-26 04:42:21 +00:00
Argyrios Kyrtzidis 623e8778c1 In FixItRewriteToTemp::RewriteFilename don't try to close the file descriptor
with close(); return it instead.

Fixes mingw build and eliminates possible racing issues.

llvm-svn: 149043
2012-01-26 04:19:04 +00:00
Anna Zaks 60835eb11e [analyzer] The CFContainer test should only be run on x86_64.
llvm-svn: 149042
2012-01-26 04:00:23 +00:00
NAKAMURA Takumi 69ee7d5c52 Rewrite/FrontendActions.cpp: Tweak to unbreak msvc.
llvm-svn: 149041
2012-01-26 03:47:18 +00:00
Bob Wilson 269e6377dd Revert r148249: "Make the auto-detection hack for the iOS simulator set the target triple correctly."
There were some problems with this, so I'm backing it out for now.

llvm-svn: 149040
2012-01-26 03:37:03 +00:00
Peter Collingbourne c331a1eb19 Improve efficiency of Sema::MaybeBindToTemporary by working with the
canonical type directly and adding a fast path for the common case
that the type is directly a RecordType.

llvm-svn: 149039
2012-01-26 03:33:51 +00:00
Peter Collingbourne dad62f1bce Simplify {Record,Enum}Type::classof.
llvm-svn: 149038
2012-01-26 03:33:46 +00:00