aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen
AgeCommit message (Collapse)AuthorFilesLines
2012-11-30Fixing a precedence issue with my previous commit.Aaron Ballman1-1/+1
llvm-svn: 169041
2012-11-30Fixing an MSVC warning about an unsafe mixture of Boolean and unsigned types ↵Aaron Ballman1-1/+1
in a logical operator. llvm-svn: 169037
2012-11-29Fix a small calling-convention bug for x86-32. PR14453.Eli Friedman1-2/+8
llvm-svn: 168959
2012-11-29This patch exposes to Clang users three more sanitizers are experimental ↵Alexey Samsonov1-8/+24
features of ASan: 1) init-order sanitizer: initialization-order checker. Status: usable, but may produce false positives w/o proper blacklisting. 2) use-after-return sanitizer Status: implemented, but heavily understed. Should be optional, as it significanlty slows program down. 3) use-after-scope sanitizer Status: in progress. llvm-svn: 168950
2012-11-29Merge function types in C.Rafael Espindola1-1/+9
Among other differences, GCC accepts typedef int IA[]; typedef int A10[10]; static A10 *f(void); static IA *f(void); void g(void) { (void)sizeof(*f()); } but clang used to reject it with: invalid application of 'sizeof' to an incomplete type 'IA' (aka 'int []') The intention of c99's 6.2.7 seems to be that we should use the composite type and accept as gcc does. Doing the type merging required some extra fixes: * Use the type from the function type in initializations, even if an parameter is available. * Fix the merging of the noreturn attribute in function types. * Make CodeGen handle the fact that an parameter type can be different from the corresponding type in the function type. llvm-svn: 168895
2012-11-28objective-C blocks: Make sure that identical logic is usedFariborz Jahanian3-6/+5
in deciding a copy/dispose field is needed in a byref structure and when generating the copy/dispose helpers. In certain cases, these fields were being added but no copy/dispose was being generated. This was uncovered in ARC, but not in MRR. // rdar://12759433 llvm-svn: 168825
2012-11-28ABI: comments from Eli on r168820.Manman Ren1-0/+2
rdar://12723368 llvm-svn: 168821
2012-11-28ABI: modify CreateCoercedLoad and CreateCoercedStore to not use load or store ofManman Ren1-12/+12
the original parameter or return type. Since we do not accurately represent the data fields of a union, we should not directly load or store a union type. As an exmple, if we have i8,i8, i32, i32 as one field type and i32,i32 as another field type, the first field type will be chosen to represent the union. If we load with the union's type, the 3rd byte and the 4th byte will be skipped. rdar://12723368 llvm-svn: 168820
2012-11-28[asan] Split AddressSanitizer into two passes (FunctionPass, ModulePass), ↵Kostya Serebryany1-1/+2
Clang part. llvm-svn: 168782
2012-11-27objective-C arc: load of a __weak object happens via call toFariborz Jahanian2-6/+17
objc_loadWeak. This retains and autorelease the weakly-refereced object. This hidden autorelease sometimes makes __weak variable alive even after the weak reference is erased, because the object is still referenced by an autorelease pool. This patch overcomes this behavior by loading a weak object via call to objc_loadWeakRetained(), followng it by objc_release at appropriate place, thereby removing the hidden autorelease. // rdar://10849570 llvm-svn: 168740
2012-11-27Add -fsanitize=integer for reporting suspicious integer behaviors.Will Dietz1-22/+52
Introduces new sanitizer "unsigned-integer-overflow". llvm-svn: 168701
2012-11-27This patch addresses an incompatibility relative to the 64-bit PowerPCBill Schmidt1-0/+3
ELF ABI. Complex values are to be passed in registers as though the real and imaginary parts were passed as separate parameters. Prior to this patch, complex values were passed as byval aggregates. It turns out that specifying getDirect() for all complex types when classifying the argument type results in the desired behavior. The new Clang test case verifies that the correct LLVM IR is generated for caller and callee for each of the underlying types for _Complex. llvm-svn: 168673
2012-11-26MSPGCC renamed ISR vectors from vector_<address> to __isr_<number>. This ↵Anton Korobeynikov1-2/+2
patch makes Clang reflect this scheme. Patch by Job Noorman! llvm-svn: 168598
2012-11-23PR14306: Move -fbounds-checking to -fsanitize=bounds.Joey Gouly1-4/+2
llvm-svn: 168510
2012-11-20Update method calls to the new interface re r168354.Bill Wendling2-3/+4
llvm-svn: 168355
2012-11-17Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64.Benjamin Kramer1-5/+4
Also fixes a bit/byte mismatch when checking if a target supports atomic ops of a certain size. llvm-svn: 168260
2012-11-16A step towards sorting out handling of triviality of special members in C++11.Richard Smith4-5/+5
Separate out the notions of 'has a trivial special member' and 'has a non-trivial special member', and use them appropriately. These are not opposites of one another (there might be no special member, or in C++11 there might be a trivial one and a non-trivial one). The CXXRecordDecl predicates continue to produce incorrect results, but do so in fewer cases now, and they document the cases where they might be wrong. No functionality changes are intended here (they will come when the predicates start producing the right answers...). llvm-svn: 168119
2012-11-15Make sure CodeGenTypes correctly reconverts function types. Fixes PR14355, ↵Eli Friedman1-1/+11
a crash in IR generation. llvm-svn: 168112
2012-11-15Simplify code. No functionality change.Benjamin Kramer1-18/+12
llvm-svn: 168047
2012-11-15Use empty parens for empty function parameter list instead of '(void)'.Dmitri Gribenko4-6/+6
llvm-svn: 168041
2012-11-15Make -ffp-contract a codegen option, rather than a laguage option. This makesLang Hames2-5/+5
more sense anyway - it determines how expressions are codegen'd. It also ensures that -ffp-contract=fast has the intended effect when compiling LLVM IR. llvm-svn: 168027
2012-11-14When evaluating variably modified types for function parameters, dig out theEli Friedman1-1/+10
type as written from the ParmVarDecl; it's unclear whether the standard (C99 6.9.1p10) requires this, but we're following the precedent set by gcc, and hopefully nobody will ever ask about this again. PR9559 / <rdar://problem/12621983>. llvm-svn: 167985
2012-11-14The ObjC++-to-C++ personality trick is only necessary on NeXT runtimes,John McCall1-4/+5
which is not coincidentally the only place it works, either (because of how it tests for EH_TYPE symbols). llvm-svn: 167935
2012-11-14fixes a buildbot failure.Fariborz Jahanian1-0/+1
llvm-svn: 167934
2012-11-14Fix 80-column violation.Fariborz Jahanian1-3/+5
llvm-svn: 167932
2012-11-14objective-C blocks: Provide layout map for byrefFariborz Jahanian6-78/+203
variables captured in a block. // rdar://12184410 llvm-svn: 167931
2012-11-14Move some GNUStep-specific code out of CGObjCGNU.John McCall1-22/+25
Patch by Jonathan Schleifer. llvm-svn: 167925
2012-11-13Revert "Use the 'count' attribute instead of the 'upper_bound' attribute."Eric Christopher1-12/+9
temporarily since it breaks the gdb bots. This reverts commit r167807/30305bec25cac981c6d4a3b8be004401310a82a7. llvm-svn: 167887
2012-11-13Use the 'count' attribute instead of the 'upper_bound' attribute.Bill Wendling1-9/+12
If we have a type 'int a[1]' and a type 'int b[0]', the generated DWARF is the same for both of them because we use the 'upper_bound' attribute. Instead use the 'count' attrbute, which gives the correct number of elements in the array. <rdar://problem/12566646> llvm-svn: 167807
2012-11-13Fix IR generation for bool on PPC (and any other target where bool is not 8 ↵Eli Friedman1-5/+7
bits in memory). PR11777. llvm-svn: 167802
2012-11-10objective-C blocks: Change BLOCK_HAS_EXTENDED_LAYOUT to be 1<<31.Fariborz Jahanian1-2/+2
lower 24bit is currently being used. llvm-svn: 167678
2012-11-09Turn FrontendInputFile into an immutable class and have it also acceptArgyrios Kyrtzidis1-1/+1
a memory buffer instead of only a filename. llvm-svn: 167627
2012-11-09Implement -mstrict-align using '-backend-option -arm-strict-align' as this savesChad Rosier1-1/+0
us from having to make any backend changes. llvm-svn: 167623
2012-11-09[driver] Add a -mstrict-align compiler option for ARM targets.Chad Rosier1-0/+1
rdar://12340498 llvm-svn: 167619
2012-11-07When deciding whether to convert an array construction loop into a memcpy, lookRichard Smith1-11/+4
at whether the *selected* constructor would be trivial rather than considering whether the array's element type has *any* non-trivial constructors of the relevant kind. llvm-svn: 167562
2012-11-07objective-C blocks: bring back the CharUnit patch forFariborz Jahanian1-45/+46
captured block variable layout meta-data. No intended change in functionality. llvm-svn: 167549
2012-11-07Fix the Objective-C exception rethrow from cleanups (GNU runtimes). Note thatDavid Chisnall3-7/+9
a bug in the inliner still causes the wrong thing to happen at -O2 and above (PR14116). llvm-svn: 167534
2012-11-06Put something sane in the DWARF offset field for bitfield ObjC ivars.Eli Friedman3-6/+29
This is useful because unnamed bitfields can have effects on the offsets which are not otherwise reflected in the DWARF information. <rdar://problem/12629719> llvm-svn: 167503
2012-11-06Implement codegen for init_priority attribute properly - make sure itAnton Korobeynikov2-19/+48
works between the modules. No functionality change on Darwin/Windows. This fixes PR11480. llvm-svn: 167496
2012-11-06Back out 167431+167437+167487; I didn't realize how incomplete our testEli Friedman4-135/+141
coverage of this code is. llvm-svn: 167495
2012-11-06Fix a silly mistake in r167437.Eli Friedman1-2/+2
llvm-svn: 167487
2012-11-06Cleanup: 80-column violationManman Ren1-4/+6
llvm-svn: 167476
2012-11-06ARM byval: when type alignment is bigger than ABI alignment, instead ofManman Ren1-5/+4
disabling byval, we set realign to true. It will perform an aligned alloca, and call memcpy to copy the byval argument to the local variable. Change the size threshold back to 64 bytes. rdar://12596507 llvm-svn: 167440
2012-11-06Propagate CharUnits through CGObjCMac.cpp.Eli Friedman1-84/+78
llvm-svn: 167437
2012-11-06Minor fix to ObjC layout bitmap metadata. Found while I was trying toEli Friedman1-1/+1
refactor the code. llvm-svn: 167436
2012-11-06Classify the INT_MIN/-1 check as -fsanitize=signed-integer-overflow, not as ↵Richard Smith1-9/+17
-fsanitize=divide-by-zero. llvm-svn: 167433
2012-11-06Propagate CharUnits into ObjC CodeGen. No intended functional change.Eli Friedman4-66/+66
llvm-svn: 167431
2012-11-05Have the parser initialize Sema before it consumes the firstDouglas Gregor1-1/+3
token. This is important because the first token could actually be after an #include that triggers a module import, which might use either Sema or the AST consumer before it would have been initialized. llvm-svn: 167423
2012-11-05ARM byval: when type alignment is bigger than ABI alignment, we can't guaranteeManman Ren1-2/+10
the type alignment of the byval argument. This patch will disable byval in this case, it also increases the size threshold for turning on byval. A backend fix will be attempted. rdar://12596507 llvm-svn: 167416
2012-11-05Use the individual -fsanitize=<...> arguments to control which of the UBSanRichard Smith5-42/+52
checks to enable. Remove frontend support for -fcatch-undefined-behavior, -faddress-sanitizer and -fthread-sanitizer now that they don't do anything. llvm-svn: 167413