Commit Graph

101584 Commits

Author SHA1 Message Date
Richard Smith 59006e4338 Fix a few auto-related issues:
* 'auto' was being rejected on abstract-declarators with trailing return
types and on typedefs with trailing return types. 'auto' is always
allowed in these cases. This was found while testing the fix for PR 9278.

 * A very poor diagnostic was being issued for auto (f() -> int): "return
type must be 'auto', not 'auto'". This is closely related to PR 9060.

 * Trailing return type handling was happening slightly too late,
resulting in the checks for functions returning arrays and functions
returning functions being missed.

llvm-svn: 126166
2011-02-22 00:36:53 +00:00
Rafael Espindola e39062199e Implement xgetbv and xsetbv.
Patch by Jai Menon.

llvm-svn: 126165
2011-02-22 00:35:18 +00:00
Richard Smith e51cb7dedf Add reference to PR 9278 for archaeologists.
llvm-svn: 126164
2011-02-22 00:19:36 +00:00
Eric Christopher 9b48fef478 Revert r125960, it's breaking darwin10 bootstrap.
llvm-svn: 126163
2011-02-21 23:52:19 +00:00
Fariborz Jahanian d7b0cb5388 Warn when type modifiers on objc method declarations in
protocols do not match with method implementation.
// rdar://7076235

llvm-svn: 126162
2011-02-21 23:49:15 +00:00
David Chisnall 055f064756 The instance size of a metaclass should be the size of a class. This is not, in fact, 0, even for very small classes. (GNU runtime)
llvm-svn: 126161
2011-02-21 23:47:40 +00:00
Johnny Chen e69108a78f Add emulation methods for "EOR (Immediate)", "EOR (register)",
"TEQ (immediate)", and "TEQ (register)" operations.

llvm-svn: 126160
2011-02-21 23:42:44 +00:00
Evan Cheng 87a9f19f9c Skipping over debugvalue instructions to determine whether the split spot is in a IT block. rdar://9030770
llvm-svn: 126159
2011-02-21 23:40:47 +00:00
Evan Cheng b8ed462ca2 Add more debugging output.
llvm-svn: 126158
2011-02-21 23:39:48 +00:00
Joerg Sonnenberger 37d5484d18 Handle FK_PCRel_1 and add a test case for this and FK_PCRel_4.
llvm-svn: 126157
2011-02-21 23:25:41 +00:00
Devang Patel f3292b2196 Revert r124611 - "Keep track of incoming argument's location while emitting LiveIns."
In other words, do not keep track of argument's location.  The debugger (gdb) is not prepared to see line table entries for arguments. For the debugger, "second" line table entry marks beginning of function body.
This requires some coordination with debugger to get this working. 
 - The debugger needs to be aware of prolog_end attribute attached with line table entries.
 - The compiler needs to accurately mark prolog_end in line table entries (at -O0 and at -O1+)

llvm-svn: 126155
2011-02-21 23:21:26 +00:00
Richard Smith 27e39b11b1 C++0x's deduced auto is illegal in typedefs.
This actually rules out too much, since it also catches typedefs for pointers to functions with trailing return types:

  typedef auto (*F)() -> int;

Fix for that (and the same issue in all abstract-declarators) to follow shortly.

llvm-svn: 126153
2011-02-21 23:18:00 +00:00
Daniel Dunbar 13adc7fefd Targets/Darwin: mcount name on Darwin needs to be unmangled.
llvm-svn: 126152
2011-02-21 23:12:51 +00:00
Jakob Stoklund Olesen 60a26a6578 Add SplitKit::isOriginalEndpoint and use it to force live range splitting to terminate.
An original endpoint is an instruction that killed or defined the original live
range before any live ranges were split.

When splitting global live ranges, avoid creating local live ranges without any
original endpoints. We may still create global live ranges without original
endpoints, but such a range won't be split again, and live range splitting still
terminates.

llvm-svn: 126151
2011-02-21 23:09:46 +00:00
Ted Kremenek 828f631af1 Fix a CFGBuilder bug exposed on convoluted control-flow in the Linux kernel.
llvm-svn: 126149
2011-02-21 22:11:26 +00:00
Chris Lattner 93ede02045 add one more case of mismatched input/output constraints.
When the mismatch is due to a larger input operand that is
a constant, truncate it down to the size of the output.  This
allows us to accept some cases in the linux kernel and elsewhere.
Pedantically speaking, we generate different code than GCC, though
I can't imagine how it would matter:

Clang:
	movb	$-1, %al
	frob %al

GCC:

	movl	$255, %eax
	frob %al

llvm-svn: 126148
2011-02-21 22:09:29 +00:00
Sean Callanan 5e8603d1b9 Fixed a bug in the X86 disassembler where a member of the
X86 instruction decode structure was being interpreted as
being in units of bits, although it is actually stored in
units of bytes.

llvm-svn: 126147
2011-02-21 21:55:05 +00:00
Chris Lattner e3694b166a more code restructuring, no functionality change.
llvm-svn: 126146
2011-02-21 21:50:25 +00:00
Chris Lattner 70a4e9b5e2 split the iteration loop out to a helper function, no functionality change.
llvm-svn: 126145
2011-02-21 21:40:33 +00:00
Johnny Chen 28c5882cb5 Add emulation methods for "TST (immediate)" and "TST (register)".
Plus modified EmulateANDImm/Reg to delegate to TSTImm/Reg for Thumb2
32-bit instructions when Rd == '1111' and setflags is true.

llvm-svn: 126144
2011-02-21 21:24:49 +00:00
Chris Lattner 169766f306 fix a comment.
llvm-svn: 126143
2011-02-21 21:15:10 +00:00
Stuart Hastings b6a4d3ebd2 Test case for r126127 and r126141. Radar 9012638.
llvm-svn: 126142
2011-02-21 21:08:21 +00:00
Stuart Hastings d7927e0fcd End the line if we return early. Radar 9012638.
llvm-svn: 126141
2011-02-21 21:07:07 +00:00
Richard Smith 5503805555 Mangling of undeduced 'auto' types, as specified by Itanium C++ ABI.
llvm-svn: 126140
2011-02-21 20:10:02 +00:00
Richard Smith b2bc2e6752 Tweaks to C++0x deduced auto type support:
* Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema
 * Temporary template parameter list for auto deduction is now allocated on the stack.
 * Deduced 'auto' types are now uniqued.

llvm-svn: 126139
2011-02-21 20:05:19 +00:00
Ted Kremenek bda17491c4 Fix call to send_error() in scan-view. An int error code is expected but a string was being sent. Patch by Andrew Price!
llvm-svn: 126138
2011-02-21 19:26:48 +00:00
John McCall 15dd404c46 Don't warn about static const integral data members with in-line constant
initializers just because they don't have a proper out-of-line definition.
Such code is technically ill-formed but is too common and too unlikely to be
a problem to be seriously worth worrying about.

llvm-svn: 126137
2011-02-21 19:25:48 +00:00
David Greene 55820a6b7b Add a convenience tool for doing comparison builds of the LLVM
ecosystem.  This is a handy utility for checking changes before
committing them to the repository.

llvm-svn: 126136
2011-02-21 19:23:22 +00:00
Chris Lattner 22b7495ec8 Better OpenBSD support, patch by Amit Kulkarni. I have no way to test
that this doesn't break gold, but it seems reasonable to me.

llvm-svn: 126135
2011-02-21 18:38:56 +00:00
Fariborz Jahanian 786e04cda5 Turn on 'auto' in plain objc mode.
llvm-svn: 126134
2011-02-21 18:37:13 +00:00
Chris Lattner d0257f79bc Pass the right linker flag in openbsd::Link::ConstructJob,
patch by Matthew Dempsky!

llvm-svn: 126133
2011-02-21 18:36:51 +00:00
Richard Osborne 1ae65c7cb8 Add XCore intrinsics for various instructions on ports.
llvm-svn: 126132
2011-02-21 18:23:30 +00:00
Stuart Hastings 33a3f356ef Test case for r126127. Radar 9012638.
llvm-svn: 126131
2011-02-21 18:08:40 +00:00
Duncan Sands bda7175a43 The stack should be 16 byte aligned on 32 bit solaris. Patch by Yuri.
llvm-svn: 126130
2011-02-21 17:37:17 +00:00
Duncan Sands ecbbf0825b If the phi node was used by an unreachable instruction that ends up using
itself without going via a phi node then we could return false here in
spite of making a change.  Also, tweak the comment because this method
can (and always could) return true without deleting the original phi node.
For example, if the phi node was used by a read-only invoke instruction
which is used by another phi node phi2 which is only used by and only uses
the invoke, then phi2 would be deleted but not the invoke instruction and
not the original phi node.

llvm-svn: 126129
2011-02-21 17:32:05 +00:00
Fariborz Jahanian f5bfc46c95 Remove warning on future change in ivar lookup rule
when doing the property default synthesis.
// rdar://9027673.

llvm-svn: 126128
2011-02-21 17:31:28 +00:00
Stuart Hastings b4863a41e9 Fix to correctly support attribute((section("__DATA, __common"))).
Radar 9012638.

llvm-svn: 126127
2011-02-21 17:27:17 +00:00
Chris Lattner 5237febf0c a serious "compare CSE" issue that is nontrivial to get right,
but which is responsible for us doing really bad things to 256.bzip2.

llvm-svn: 126126
2011-02-21 17:03:47 +00:00
Chris Lattner 2333ac279f fix a crasher in disabled code (on variable stride loops)
llvm-svn: 126125
2011-02-21 17:02:55 +00:00
Duncan Sands 6dcd49bc2b Simplify RecursivelyDeleteDeadPHINode. The only functionality change
should be that if the phi is used by a side-effect free instruction with
no uses then the phi and the instruction now get zapped (checked by the
unittest).

llvm-svn: 126124
2011-02-21 16:27:36 +00:00
John McCall 5decec97e5 Reorganize subelement initialization checking, no functionality change.
llvm-svn: 126116
2011-02-21 07:57:55 +00:00
John McCall 66884dd93c Small optimization: avoid redundant checks of whether a type is an array
when checking an initialization.

llvm-svn: 126115
2011-02-21 07:22:22 +00:00
John McCall 701417a0ac Pseudo-revirtualize CallExpr::getSourceRange by making it follow the
logic from CXXMemberCallExpr and by making it check for
CXXOperatorCallExpr in order to defer.  This is not really an awesome solution,
but I don't have a better idea.

llvm-svn: 126114
2011-02-21 06:23:05 +00:00
John McCall e9dab636df Bind references to opaque r-values correctly. Add a few test cases
for ?: on record types.

llvm-svn: 126113
2011-02-21 05:25:38 +00:00
NAKAMURA Takumi 860abd0f28 Target/X86/X86FastISel: [PR6275] Fix Win32's dllimport function with fastisel.
"dllimport" function must not be GlobalVariable, but Function. It is enough to check with GlobalValue.
test/CodeGen/X86/dll-linkage.ll is updated to check llc -O0.

llvm-svn: 126110
2011-02-21 04:50:06 +00:00
Venkatraman Govindaraju a82203f875 Generate correct Sparc32 ABI compliant code for functions that return a struct.
llvm-svn: 126108
2011-02-21 03:42:44 +00:00
NAKAMURA Takumi 66242b85f0 CMake: Define LLVM_INCLUDE_TESTS in cmake/modules/HandleLLVMOptions.cmake. It affects testing stuff on clang-standalone build.
llvm-svn: 126107
2011-02-21 03:21:06 +00:00
NAKAMURA Takumi 27b0b5a997 CMake: Fix breakage on clang standalone build.
llvm-svn: 126106
2011-02-21 03:20:57 +00:00
NAKAMURA Takumi 19c9fb6cbc CMake: Eliminate duplicate -D__STDC_LIMIT_MACROS and -D__STDC_CONSTANT_MACROS. llvm/cmake/modules/HandleLLVMOptions.cmake defines them.
llvm-svn: 126105
2011-02-21 03:19:49 +00:00
John McCall f2e9110a9f Rename test/CodeGenCXX/gnu-conditional-scalar-ext.cpp to conditional-gnu-ext.cpp
for consistency with other tests (and to remove "scalar" from the name).

llvm-svn: 126104
2011-02-21 02:28:50 +00:00