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
Eli Friedman
27ef75b0be
Handle an edge case involving the conditional operator and throw expressions. PR10582.
...
llvm-svn: 142047
2011-10-15 02:10:40 +00:00
Anton Korobeynikov
f0c267e6e0
Provide half floating point support as a storage only type.
...
Lack of half FP was a regression compared to llvm-gcc.
llvm-svn: 142016
2011-10-14 23:23:15 +00:00
Eli Friedman
4b72fddd99
Misc fixes for atomics. Biggest fix is doing alignment correctly for _Atomic types.
...
llvm-svn: 142002
2011-10-14 20:59:01 +00:00
Benjamin Kramer
47b5b31e61
Simplify code to avoid a useless string copy.
...
llvm-svn: 141970
2011-10-14 18:45:16 +00:00
Benjamin Kramer
fd0b05f341
Upgrade to PathV2.
...
llvm-svn: 141969
2011-10-14 18:45:11 +00:00
Benjamin Kramer
13481e27cb
Add parens to pacify GCC.
...
llvm-svn: 141968
2011-10-14 18:45:06 +00:00
Eli Friedman
fde961dbf3
PR11124: Don't overwrite memory outside of a base class when performing zero-initialization before running its constructor.
...
llvm-svn: 141933
2011-10-14 02:27:24 +00:00
Eric Christopher
7cdf948601
Recommit:
...
Start handling debug line and scope information better:
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Finishes off the rest of rdar://10246360
after fixing a few bugs that were exposed in gdb testsuite testing.
llvm-svn: 141893
2011-10-13 21:45:18 +00:00
Peter Collingbourne
adcf7c9203
TCE target: conversion of OpenCL reqd_work_group_size attr to metadata
...
Patch by Pekka Jääskeläinen!
llvm-svn: 141865
2011-10-13 16:24:41 +00:00
Rafael Espindola
2d21ab024e
Add returns_twice to functions that are known to return twice. This implements
...
the same behavior of gcc by keeping the attribute out of the function type.
llvm-svn: 141803
2011-10-12 19:51:18 +00:00
Eric Christopher
93663b3c62
Revert file/scope handling patches. gdb testing revealed a couple of bugs.
...
llvm-svn: 141796
2011-10-12 18:39:35 +00:00
Jim Goodnow II
5a793d3762
Removed extra line in comment.
...
llvm-svn: 141773
2011-10-12 09:55:01 +00:00
Eric Christopher
663b7f353e
Remember to set the location in EmitGlobalVariable to the current decl
...
if we're going to delete the setLocation as we did in 141732.
llvm-svn: 141762
2011-10-12 01:11:30 +00:00
Eric Christopher
498b7fd7fe
Start handling debug line and scope information better:
...
Migrate most of the location setting within the larger API in CGDebugInfo and
update a lot of callers.
Remove the existing file/scope change machinery in UpdateLineDirectiveRegion
and replace it with DILexicalBlockFile usage.
Finishes off the rest of rdar://10246360
llvm-svn: 141732
2011-10-11 23:00:55 +00:00
Eric Christopher
fefafacf68
80-column and tab cleanup.
...
llvm-svn: 141731
2011-10-11 23:00:51 +00:00
Eric Christopher
fb4cd4082c
Reorder this to make it easier to add more changes for a location set.
...
llvm-svn: 141730
2011-10-11 23:00:45 +00:00
Eli Friedman
c2025567f5
Silence some -Wuninitialized false positives with gcc.
...
llvm-svn: 141701
2011-10-11 20:00:47 +00:00
Eli Friedman
df14b3a837
Initial implementation of __atomic_* (everything except __atomic_is_lock_free).
...
llvm-svn: 141632
2011-10-11 02:20:01 +00:00
Richard Smith
caf3390d44
Constant expression evaluation refactoring:
...
- Remodel Expr::EvaluateAsInt to behave like the other EvaluateAs* functions,
and add Expr::EvaluateKnownConstInt to capture the current fold-or-assert
behaviour.
- Factor out evaluation of bitfield bit widths.
- Fix a few places which would evaluate an expression twice: once to determine
whether it is a constant expression, then again to get the value.
llvm-svn: 141561
2011-10-10 18:28:20 +00:00
David Chisnall
e0dc7cb2e2
Apparently getPtrToInt() takes an explicit type parameter to allow you to generate invalid bitcode, not so that it can actually produce a value of this type. This should fix PR11085.
...
llvm-svn: 141482
2011-10-08 08:54:36 +00:00
Ted Kremenek
c168e50722
Free 'TheTargetCodeGenInfo' in the class CodeGenModule. This looks like an obvious memory leak that was reported from LLDB devs. The comment indicates the leak is deliberate, but I have no idea why this needs to be so. Please comment/revert if you know otherwise.
...
llvm-svn: 141479
2011-10-08 05:28:26 +00:00
Eli Friedman
235266700a
Fix warning on MSVC. Patch by Aaron Ballman.
...
llvm-svn: 141467
2011-10-08 01:03:47 +00:00
John McCall
f937c023bf
Rename TagDecl::isDefinition -> isCompleteDefinition
...
for better self-documenting code, since the semantics
are subtly different from getDefinition().
llvm-svn: 141355
2011-10-07 06:10:15 +00:00
John McCall
0710e551ef
Record layout requires not just a definition, but a complete
...
definition. Assert this. Change IR generation to not try to
aggressively emit the IR translation of a record during its
own definition. Fixes PR10912.
llvm-svn: 141350
2011-10-07 02:39:22 +00:00
Eli Friedman
c8b57f6683
llvm.memory.barrier is going away; remove the wrapper intrinsic __builtin_llvm_memory_barrier.
...
__atomic_thread_fence will be landing soon as a replacement, wrapping around the new fence instruction.
llvm-svn: 141332
2011-10-06 23:12:03 +00:00
Eli Friedman
0dfb889575
Support for C1x _Atomic specifier (see testcase). This is primarily being committed at the moment to help support C++0x <atomic>, but it should be a solid base for implementing the full specification of C1x _Atomic.
...
Thanks to Jeffrey Yasskin for the thorough review!
llvm-svn: 141330
2011-10-06 23:00:33 +00:00
Peter Collingbourne
fa4d6033a3
CUDA: IR generation support for device stubs
...
llvm-svn: 141304
2011-10-06 18:51:56 +00:00
Peter Collingbourne
a9455ec9f8
CUDA: add -fcuda-is-device flag
...
This frontend-only flag is used by the IR generator to determine
whether to filter CUDA declarations for the host or for the device.
llvm-svn: 141301
2011-10-06 18:29:46 +00:00
Peter Collingbourne
fe88342240
CUDA: IR generation support for kernel call expressions
...
llvm-svn: 141300
2011-10-06 18:29:37 +00:00
Peter Collingbourne
5bad4afa2f
CUDA: set proper calling conventions for PTX
...
llvm-svn: 141296
2011-10-06 16:49:54 +00:00
Eric Christopher
fab289a47d
When constructing debug information for synthesized variables for the
...
non-fragile ABI we may not be able to lay out the type and the debugger
would ignore us even if we did put in the offset. Go ahead and just
put any value there and don't look up the offset since it may not exist.
rdar://10210157
llvm-svn: 141261
2011-10-06 00:31:18 +00:00
Eric Christopher
8c552308c6
Reformat comment.
...
llvm-svn: 141260
2011-10-06 00:30:52 +00:00
Justin Holewinski
38031978b5
PTX: Set proper calling conventions for PTX in OpenCL mode.
...
llvm-svn: 141193
2011-10-05 17:58:44 +00:00
David Chisnall
cdd207e43e
Add bitmaps for strong / weak ivar layout (GNUstep runtime).
...
llvm-svn: 141085
2011-10-04 15:35:30 +00:00
John McCall
ff61303bd0
Mark calls to objc_retainBlock that don't result from casts
...
to id so that we can still optimize them appropriately.
llvm-svn: 141064
2011-10-04 06:23:45 +00:00
Rafael Espindola
70107f989c
Propagate __attribute__((returns_twice)) from C to IL.
...
llvm-svn: 141002
2011-10-03 14:59:42 +00:00
Argyrios Kyrtzidis
b8c3aaf479
Allow getting all source locations of selector identifiers in a ObjCMethodDecl.
...
Instead of always storing all source locations for the selector identifiers
we check whether all the identifiers are in a "standard" position; "standard" position is
-Immediately before the arguments: -(id)first:(int)x second:(int)y;
-With a space between the arguments: -(id)first: (int)x second: (int)y;
-For nullary selectors, immediately before ';': -(void)release;
In such cases we infer the locations instead of storing them.
llvm-svn: 140989
2011-10-03 06:37:04 +00:00
Argyrios Kyrtzidis
dfd6570643
Pass from the parser the locations of selector identifiers when creating
...
objc method decls.
They are not stored in the AST yet.
llvm-svn: 140984
2011-10-03 06:36:36 +00:00
John McCall
9b0a7cea0f
Make -fobjc-nonfragile-abi the -cc1 default, since it's the
...
increasingly prevailing case to the point that new features
like ARC don't even support the fragile ABI anymore.
This required a little bit of reshuffling with exceptions
because a check was assuming that ObjCNonFragileABI was
only being set in ObjC mode, and that's actually a bit
obnoxious to do.
Most, though, it involved a perl script to translate a ton
of test cases.
Mostly no functionality change for driver users, although
there are corner cases with disabling language-specific
exceptions that we should handle more correctly now.
llvm-svn: 140957
2011-10-02 01:16:38 +00:00
John McCall
248512a573
When performing an @throw in ARC, retain + autorelease
...
the pointer, being sure to do so before running cleanups
associated with that full-expression. rdar://10042689
llvm-svn: 140945
2011-10-01 10:32:24 +00:00
Fariborz Jahanian
0c78427d50
objc gc: assigning to an objc object struct member through an ivar
...
pointer to this struct must go through the none ivar writer barrier.
llvm-svn: 140867
2011-09-30 18:23:36 +00:00
Eli Friedman
1b87b29bfd
Minor cleanup.
...
llvm-svn: 140866
2011-09-30 18:19:16 +00:00
Eric Christopher
2f45aaa755
Change "Regions" to be "LexicalBlocks" since that's what they
...
correspond to.
llvm-svn: 140740
2011-09-29 00:00:45 +00:00
Eric Christopher
bfa4dc5512
Rename EmitStopPoint in CGDebugInfo to EmitLocation. "stop points" don't
...
exist anymore.
llvm-svn: 140739
2011-09-29 00:00:41 +00:00
Eric Christopher
4fd315ffbd
Reorder functions in the file.
...
llvm-svn: 140738
2011-09-29 00:00:37 +00:00
Eric Christopher
e655657c94
Call UpdateLineDirectiveRegion every time we want to emit a stop
...
point in the code. Ensures that we don't miss any places and the
check is reasonably cheap.
llvm-svn: 140737
2011-09-29 00:00:35 +00:00
Eric Christopher
250511bc75
Update comment.
...
llvm-svn: 140736
2011-09-29 00:00:31 +00:00
Benjamin Kramer
76399eb2ad
de-tmpify clang.
...
llvm-svn: 140637
2011-09-27 21:06:10 +00:00
Eric Christopher
9c13eeac99
Update comments.
...
llvm-svn: 140531
2011-09-26 15:03:22 +00:00
Eric Christopher
22e157009c
Fix comment to reflect reality.
...
llvm-svn: 140530
2011-09-26 15:03:19 +00:00
Peter Collingbourne
cfd2356180
Move VTable builder to AST
...
llvm-svn: 140510
2011-09-26 01:57:12 +00:00
Peter Collingbourne
1c593c6a38
Have CodeGenVTables::GenerateConstructionVTable use VTableLayout
...
llvm-svn: 140509
2011-09-26 01:57:04 +00:00
Peter Collingbourne
085095f1ac
Move vtable dumper call to VTableBuilder ctor
...
llvm-svn: 140508
2011-09-26 01:57:00 +00:00
Peter Collingbourne
3b118abd93
Implement VTableContext::createConstructionVTableLayout
...
llvm-svn: 140507
2011-09-26 01:56:55 +00:00
Peter Collingbourne
affe111ba5
Move all vtable layout data into new VTableLayout class
...
llvm-svn: 140506
2011-09-26 01:56:50 +00:00
Peter Collingbourne
cd3c3f4f3d
Move VTableComponent to header file
...
llvm-svn: 140505
2011-09-26 01:56:45 +00:00
Peter Collingbourne
5ee9ee490e
Move vtable component accessors to VTableContext
...
llvm-svn: 140504
2011-09-26 01:56:41 +00:00
Peter Collingbourne
71c26936a0
Remove CodeGenVTables::ComputeVTableRelatedInformation dependency on CodeGen
...
llvm-svn: 140503
2011-09-26 01:56:36 +00:00
Peter Collingbourne
a834166e48
Create a VTableContext class and start moving CodeGenVTables methods to it
...
llvm-svn: 140502
2011-09-26 01:56:30 +00:00
Peter Collingbourne
2d2595235d
Move VTT builder to AST
...
llvm-svn: 140501
2011-09-26 01:56:24 +00:00
Peter Collingbourne
66c3a83e09
Move BaseSubobject class to AST
...
llvm-svn: 140500
2011-09-26 01:56:16 +00:00
Peter Collingbourne
2000e4ead5
Remove CodeGenModule field from VTTBuilder
...
llvm-svn: 140499
2011-09-26 01:56:10 +00:00
Peter Collingbourne
d9eb79ca73
Make the VTTBuilder class independent of LLVM core
...
llvm-svn: 140498
2011-09-26 01:56:06 +00:00
David Blaikie
9c902b5502
Rename Diagnostic to DiagnosticsEngine as per issue 5397
...
llvm-svn: 140478
2011-09-25 23:23:43 +00:00
Sebastian Redl
12757ab4cb
Treat list-initialization of scalars as a first-class citizen in C++11.
...
Allow empty initializer lists for scalars, which mean value-initialization.
Constant evaluation for single-element and empty initializer lists for scalars.
Codegen for empty initializer lists for scalars.
Test case comes in next commit.
llvm-svn: 140459
2011-09-24 17:48:14 +00:00
David Blaikie
aa347f9392
Removing a bunch of dead returns/breaks after llvm_unreachables.
...
llvm-svn: 140407
2011-09-23 20:26:49 +00:00
David Blaikie
83d382b1ca
Switch assert(0/false) llvm_unreachable.
...
llvm-svn: 140367
2011-09-23 05:06:16 +00:00
Bill Wendling
8c4b716352
Don't remove filters.
...
It's not valid to remove filters from landingpad instructions, even if we catch
the type. The metadata won't be set up correctly.
Testcase is projects/llvm-test/SingleSource/UnitTests/EH/filter-2.cpp.
llvm-svn: 140335
2011-09-22 20:32:54 +00:00
Douglas Gregor
eb4089ad01
Only trigger the initialize-an-array-via-elementwise-copy/move code
...
generation when we're dealing with an implicitly-defined copy or move
constructor. And, actually set the implicitly-defined bit for
implicitly-defined constructors and destructors. Should fix self-host.
llvm-svn: 140334
2011-09-22 20:32:43 +00:00
Douglas Gregor
8a556ce512
Explicitly-defaulted copy/move constructors are not "implicit", but
...
they still need the logic to cope with array member
initialization. Fixes PR10720.
llvm-svn: 140302
2011-09-22 15:15:51 +00:00
John McCall
cbc038a6c3
ANSI C requires that a call to an unprototyped function type succeed
...
if the definition has a non-variadic prototype with compatible
parameters. Therefore, the default rule for such calls must be to
use a non-variadic convention. Achieve this by casting the callee to
the function type with which it is required to be compatible, unless
the target specifically opts out and insists that unprototyped calls
should use the variadic rules. The only case of that I'm aware of is
the x86-64 convention, which passes arguments the same way in both
cases but also sets a small amount of extra information; here we seek
to maintain compatibility with GCC, which does set this when calling
an unprototyped function.
Addresses PR10810 and PR10713.
llvm-svn: 140241
2011-09-21 08:08:30 +00:00
Richard Trieu
e4f3180fec
Change "ivar" to true for a boolean function argument. Since string literals are cast to true, this should no effect on behavior.
...
llvm-svn: 140231
2011-09-21 02:46:06 +00:00
Akira Hatanaka
ec11b4fa5a
Create a MipsTargetCodeGenInfo object for mips64/mips64el. The size of the
...
UnwindException structure is 32 for mips64.
llvm-svn: 140165
2011-09-20 18:30:57 +00:00
Akira Hatanaka
0486db08bd
Add a parameter to MipsTargetCodeGenInfo's constructor.
...
llvm-svn: 140161
2011-09-20 18:23:28 +00:00
Bill Wendling
5d7469e3e4
Don't assume that the clause is a GlobalVariable. It could be a constant.
...
llvm-svn: 140123
2011-09-20 00:40:19 +00:00
Eli Friedman
6b9c41ea68
Add list initialization for complex numbers in C. Essentially, this allows "_Complex float x = {1.0f, 2.0f};". See changes to docs/LanguageExtensions.html for a longer description.
...
<rdar://problem/9397672>.
llvm-svn: 140090
2011-09-19 23:17:44 +00:00
Bill Wendling
58e58fead1
The eh.selector intrinsic isn't used anymore. Replace the check here with a
...
check for the landingpad instruction instead. This check looks at each of the
clauses in the landingpad instruction. If it's a catch clause, it compares the
name directly with the global. If it's a filter clause, it has to look through
each value in the filer to see if any have the prefix.
llvm-svn: 140075
2011-09-19 22:08:36 +00:00
Peter Collingbourne
2dbb708b8a
OpenCL: introduce support for function scope __local variables
...
llvm-svn: 140068
2011-09-19 21:14:35 +00:00
Argyrios Kyrtzidis
27bf76d6d2
In CodeGenAction::ExecuteAction() use SourceManager::translateFileLineCol()
...
instead of getLocation() since we don't care about expanded macro arguments.
llvm-svn: 140061
2011-09-19 20:40:38 +00:00
Argyrios Kyrtzidis
e6e67deeed
Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.
...
It already works (and is useful with) macro locs as well.
llvm-svn: 140057
2011-09-19 20:40:19 +00:00
Bill Wendling
f0724e8e06
Throw the switch to convert clang to the new exception handling model!
...
This model uses the 'landingpad' instruction, which is pinned to the top of the
landing pad. (A landing pad is defined as the destination of the unwind branch
of an invoke instruction.) All of the information needed to generate the correct
exception handling metadata during code generation is encoded into the
landingpad instruction.
The new 'resume' instruction takes the place of the llvm.eh.resume intrinsic
call. It's lowered in much the same way as the intrinsic is.
llvm-svn: 140049
2011-09-19 20:31:14 +00:00
Devang Patel
5a54065c4f
Tighten check to match an ivar with corresponding property by using ObjCImplementationDecl.
...
Radar 10139522 - Part 1.
llvm-svn: 140038
2011-09-19 18:54:16 +00:00
John McCall
28a5b326e1
In apple-kext mode, use external linkage for explicit template instantiations
...
instead of internal linkage.
llvm-svn: 140030
2011-09-19 18:05:26 +00:00
Richard Smith
20104048be
PR10304: Do not call destructors for data members from union destructors. Prior to C++11, this
...
has no effect since any such destructors must be trivial, and in C++11 such destructors must not
be called.
llvm-svn: 139997
2011-09-18 12:11:43 +00:00
Bill Wendling
79a70e42b0
Refactor the load of the exception pointer and the exception selector from their
...
storage slot into helper functions.
llvm-svn: 139826
2011-09-15 18:57:19 +00:00
John McCall
99210dc9d1
Rewrite this loop to use partial destruction; I'm not sure it's
...
possible for that to matter right now, but eventually I think we'll
need to unify this better, and then it might. Also, use a more
efficient looping structure.
llvm-svn: 139788
2011-09-15 06:49:18 +00:00
John McCall
3b201b7d5f
Sorry, that assertion actually already exists.
...
llvm-svn: 139770
2011-09-15 01:55:23 +00:00
John McCall
8f8f8d67ea
We don't generate null initializer expressions anymore, and
...
we don't need to.
llvm-svn: 139769
2011-09-15 01:54:21 +00:00
Devang Patel
ecaf9ac0bb
Emit debug info for c++0x nullptr.
...
llvm-svn: 139752
2011-09-14 23:14:14 +00:00
Eric Christopher
19329c402f
Formatting.
...
llvm-svn: 139681
2011-09-14 01:10:50 +00:00
Eli Friedman
2dadd3ebee
Fix comment.
...
llvm-svn: 139678
2011-09-14 00:52:45 +00:00
Eric Christopher
47300ad6e4
Fix typo.
...
llvm-svn: 139668
2011-09-13 23:45:09 +00:00
John McCall
30e4efd458
Correctly generate IR for casted "builtin" functions, where
...
the builtin is really just a predefined declaration. These are
totally valid to cast.
llvm-svn: 139657
2011-09-13 23:05:03 +00:00
Eli Friedman
84d2812111
Re-commit r139643.
...
Make clang use Acquire loads and Release stores where necessary.
llvm-svn: 139650
2011-09-13 22:21:56 +00:00
Eli Friedman
acca089617
Revert r139643 while I look into it; it's breaking selfhost.
...
llvm-svn: 139648
2011-09-13 22:08:16 +00:00
Eli Friedman
f92b2e0714
Make clang use Acquire loads and Release stores where necessary.
...
llvm-svn: 139643
2011-09-13 21:31:32 +00:00
Eli Friedman
5be3e6ae9d
Turn off the generation of unaligned atomic load/store; I'm going to explicitly error out on such cases in the backend, at least for the moment.
...
llvm-svn: 139640
2011-09-13 20:48:30 +00:00
John McCall
4319286337
Refactoring, mostly to give ObjCPropertyDecls stronger invariants for
...
their semantic attributes and then to take advantage of that.
llvm-svn: 139615
2011-09-13 18:31:23 +00:00
Douglas Gregor
79a91418bd
Switch LangOptions over to a .def file that describes header of the
...
language options. Use that .def file to declare the LangOptions class
and initialize all of its members, eliminating a source of annoying
initialization bugs.
AST serialization changes are next up.
llvm-svn: 139605
2011-09-13 17:21:33 +00:00
John McCall
0bef0badf6
Don't use native atomics on ivars whose size is not a power of two,
...
even on architectures that support unaligned access (which is the
only way this is otherwise legal, given that ivars apparently do
not honor alignment attributes).
llvm-svn: 139590
2011-09-13 07:33:34 +00:00
John McCall
bdd8185e22
Handle reference properties correctly in the trivial-getter check.
...
llvm-svn: 139585
2011-09-13 06:00:03 +00:00
John McCall
0e5c086de4
Always emit bitfield properties using expression behavior, even if they're
...
atomic. This is probably something we should warn about.
llvm-svn: 139584
2011-09-13 05:36:29 +00:00
John McCall
f4528ae063
Unify the decision of how to emit property getters and setters into a
...
single code path. Use atomic loads and stores where necessary. Load and
store anything of the appropriate size and alignment with primitive
operations instead of going through the call.
llvm-svn: 139580
2011-09-13 03:34:09 +00:00
John McCall
b923ece770
Privatize the setter/getter call generation methods, plus some minor
...
modernization. No functionality change.
llvm-svn: 139555
2011-09-12 23:06:44 +00:00
Devang Patel
b0fa5b57ac
By popular demand, enumerate all builtin types!
...
llvm-svn: 139521
2011-09-12 18:50:21 +00:00
Devang Patel
33e097b699
Add an assert so that new builtins do not sneak without proper debug info.
...
llvm-svn: 139514
2011-09-12 18:24:46 +00:00
Devang Patel
98ca8aeca6
Fix debug info encodings for char16_t and char32_t.
...
llvm-svn: 139502
2011-09-12 17:11:58 +00:00
John McCall
6acaef9fe8
Modernize and comment; no functionality change.
...
llvm-svn: 139470
2011-09-10 09:30:49 +00:00
John McCall
7f16c42b9e
Simplify the generation of Objective-C setters, at least a little.
...
Use a more portable heuristic for deciding when to emit a single
atomic store; it's possible that I've lost information here, but
I'm not sure how much of the logic before was intentionally arch-specific
and how much was just not quite consistent.
llvm-svn: 139468
2011-09-10 09:17:20 +00:00
John McCall
2d637d2e79
Rename the ARC cast kinds to start with "ARC".
...
llvm-svn: 139466
2011-09-10 06:18:15 +00:00
John McCall
cd78e805e9
When converting a block pointer to an Objective-C pointer type, extend
...
the lifetime of the block by copying it to the heap, or else we'll get
a dangling reference because the code working with the non-block-typed
object will not know it needs to copy.
There is some danger here, e.g. with assigning a block literal to an
unsafe variable, but, well, it's an unsafe variable.
llvm-svn: 139451
2011-09-10 01:16:55 +00:00
Devang Patel
964d758d17
Emit debug info for wchar_t.
...
llvm-svn: 139443
2011-09-10 00:44:49 +00:00