Eli Friedman
04fddf0d1f
Fix for PR4721: adjust CodeGen and ASTContext so that we have a
...
consistent model for handling size expressions for VLAs.
The model is essentially as follows: VLA types own their associated
expression. In some cases, we need to create multiple VLA types to
represent a given VLA (for canonical types, or qualifiers on array types,
or type merging). If we need to create multiple types based off of
the same VLA declaration, we use the new refcounting functionality so they can
all own the expression. The VLASizeMap in CodeGenFunction then uses the size
expression to identify the group of VLA types based off of the same original
declaration.
I'm not particularly attached to the VLA types owning the expression,
but we're stuck with at least until someone comes up with a way
to walk the VLA expressions for a declaration.
I did the parallel fix in ASTContext for DependentSizedArrayType, but I
haven't really looked closely at it, so there might still be issues
there.
I'll clean up the code duplication in ASTContext in a followup commit.
llvm-svn: 79071
2009-08-15 02:50:32 +00:00
John McCall
deb8448690
Disable all recognition of main() in -ffreestanding. Addresses bug #4720 .
...
llvm-svn: 79070
2009-08-15 02:09:25 +00:00
Dan Gohman
fca896815d
Simplify a few more things, eliminating a few more dependencies on
...
"the current basic block".
llvm-svn: 79069
2009-08-15 02:07:36 +00:00
Dan Gohman
e8c913e657
Simplify this code to not depend as much on CurMBB.
...
llvm-svn: 79068
2009-08-15 02:06:22 +00:00
Evan Cheng
75c9e535c6
Do not use frame register to reference fixed stack objects if the function is frameless.
...
llvm-svn: 79067
2009-08-15 02:05:35 +00:00
Dan Gohman
177102271d
Always check to see if raw_fd_ostream's file descriptor is attached to
...
a terminal, not just when it's STDOUT_FILENO.
llvm-svn: 79066
2009-08-15 02:05:19 +00:00
Dan Gohman
186b85dbcc
Add support for column computation on unbuffered streams.
...
llvm-svn: 79065
2009-08-15 02:02:59 +00:00
Dan Gohman
250635e3ac
Move FormattedStream's write_impl out of line.
...
llvm-svn: 79064
2009-08-15 02:01:04 +00:00
Dan Gohman
e9f0bf5dee
Remove an unnecessary #include.
...
llvm-svn: 79063
2009-08-15 01:56:38 +00:00
Chris Lattner
b1bf2009a4
switch DominanceFrontier::splitBlock to use a smallvector for
...
the pred list instead of a vector, saving a boat load of malloc/free's.
llvm-svn: 79062
2009-08-15 01:39:28 +00:00
Dan Gohman
0700a56860
On x86-64, for a varargs function, don't store the xmm registers to
...
the register save area if %al is 0. This avoids touching xmm
regsiters when they aren't actually used.
llvm-svn: 79061
2009-08-15 01:38:56 +00:00
Ted Kremenek
08479ae7fe
Change handling of attribute 'malloc' to only accept the attribute on function
...
declarations (and not function pointers). This is consistent with GCC. Accepting
this attribute on function pointers means that the attribute should be treated
as a type qualifier, which apparently is not what GCC does. We obviously can
change this later should we desire to enhance the 'malloc' attribute in this
way.
llvm-svn: 79060
2009-08-15 00:51:46 +00:00
Chris Lattner
8dc7626f9c
minor cleanups for VLA stuff.
...
llvm-svn: 79059
2009-08-15 00:03:43 +00:00
Chris Lattner
19efdd67dd
use GetVLASize instead of accessing VLASizeMap directly, this gets an assert if
...
VLASize isn't populated for the type yet.
llvm-svn: 79057
2009-08-14 23:43:22 +00:00
Benjamin Kramer
312fde6420
lit: flush stdout in no-fancy-progress-bar mode as well.
...
llvm-svn: 79056
2009-08-14 23:34:45 +00:00
Ted Kremenek
8d091dbe13
Add more attribute 'malloc' test cases involving function pointers.
...
llvm-svn: 79055
2009-08-14 22:06:01 +00:00
Ted Kremenek
f22c410efa
Per Eli Friedman's feedback, handle attribute 'malloc' being applied to
...
declarations of function pointers.
llvm-svn: 79053
2009-08-14 22:03:27 +00:00
Fariborz Jahanian
2e4a46b745
objc2's foreach statement's selector type can be
...
a block pointer too.
llvm-svn: 79050
2009-08-14 21:53:27 +00:00
Devang Patel
f691df3536
Do not completely skip subrange info for a zero sized array.
...
llvm-svn: 79044
2009-08-14 20:59:16 +00:00
Devang Patel
d4bbb08946
Do now overflow while calulating upper bound for zero sized array.
...
llvm-svn: 79043
2009-08-14 20:57:45 +00:00
Ted Kremenek
026d201eca
This test case does not need to include 'stdlib.h'.
...
llvm-svn: 79042
2009-08-14 20:53:10 +00:00
Ted Kremenek
420d9a7a5e
Use 'dyn_cast' instead of a check for a function declaration followed by a
...
'cast'.
llvm-svn: 79041
2009-08-14 20:51:58 +00:00
Ted Kremenek
527042b5a9
Improve Sema's handling of attribute 'malloc' to reject the attribute when
...
attaching to Objective-C methods (which mirrors GCC's behavior) and to allow the
return type of the function to be an Objective-C pointer or Block pointer (which
GCC also accepts).
Along the way, add 'const' to some of the pointer arguments of various utility
functions...
llvm-svn: 79040
2009-08-14 20:49:40 +00:00
Evan Cheng
7dae88d2c9
Leaf functions which do not save CSRs can be frameless even with -disable-fp-elim.
...
llvm-svn: 79039
2009-08-14 20:48:13 +00:00
Oscar Fuentes
cc756e70ad
CMake: Updated library dependence info.
...
llvm-svn: 79038
2009-08-14 20:30:18 +00:00
Eric Christopher
846e35b26c
Add sse4.2 string/text processing intrinsics. We'll select these later.
...
llvm-svn: 79037
2009-08-14 20:27:57 +00:00
Eric Christopher
86f7f77cc5
Whitespace cleanup.
...
llvm-svn: 79036
2009-08-14 20:27:12 +00:00
Fariborz Jahanian
42af5ba7b7
ir-gen for generation of trvial copy constructor
...
call.
llvm-svn: 79034
2009-08-14 20:11:43 +00:00
Anton Korobeynikov
a6b3ce203a
Allow targets to specify their choice of calling conventions per
...
libcall. Take advantage of this in the ARM backend to rectify broken
choice of CC when hard float is in effect. PIC16 may want to see if
it could be of use in MakePIC16Libcall, which works unchanged.
Patch by Sandeep!
llvm-svn: 79033
2009-08-14 20:10:52 +00:00
Evan Cheng
dc49a8d3f1
Add Thumb2 lsr hooks.
...
llvm-svn: 79032
2009-08-14 20:09:37 +00:00
Daniel Dunbar
6cb1eb5a6d
llvm-mc: Fix bugs where bytes were unintentionally being printed as signed.
...
- We now print all of 403.gcc cleanly (llvm-mc -> 'as' as diffed to 'as'), minus two
'rep;movsl' instructions (which I missed before).
llvm-svn: 79031
2009-08-14 19:59:24 +00:00
Oscar Fuentes
6b5cb8a6b3
CMake: Corrected variable check.
...
llvm-svn: 79030
2009-08-14 19:56:04 +00:00
Bruno Cardoso Lopes
c773141e66
*try* to use a better name to describe how common symbols are marked on the elf object file.
...
llvm-svn: 79029
2009-08-14 19:45:38 +00:00
Owen Anderson
8cd3566d6d
Add doxygen comments.
...
llvm-svn: 79027
2009-08-14 19:41:50 +00:00
Evan Cheng
09c070f4ce
80 col violation.
...
llvm-svn: 79026
2009-08-14 19:11:20 +00:00
Daniel Dunbar
c2346a3037
llvm-mc: When handling a .set, make sure to print subsequent references to the
...
symbol as the symbol name itself, not the expression it was defined to. These
have different semantics due to the quirky .set behavior (which absolutizes an
expression that would otherwise be treated as a relocation).
llvm-svn: 79025
2009-08-14 19:10:46 +00:00
Anton Korobeynikov
c1524d442d
Cleanup the mess in msp430 target registration and hopefully unbreak the build
...
llvm-svn: 79024
2009-08-14 19:06:50 +00:00
Argyrios Kyrtzidis
ac74c4c2a1
Revert r78424.
...
In order for the changes in r78424 to work properly, cast_retty<X,Y> should return an object instead of a reference, and it's not clear that this approach has real advantages.
llvm-svn: 79023
2009-08-14 19:01:37 +00:00
Evan Cheng
9a58aff837
Indentation.
...
llvm-svn: 79022
2009-08-14 19:01:37 +00:00
Anton Korobeynikov
28381c05d4
Force reconfigure
...
llvm-svn: 79019
2009-08-14 18:53:19 +00:00
Daniel Dunbar
563a7e87e3
llvm-mc: zerofill shouldn't print quotes around the section,segment.
...
llvm-svn: 79017
2009-08-14 18:51:45 +00:00
Chris Lattner
0792195c5a
fix "pc" to be lower case in a target triple, patch by Yonggang Luo
...
llvm-svn: 79016
2009-08-14 18:48:13 +00:00
Anton Korobeynikov
384b336911
Hopefully unbreak cmake builds
...
llvm-svn: 79015
2009-08-14 18:46:49 +00:00
Evan Cheng
e41903b10d
Also shrink immediate branches; also more assembler workarounds.
...
llvm-svn: 79014
2009-08-14 18:31:44 +00:00
Anders Carlsson
e827123f08
Make the CXXDefaultArgExpr constructor protected and add a static Create function.
...
llvm-svn: 79013
2009-08-14 18:30:22 +00:00
Anton Korobeynikov
52b7f0ad5f
Give MSP430 a separate asmprinter lib
...
llvm-svn: 79012
2009-08-14 18:28:12 +00:00
Ted Kremenek
d0d7256b8f
Pass '-Wno-' options to clang-cc. This fixes <rdar://problem/6943988>.
...
llvm-svn: 79011
2009-08-14 18:20:50 +00:00
Daniel Dunbar
ef668c169b
llvm-mc: Support escaped characters in string literals (for .ascii and .asciz)
...
llvm-svn: 79010
2009-08-14 18:19:52 +00:00
Anton Korobeynikov
75821f7c69
Properly handle indirect win64 args when they're passed in memory
...
llvm-svn: 79009
2009-08-14 18:19:10 +00:00
Fariborz Jahanian
83b000c713
Fixed a regression in deciding when to issue warning on properties which
...
implement NSCopying protocol in GC mode.
llvm-svn: 79008
2009-08-14 18:06:25 +00:00