Commit Graph

6116 Commits

Author SHA1 Message Date
Bill Wendling 6fe7b78db4 Update to new function attribute querying syntax.
llvm-svn: 164726
2012-09-26 21:59:46 +00:00
Nico Weber ca496f34a2 Add codegen support for the __debugbreak intrinsic.
llvm-svn: 164660
2012-09-26 05:40:16 +00:00
John McCall 82fb892019 When performing a ::delete of an object with a virtual destructor,
be sure to delete the complete object pointer, not the original
pointer.  This is necessary if the base being deleted is at a
non-zero offset in the complete object.  This is only required
for objects with virtual destructors because deleting an object
via a base-class subobject when the base does not have a virtual
destructor is undefined behavior.

Noticed while reviewing the last four years of cxx-abi-dev
activity.

llvm-svn: 164597
2012-09-25 10:10:39 +00:00
John McCall 0f999f329c In the MS ABI, ctors return 'this'. Patch by Dmitry Sokolov.
llvm-svn: 164592
2012-09-25 08:00:39 +00:00
John McCall b0433eeb2e During jump-scope checking, build an ExprWithCleanups immediately
into the enclosing scope;  this is a more accurate model but is
(I believe) unnecessary in my test case due to other flaws.
However, one of those flaws is now intentional:  blocks which
appear in return statements can be trivially observed to not
extend in lifetime past the return, and so we can allow a jump
past them.  Do the necessary magic in IR-generation to make
this work.

llvm-svn: 164589
2012-09-25 06:56:03 +00:00
Eric Christopher a52a6a8351 Mark the passed in "self" for a block as an object pointer so
that the backend can mark it as the representative pointer for
the block.

rdar://12001329

llvm-svn: 164418
2012-09-21 22:18:42 +00:00
Rafael Espindola 86792438dc Call CGM.SetLLVMFunctionAttributesForDefinition on thunks so that they get
attributes like uwtable. Without uwtable a stack unwinder would be unable
to go past the thunks.

llvm-svn: 164411
2012-09-21 20:39:32 +00:00
Bill Wendling e63adc5476 Update for encapsulating the "construct*AlignmentFromInt" methods.
llvm-svn: 164374
2012-09-21 16:07:49 +00:00
Jim Grosbach 11b6fe5e9c ARM: Use a dedicated intrinsic for vector bitwise select.
The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

llvm-svn: 164342
2012-09-21 00:18:30 +00:00
Jim Grosbach d3608f433a Tidy up. Trailing whitespace and 80 columns.
llvm-svn: 164341
2012-09-21 00:18:27 +00:00
Eric Christopher 173d91092a Grammar.
llvm-svn: 164260
2012-09-19 22:40:44 +00:00
Eric Christopher bdb1abb72a Update and expand comment.
llvm-svn: 164254
2012-09-19 22:01:42 +00:00
Eric Christopher 7106ec3ecb Handle a captured this for the debug information as well.
llvm-svn: 164253
2012-09-19 21:47:34 +00:00
Eric Christopher 0f143ae8af Fix awkward comment.
llvm-svn: 164252
2012-09-19 21:47:29 +00:00
Benjamin Kramer 6ca4210d3a Update clang for API change.
llvm-svn: 164218
2012-09-19 13:13:52 +00:00
Dmitri Gribenko a664e5b88f Use LLVM_DELETED_FUNCTION in place of 'DO NOT IMPLEMENT' comments.
llvm-svn: 163983
2012-09-15 20:20:27 +00:00
Craig Topper c9ee1d0287 Fix includes of llvm and clang files that used angle brackets.
llvm-svn: 163980
2012-09-15 18:47:51 +00:00
Eli Friedman 00755e9554 Fix thunk emission for covariant virtual functions in cases which require
both a virtual and a non-virtual offset. PR13832.

llvm-svn: 163866
2012-09-14 01:45:09 +00:00
Eli Friedman 48a3291675 Fix line endings.
llvm-svn: 163865
2012-09-14 01:19:01 +00:00
Eric Christopher 31ce693f93 Reapply:
Make clang emit a flag for DW_AT_object_pointer for the artificial
    args where it should (implicit first arguments). FileCheck-ize a
    test as well and update tests to take into account the object
    pointer flag.

    rdar://9797999

llvm-svn: 163755
2012-09-12 23:36:49 +00:00
Eric Christopher 48f782bbd2 Revert "Make clang emit a flag for DW_AT_object_pointer for the artificial"
this should be done on the subprogram, not the variable.

llvm-svn: 163733
2012-09-12 18:42:10 +00:00
Eric Christopher 1d292e59d3 Make clang emit a flag for DW_AT_object_pointer for the artificial
args where it should (implicit first arguments). FileCheck-ize a
test as well and update tests to take into account the object
pointer flag.

rdar://9797999

llvm-svn: 163668
2012-09-12 00:27:32 +00:00
Richard Smith c030bcdf62 Remove some redundancy from constant aggregate emission. No functionality change.
llvm-svn: 163595
2012-09-11 05:51:06 +00:00
Eric Christopher 13453d32ff Update comment and space.
llvm-svn: 163586
2012-09-11 01:36:56 +00:00
Eric Christopher 5296db0805 The type of the self and cmd variables should be artificial. (Note
that the types aren't artificial the args are, but this is currently
represented by an artificial type.)

Found by inspection.

llvm-svn: 163585
2012-09-11 01:36:54 +00:00
Dmitri Gribenko 76bb5cabfa Remove redundant semicolons which are null statements.
llvm-svn: 163546
2012-09-10 21:20:09 +00:00
Richard Smith 639b8d05dd When a bad UTF-8 encoding or bogus escape sequence is encountered in a
string literal, produce a diagnostic pointing at the erroneous character
range, not at the start of the literal.

llvm-svn: 163459
2012-09-08 07:16:20 +00:00
Richard Smith 4d1458ed38 -fcatch-undefined-behavior: Factor emission of the creation of, and branch to,
the trap BB out of the individual checks and into a common function, to prepare
for making this code call into a runtime library. Rename the existing EmitCheck
to EmitTypeCheck to clarify it and to move it out of the way of the new
EmitCheck.

llvm-svn: 163451
2012-09-08 02:08:36 +00:00
John McCall cfa4e9bdf3 In ARC, if we're emitting assembly markers for calls to
objc_retainAutoreleasedReturnValue, we need to also be killing
them during return peepholing.  Make sure we recognize an
intervening bitcast, but more importantly, assert if we can't
find the asm marker at all.  rdar://problem/12133032

llvm-svn: 163431
2012-09-07 23:30:50 +00:00
Derek Schuff 09338a250a Use custom ABIInfo for le32/PNaCl argument codegen
This patch uses a new ABIInfo implementation specific to the le32
target, rather than falling back to DefaultABIInfo. Its behavior is
basically the same, but it also allows the regparm argument attribute.
It also includes basic tests for argument codegen and attributes.

llvm-svn: 163333
2012-09-06 17:37:28 +00:00
Aaron Ballman 9c00446d2a Fixing the return type information for objc_sync_enter and objc_sync_exit. Patch thanks to Joe Ranieri!
llvm-svn: 163330
2012-09-06 16:44:16 +00:00
Roman Divacky e637711ae0 Dont cast away const needlessly. Found by gcc48 -Wcast-qual.
llvm-svn: 163325
2012-09-06 15:59:27 +00:00
Chad Rosier 7cf5a44836 Update for r163231.
llvm-svn: 163232
2012-09-05 19:01:07 +00:00
Jin-Gu Kang 1a5e423602 Changing of type checking order on InitListExpr
- UnionType is checked eariler than RecordType.

llvm-svn: 163202
2012-09-05 08:37:43 +00:00
Chad Rosier eb31ef0577 [ms-inline asm] Set the inline assembly dialect in CodeGen.
llvm-svn: 163178
2012-09-04 23:08:24 +00:00
Chad Rosier 85fff2ac11 [ms-inline asm] Remove the Inline Asm Non-Standard Dialect attribute. This
implementation does not co-exist well with how the sideeffect and alignstack
attributes are handled.

llvm-svn: 163173
2012-09-04 22:23:54 +00:00
Chad Rosier 7ea9ce7e64 Minor cleanup to improve code readability. No functional change intended.
llvm-svn: 163161
2012-09-04 19:50:17 +00:00
Joao Matos 566359c0bf Revert r163083 per chandlerc's request.
llvm-svn: 163149
2012-09-04 17:49:35 +00:00
Logan Chien c6fd820937 Rename ANDROIDEABI to Android.
Most of the code guarded with ANDROIDEABI are not
ARM-specific, and having no relation with arm-eabi.
Thus, it will be more natural to call this
environment "Android" instead of "ANDROIDEABI".

Note: We are not using ANDROID because several projects
are using "-DANDROID" as the conditional compilation
flag.

llvm-svn: 163088
2012-09-02 09:30:11 +00:00
Joao Matos c32a7e4d8e Implemented parsing and AST support for the MS __leave exception statement. Also a minor fix to __except printing in StmtPrinter.cpp. Thanks to Aaron Ballman for review.
llvm-svn: 163083
2012-09-02 03:45:41 +00:00
Joao Matos e9a3ed4d71 Normalize line endings of r163013 (part 2).
llvm-svn: 163032
2012-08-31 22:18:20 +00:00
Joao Matos dc86f94f62 Improved MSVC __interface support by adding first class support for it, instead of aliasing to "struct" which had some incorrect behaviour. Patch by David Robins.
llvm-svn: 163013
2012-08-31 18:45:21 +00:00
Eli Friedman 34866c7719 Change the representation of builtin functions in the AST
(__builtin_* etc.) so that it isn't possible to take their address.
Specifically, introduce a new type to represent a reference to a builtin
function, and a new cast kind to convert it to a function pointer in the
operand of a call.  Fixes PR13195.

llvm-svn: 162962
2012-08-31 00:14:07 +00:00
Eli Friedman 504f9a2872 Make alignment computation for pointer values for builtins handle
non-pointer types with a pointer representation correctly. PR13660.

llvm-svn: 162862
2012-08-29 21:21:11 +00:00
Chad Rosier 649dfc317d [ms-inline asm] Have MSAsmStmts use the generic EmitAsmStmt codegen function.
llvm-svn: 162796
2012-08-28 21:11:24 +00:00
Peter Collingbourne ee0502d551 CUDA: give correct address space to globals declared in functions
llvm-svn: 162787
2012-08-28 20:37:10 +00:00
Chad Rosier 6051bb94c0 [ms-inline asm] Rename EmitGCCAsmStmt to EmitAsmStmt and have it accept
AsmStmts.  This function is only used by GCCAsmStmts, however. Constraints need
to be properly computed before MSAsmStmts can use EmitAsmStmt.  No functional
change intended.

llvm-svn: 162776
2012-08-28 18:54:39 +00:00
Michael Liao 48f498fccf Fix PR13704
- The increment needs to be signed value to preserve the original value when
  its data type is larger than 64-bit integer.

llvm-svn: 162766
2012-08-28 16:55:13 +00:00
Chad Rosier 6100ae120c [ms-inline asm] Add virtual function, getClobber, that returns a StringRef.
More work towards unifying asm stmt codegen.

llvm-svn: 162712
2012-08-27 23:47:56 +00:00
Chad Rosier d9fb09a91b [ms-inline asm] Rename getClobber to getClobberStringLiteral. No functional
change intended.

llvm-svn: 162710
2012-08-27 23:28:41 +00:00