Richard Smith
f3e9e43da4
Constant expression evaluation: support for arrays.
...
llvm-svn: 143922
2011-11-07 09:22:26 +00:00
John McCall
ffc8ca2d84
Rip out CK_GetObjCProperty.
...
llvm-svn: 143910
2011-11-07 05:09:54 +00:00
John McCall
c109a259d2
Rip the ObjCPropertyRef l-value kind out of IR-generation.
...
llvm-svn: 143908
2011-11-07 03:59:57 +00:00
John McCall
fe96e0b6be
Change the AST representation of operations on Objective-C
...
property references to use a new PseudoObjectExpr
expression which pairs a syntactic form of the expression
with a set of semantic expressions implementing it.
This should significantly reduce the complexity required
elsewhere in the compiler to deal with these kinds of
expressions (e.g. IR generation's special l-value kind,
the static analyzer's Message abstraction), at the lower
cost of specifically dealing with the odd AST structure
of these expressions. It should also greatly simplify
efforts to implement similar language features in the
future, most notably Managed C++'s properties and indexed
properties.
Most of the effort here is in dealing with the various
clients of the AST. I've gone ahead and simplified the
ObjC rewriter's use of properties; other clients, like
IR-gen and the static analyzer, have all the old
complexity *and* all the new complexity, at least
temporarily. Many thanks to Ted for writing and advising
on the necessary changes to the static analyzer.
I've xfailed a small diagnostics regression in the static
analyzer at Ted's request.
llvm-svn: 143867
2011-11-06 09:01:30 +00:00
Akira Hatanaka
f3879ee666
Use a single integer type for a sub-doubleword part of a byval structure.
...
llvm-svn: 143666
2011-11-03 23:31:00 +00:00
Eli Friedman
3d9f47fe6f
Fix alignment on alloca's for parameters using ABIArgInfo::Expand.
...
llvm-svn: 143658
2011-11-03 21:39:02 +00:00
Eli Friedman
eadd3e81a0
Fix the alignment on scalar parameter variables so that it matches what the AST thinks it should be. Per report on cfe-dev.
...
llvm-svn: 143645
2011-11-03 20:31:28 +00:00
Jan Wen Voung
180319f72d
Do not add "byval" attribute to records with non-trivial copy constructors
...
and destructors in the DefaultABIInfo.
llvm-svn: 143601
2011-11-03 00:59:44 +00:00
Akira Hatanaka
756ce7f9ab
Set MinABIStackAlignInBytes to 8 if ABI is N32/64.
...
llvm-svn: 143597
2011-11-03 00:05:50 +00:00
Akira Hatanaka
101f70da7c
Convert the type of a structure passed by value if it has double precision
...
fields in order to ease handling of such structures in backend.
llvm-svn: 143596
2011-11-02 23:54:49 +00:00
Akira Hatanaka
1437852c38
Return function results whose size is smaller than 128-bits in registers if ABI
...
is N32/64.
llvm-svn: 143589
2011-11-02 23:14:57 +00:00
Fariborz Jahanian
10317eaa28
back out changes in r143399 and r143475.
...
rvale-references are captured by reference
in blocks. // rdar://9971124.
llvm-svn: 143583
2011-11-02 22:53:43 +00:00
Bob Wilson
1d9269a8d6
Check for homogeneous aggregate return values with ARM's AAPCS-VFP ABI.
...
llvm-svn: 143530
2011-11-02 04:51:36 +00:00
Eli Friedman
fcec630a57
Fix the representation of wide strings in the AST and IR so that it uses the native representation of integers for the elements. This fixes a bunch of nastiness involving
...
treating wide strings as a series of bytes.
Patch by Seth Cantrell.
llvm-svn: 143417
2011-11-01 02:23:42 +00:00
Fariborz Jahanian
f0cda63975
Adds IRGen support for captured rvalue references in blocks.
...
In this case, temporary value is copied into block descriptor
as their own copy to work on. // rdar://9971124
llvm-svn: 143399
2011-10-31 23:44:33 +00:00
Anders Carlsson
2f1a6c3f01
In x86_64, when calling an Objective-C method that returns a _Complex long double, make sure to use the objc_msgSend_fp2ret function which ensures that the return value will be {0, 0} if the receiver is nil.
...
llvm-svn: 143350
2011-10-31 16:27:11 +00:00
Nick Lewycky
dd424a5bc4
Turn on the new .file directive when appropriate, instead of turning it off.
...
llvm-svn: 143327
2011-10-31 01:06:42 +00:00
Peter Collingbourne
f1d76db466
Add support for lazily linking bitcode files (using a new
...
-mlink-bitcode-file flag), and more generally llvm::Modules, before
running optimisations.
llvm-svn: 143314
2011-10-30 17:30:44 +00:00
Richard Smith
7b553f1b19
Rename Expr::Evaluate to Expr::EvaluateAsRValue to make it clear that it will
...
implicitly perform an lvalue-to-rvalue conversion if used on an lvalue
expression. Also improve the documentation of Expr::Evaluate* to indicate which
of them will accept expressions with side-effects.
llvm-svn: 143263
2011-10-29 00:50:52 +00:00
Devang Patel
fa59ac363e
In case of template specialization, do not try to delay emitting debug info for concrete type in -flimit-debug-info mode. This fixes some of the failures from bs15503.exp tests in gdb testsuite.
...
llvm-svn: 143227
2011-10-28 21:12:13 +00:00
Rafael Espindola
fffc1ce1d7
Fix PR9614 for functions with the always_inline attribute. Try to keep
...
the common case (-O0, no always_inline) fast.
llvm-svn: 143222
2011-10-28 20:43:56 +00:00
David Chisnall
0cc83e7518
It turns out that the Objective-C message lookup functions can throw exceptions after all...
...
llvm-svn: 143205
2011-10-28 17:55:06 +00:00
Peter Collingbourne
95fd2ca69f
Annotate imprecise FP division with fpaccuracy metadata
...
The OpenCL single precision division operation is only required to
be accurate to 2.5ulp. Annotate the fdiv instruction with metadata
which signals to the backend that an imprecise divide instruction
may be used.
llvm-svn: 143136
2011-10-27 19:19:51 +00:00
Fariborz Jahanian
b005070b83
Objective-c: fix an ir-gen crash where objc messag returns a _Complex
...
value and ABI requires return slot to be passed as first
argument to message sent. // rdar://10331109
llvm-svn: 143053
2011-10-26 20:53:59 +00:00
Rafael Espindola
c594135b68
Fix pr9614 by not emitting an available_externally function when it calls
...
itself via an asm label.
available_externally functions are supposed to correspond to an external
function, and that is not the case in the examples in pr9614.
llvm-svn: 143049
2011-10-26 20:41:06 +00:00
John McCall
526ab47a55
Restore r142914 and r142915, now with missing file and apparent
...
GCC compiler workaround.
llvm-svn: 142931
2011-10-25 17:37:35 +00:00
NAKAMURA Takumi
9a8f13961c
Revert r142914 and r142915, due to possibly missing file.
...
r142914: "Introduce a placeholder type for "pseudo object""
r142915: "Pull the pseudo-object stuff into its own file."
llvm-svn: 142921
2011-10-25 14:32:25 +00:00
David Chisnall
e89ac0666b
Change an int64_t to an intptr_t so that we don't end up with crashes in the back end on large classes on 32-bit.
...
llvm-svn: 142918
2011-10-25 10:12:21 +00:00
John McCall
c4a2d3259f
Introduce a placeholder type for "pseudo object"
...
expressions: expressions which refer to a logical rather
than a physical l-value, where the logical object is
actually accessed via custom getter/setter code.
A subsequent patch will generalize the AST for these
so that arbitrary "implementing" sub-expressions can
be provided.
Right now the only client is ObjC properties, but
this should be generalizable to similar language
features, e.g. Managed C++'s __property methods.
llvm-svn: 142914
2011-10-25 07:27:56 +00:00
Douglas Gregor
deb4a2be67
Implement support for dependent Microsoft __if_exists/__if_not_exists
...
statements. As noted in the documentation for the AST node, the
semantics of __if_exists/__if_not_exists are somewhat different from
the way Visual C++ implements them, because our parsed-template
representation can't accommodate VC++ semantics without serious
contortions. Hopefully this implementation is "good enough".
llvm-svn: 142901
2011-10-25 01:33:02 +00:00
Dan Gohman
53bb0ff685
Remove the SystemZ backend.
...
llvm-svn: 142879
2011-10-24 23:48:52 +00:00
Devang Patel
242ce91ecc
Do not drop type qualifiers in -flimit-debug-info mode.
...
llvm-svn: 142873
2011-10-24 23:15:17 +00:00
Eli Friedman
9190e19b66
Don't try to emit CK_LValueBitCast casts as constants. PR9558.
...
llvm-svn: 142863
2011-10-24 22:25:55 +00:00
Benjamin Kramer
1e93c6a809
Fix mismatched new[]/delete[].
...
llvm-svn: 142803
2011-10-24 17:22:36 +00:00
David Chisnall
d5bcd07e5d
Remove debugging printfs that some idiot left in.
...
llvm-svn: 142796
2011-10-24 14:11:46 +00:00
David Chisnall
8c93cf2a27
Enable experimental support for objc_msgSend with GNUstep ObjC runtime.
...
llvm-svn: 142795
2011-10-24 14:07:03 +00:00
Bob Wilson
02d5fe29ab
Fix a typo that completely broke the expansion of complex arguments.
...
llvm-svn: 142734
2011-10-22 21:42:34 +00:00
Benjamin Kramer
e35328c878
Remove obsolete debugging macro, make helper static.
...
llvm-svn: 142730
2011-10-22 19:16:39 +00:00
Eric Christopher
4b4beb2fe7
Fix PR11073 by adding the argument type information to the decl we construct
...
for the function type. Update a testcase accordingly.
Patch initially by Anders Waldenborg!
llvm-svn: 142700
2011-10-21 23:30:10 +00:00
Fariborz Jahanian
47f9a73f51
c++: support gcc's application of weak attribute on
...
class declaration which forces any such class and any
class that inherits from such a class to have their
typeinfo symbols be marked as weak.
// rdar://10246395
A test/CodeGenCXX/weak-extern-typeinfo.cpp
M lib/Sema/SemaDeclCXX.cpp
M lib/Sema/SemaDeclAttr.cpp
M lib/CodeGen/CGRTTI.cpp
llvm-svn: 142693
2011-10-21 22:27:12 +00:00
Nick Lewycky
ba743b75cb
Take DW_AT_comp_dir from $PWD when it's present and starts with a '/'. This is
...
closer to what GCC does, except that GCC also checks that the inodes for $PWD
and '.' match.
llvm-svn: 142633
2011-10-21 02:32:14 +00:00
Eric Christopher
7ec8ec8581
Add block information for ObjC @catch blocks.
...
Fixes rdar://10282889
llvm-svn: 142467
2011-10-19 00:44:01 +00:00
Eric Christopher
a9d3497b5e
Add a new subclass of RunCleanupScopes that also handles creating new
...
lexical blocks for debug info.
llvm-svn: 142466
2011-10-19 00:43:52 +00:00
John McCall
59207978e6
More metaprogramming with builtin types.
...
llvm-svn: 142433
2011-10-18 22:28:37 +00:00
John McCall
e314e27c58
Macro metaprogramming for builtin types.
...
llvm-svn: 142420
2011-10-18 21:02:43 +00:00
Eli Friedman
5e9534b0ae
Rewrite parts of MS ABI C++ layout. Based on work by r4start; I ended up doing this while I was trying to review his patch.
...
llvm-svn: 142325
2011-10-18 00:55:28 +00:00
Nick Lewycky
1d617acef9
Wire up support for the controlling the extended dwarf .file directive. With
...
r142300 but not this patch, clang -S may emit .s files that assemblers other
than llvm-mc can't parse.
llvm-svn: 142301
2011-10-17 23:05:52 +00:00
John McCall
8a6b59ad97
Add a new placeholder type to represent "unbridged"
...
casts in ARC.
No semantic analysis yet.
llvm-svn: 142208
2011-10-17 18:09:15 +00:00
Benjamin Kramer
e06b2b7012
Convert inline asm source ranges into clang SourceRanges and print them with the instantiated note.
...
t.c:2:7: error: invalid operand for instruction
asm("movl 0(%rax), 0(%edx)");
^
<inline asm>:1:16: note: instantiated into assembly here
movl 0(%rax), 0(%edx)
^~~~~~~
1 error generated.
llvm-svn: 142131
2011-10-16 10:48:28 +00:00
Benjamin Kramer
22d24c287a
Replace vectors with arrays.
...
llvm-svn: 142072
2011-10-15 12:20:02 +00:00