Commit Graph

57228 Commits

Author SHA1 Message Date
Chris Lattner d18136a644 fix the two xfails I added with a previous patch by making ObjC interface
types get completed when their definition is seen if previously laid out by
the code generator.

llvm-svn: 68177
2009-04-01 02:36:43 +00:00
Chris Lattner 6483908957 move trivial forwarding function inline.
llvm-svn: 68176
2009-04-01 02:08:13 +00:00
Chris Lattner 7e06443d44 hopefully fix an apparent build error on windows.
llvm-svn: 68175
2009-04-01 02:03:38 +00:00
Chris Lattner 87bc387f8f tidy some code.
llvm-svn: 68174
2009-04-01 02:00:48 +00:00
Chris Lattner 647cffba61 fix a serious regression I introduced in my previous patch.
llvm-svn: 68173
2009-04-01 01:43:03 +00:00
Owen Anderson ff5961b46c Enhance GVN to propagate simple conditionals. This fixes PR3921.
llvm-svn: 68172
2009-04-01 01:20:45 +00:00
Mike Stump cafa0a9746 Fix block comparisons. Radar 6732116.
llvm-svn: 68171
2009-04-01 01:17:39 +00:00
Anders Carlsson 237f349073 Implement code generation of namespaces and add mangling tests.
llvm-svn: 68170
2009-04-01 00:58:25 +00:00
Chris Lattner f16f90b4fd add support for the LONG_LONG_MIN/LONG_LONG_MAX/ULONG_LONG_MAX limits.h GNU extensions.
rdar://6740292

llvm-svn: 68169
2009-04-01 00:44:37 +00:00
Anders Carlsson 12edad2c50 Fix a bug (that I thought I had fixed already) where mangling a prefix could get us into an infinite loop
llvm-svn: 68168
2009-04-01 00:42:16 +00:00
Misha Brukman 7f1f0b03e2 include Makefile.common before using $(BuildMode) to get its definition
llvm-svn: 68167
2009-04-01 00:35:00 +00:00
Douglas Gregor dce2b62b70 Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,

  typename MetaFun::template apply<T1, T2>

Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,

  typename T::type::type

llvm-svn: 68166
2009-04-01 00:28:59 +00:00
Daniel Dunbar 5c9c118600 Tweak darwin::Assemble and add a FIXME.
llvm-svn: 68165
2009-04-01 00:27:44 +00:00
Ted Kremenek 0df7051783 Add '-emit-pth' option to clang-cc as an alternate API for the high-level driver
to generate PTH files. Soon we will remove from clang-cc the GCC-style '-x
c-header' interface for generating PTH files and push this logic to 'clang'.

llvm-svn: 68164
2009-04-01 00:23:28 +00:00
Misha Brukman 5fc1a0339c * Fixed spelling of `invertible'
* Simplified if statement

llvm-svn: 68163
2009-04-01 00:15:46 +00:00
Anders Carlsson 7a6f8b9281 Fix a mangling bug where functions with no arguments weren't getting the 'v' parameter specifier.
llvm-svn: 68162
2009-04-01 00:15:23 +00:00
Daniel Dunbar 08b216abf1 Add Target hooks for IRgen of [cf]string literals.
- Notably, set section on cfstring literal string data (for now, this
   is done everywhere because it matches what we were already doing
   for the CFString data itself)

 - <rdar://problem/6599098> [irgen] linker requires objc string data
   to go into cstring

llvm-svn: 68160
2009-03-31 23:42:16 +00:00
Douglas Gregor a9d1032f9c Allow the use of pointers to const within PointerUnion.
llvm-svn: 68159
2009-03-31 23:19:54 +00:00
Chris Lattner 169b2f191d add a converting operator
llvm-svn: 68158
2009-03-31 23:09:51 +00:00
Ted Kremenek 7062c50772 More code reshuffling. No functionality change.
llvm-svn: 68157
2009-03-31 23:00:32 +00:00
Chris Lattner 2d8cd80ee0 reimplement BitcodeReaderValueList in terms of WeakVH instead of making
it be an LLVM IR User object.

llvm-svn: 68156
2009-03-31 22:55:09 +00:00
Chris Lattner f41e87f4cd Change UsedArray to be a vector of WeakVH to fix a dangling pointer problem that occurs when
attribute(used) and asm renaming are used together.

llvm-svn: 68155
2009-03-31 22:37:52 +00:00
Chris Lattner 2739d2bbe6 remove some obsolete comments, use an AssertingVH.
llvm-svn: 68151
2009-03-31 22:17:44 +00:00
Chris Lattner f72ce6ea8b Make the key of ValueRankMap an AssertingVH, so that we die violently
if it dangles.

llvm-svn: 68150
2009-03-31 22:13:29 +00:00
Chris Lattner 90234f34c6 Add two new classes: WeakVH and AssertingVH. These are both "ValueHandles",
which are effectively smart pointers to Value*'s.  They are both very light
weight and simple, and react to values being destroyed or being RAUW'd.

WeakVN does a best effort to follow a value around, including through RAUW 
operations and will get nulled out of the value is destroyed.  This is useful
for the eventual "metadata that references a value" work, because it is a
reference to a value that does not show up on its use_* list.

AssertingVH is a pointer that compiles down to a dumb raw pointer when 
assertions are disabled.  When enabled, it emits an assertion if the 
pointed-to value is destroyed while it is still being referenced.  This
is very useful for Maps and other things, and should have caught the recent
bugs in CallGraph and Reassociate, for example.

llvm-svn: 68149
2009-03-31 22:11:05 +00:00
Daniel Dunbar 7c92528530 Driver: Implement basic --help text.
- PR3875.
 - <rdar://problem/6615249> [driver] ccc should support some form of
   --help

llvm-svn: 68148
2009-03-31 21:38:17 +00:00
Chris Lattner e756f15703 teach PointerLikeTypeTraits that all pointers to pointers may only be 4-byte aligned.
llvm-svn: 68147
2009-03-31 21:28:39 +00:00
Daniel Dunbar 77684ead4b Driver: Add OptTable::getOptionKind.
Also, removed default value for getOptionMetaVar.

llvm-svn: 68146
2009-03-31 21:26:12 +00:00
Chris Lattner e0d25e42e9 add some accessors so I can play games with DenseMaps.
llvm-svn: 68145
2009-03-31 20:57:23 +00:00
Daniel Dunbar e521a8994c Driver: Forward -Wp, and -Xpreprocessor arguments to clang when using
the preprocessor.
 - PR3602.

 - As is inherent in the blanket forwarding options, this will only
   work if clang-cc happens to accept what the user passed. Users by
   and large should use driver options to interact with the
   preprocessor, if at all possible.

llvm-svn: 68144
2009-03-31 20:53:55 +00:00
Evan Cheng 826b6f0f7c Throttle back "fold select into operand" transformation. InstCombine should not generate selects of two constants unless they are selects of 0 and 1.
e.g.
define i32 @t1(i32 %c, i32 %x) nounwind {
       %t1 = icmp eq i32 %c, 0
       %t2 = lshr i32 %x, 18
       %t3 = select i1 %t1, i32 %t2, i32 %x
       ret i32 %t3
}

was turned into

define i32 @t2(i32 %c, i32 %x) nounwind {
       %t1 = icmp eq i32 %c, 0
       %t2 = select i1 %t1, i32 18, i32 0
       %t3 = lshr i32 %x, %t2
       ret i32 %t3
}

For most targets, that means materializing two constants and then a select. e.g. On x86-64

movl    %esi, %eax
shrl    $18, %eax
testl   %edi, %edi
cmovne  %esi, %eax
ret

=>

xorl    %eax, %eax
testl   %edi, %edi
movl    $18, %ecx
cmovne  %eax, %ecx
movl    %esi, %eax
shrl    %cl, %eax
ret

Also, the optimizer and codegen can reason about shl / and / add, etc. by a constant. This optimization will hinder optimizations using ComputeMaskedBits.

llvm-svn: 68142
2009-03-31 20:42:45 +00:00
Ted Kremenek 4e81c3ccac Allow two codepaths for PathDiagnostic generation. This patch mainly consists of
refactoring to make this possible (no functionality change).

llvm-svn: 68141
2009-03-31 20:22:36 +00:00
Douglas Gregor b046ffb002 Some cleanup and renaming. No functionality change
llvm-svn: 68140
2009-03-31 20:22:05 +00:00
Daniel Dunbar a207254f94 Driver: Add extra parameters for help text to option definitions.
- Currently unused.

And yes, now may be about the time I want a TableGen backend.

llvm-svn: 68139
2009-03-31 20:12:05 +00:00
Daniel Dunbar 4cb6715434 Add two FIXMEs
llvm-svn: 68138
2009-03-31 20:10:05 +00:00
Douglas Gregor 7ef46d9ae2 Improve the dependent nested-name-specifier test a bit
llvm-svn: 68136
2009-03-31 20:07:16 +00:00
Evan Cheng 0d551591ea Fully general expansion of integer shift of any size.
llvm-svn: 68134
2009-03-31 19:39:24 +00:00
Evan Cheng d9d6e427d6 i128 shift libcalls are not available on x86.
llvm-svn: 68133
2009-03-31 19:38:51 +00:00
Daniel Dunbar 35579146aa x86_32 Darwin ABI: Treat empty unions like empty structures.
- Current return-arguments-32 status: 15/1000 failures

llvm-svn: 68132
2009-03-31 19:01:39 +00:00
Ted Kremenek 7b4df3c3e6 Rename clang.[cpp,h] to clang-cc.[cpp,h] to reflect the name change of the
low-level frontend driver.

llvm-svn: 68131
2009-03-31 18:58:14 +00:00
Ted Kremenek 97823d32ea Update VS project.
llvm-svn: 68130
2009-03-31 18:57:19 +00:00
Dan Gohman 6b42dfddf4 Reapply 68073, with fixes. EH Landing-pad basic blocks are not
entered via fall-through. Don't miss fallthroughs from blocks
terminated by conditional branches. Also, move
isOnlyReachableByFallthrough out of line.

llvm-svn: 68129
2009-03-31 18:39:13 +00:00
Douglas Gregor aa59489b18 Implement template instantiation for template names, including both
template template parameters and dependent template names. For
example, the oft-mentioned

  typename MetaFun::template apply<T1, T2>::type

can now be instantiated, with the appropriate name lookup for "apply".

llvm-svn: 68128
2009-03-31 18:38:02 +00:00
Mikhail Glushenkov eccc5967bf Do not pass '-relocation-model=pic' to llc.
Does not work well on 32 bit targets. Bug reported by Albert Graef.

This patch also adds new "-Wllc,option" syntax to pass options to llc.

llvm-svn: 68127
2009-03-31 18:33:54 +00:00
Douglas Gregor 1d249d984c Stop guessing, start thinking, and make PointerUnion3::is actually be correct.
llvm-svn: 68126
2009-03-31 18:31:03 +00:00
Fariborz Jahanian 89d239796a Patch to fix proptocol reference ir-gen for GNU runtime.
Patch by David Chisnal.

llvm-svn: 68125
2009-03-31 18:27:22 +00:00
Dan Gohman 6161b3ccf6 Add an explicit -asm-verbose to these tests, to make it
possible to run the tests with -asm-verbose defaulting
to false.

llvm-svn: 68124
2009-03-31 18:20:47 +00:00
Fariborz Jahanian 63a224ad59 ir-gen support for nonfragile abi's synthesized ivars.
llvm-svn: 68122
2009-03-31 18:11:23 +00:00
Daniel Dunbar 8eb473c477 Driver: Call 'as' directly on FreeBSD.
- Patch by Ed Schouten!

llvm-svn: 68121
2009-03-31 17:45:15 +00:00
Devang Patel 4ce6e69022 Update call graph after inlining invoke.
Patch by Jay Foad.

llvm-svn: 68120
2009-03-31 17:36:12 +00:00