| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
llvm-svn: 56830
|
| |
|
|
|
|
|
|
|
|
|
|
| |
- Provides a basic primitive to jump to an arbitrary basic block,
through the finally code.
- Only used for return statements and rethrow currently. Still need
to handle break, continue and goto.
- Code still needs to be shuffled around to live elsewhere.
llvm-svn: 56827
|
| |
|
|
|
|
| |
Comment exception-handling code generation strategy.
llvm-svn: 56763
|
| |
|
|
| |
llvm-svn: 56762
|
| |
|
|
|
|
| |
readable and to generate more readable IR.
llvm-svn: 56758
|
| |
|
|
|
|
|
| |
- This should be rejected by sema (IMHO) but that needs some
investigation.
llvm-svn: 56756
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- There is no need to branch on the rethrow variable to determine if
we need to call objc_exception_try_exit. We know whether an
exception was thrown, so just branch to a different target if we
want to skip the try_exit.
This is a slight semantic departure from gcc, but only for throwing
nil, which is undefined (and for which gcc emits broken code).
- Also fixes a bug in current code which was calling try_exit too
many times when an exception was uncaught (but there were some
handlers).
Fix bug introduced in prev. commit, the type of the @catch parameter
was uninitialized.
llvm-svn: 56754
|
| |
|
|
| |
llvm-svn: 56753
|
| |
|
|
|
|
| |
of the function.
llvm-svn: 56752
|
| |
|
|
|
|
|
|
|
|
|
| |
when there are no @catch blocks.
Also, eliminated unneeded alloca for the rethrow object.
Also, avoid generating code to rethrow exception if the exception will
trivially always be caught.
llvm-svn: 56751
|
| |
|
|
|
|
| |
(smaller) size == garbage on stack == heisenbugs.
llvm-svn: 56750
|
| |
|
|
|
|
|
|
|
|
|
| |
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn
Return attributes use 0 as the index.
Function attributes use ~0U as the index.
llvm-svn: 56705
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g
This sets the stage
- to implement function notes as function attributes and
- to distinguish between function attributes and return value attributes.
llvm-svn: 56623
|
| |
|
|
| |
llvm-svn: 56547
|
| |
|
|
|
|
| |
Also, "simple" getter synthesis no longer uses temporary AST objects.
llvm-svn: 56544
|
| |
|
|
|
|
|
|
|
|
| |
- Add CodeGenFunction::{EmitReturnOfRValue, EmitIvarOffset}
- Factor EmitLValueForIvar out of EmitObjCIvarRefLValue.
No non-error functionality change (some unsupported errors are
degraded to asserts for the time being).
llvm-svn: 56543
|
| |
|
|
|
|
| |
implementing property access.
llvm-svn: 56542
|
| |
|
|
| |
llvm-svn: 56538
|
| |
|
|
|
|
| |
Rename to match changes done on llvm side.
llvm-svn: 56537
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Enables use of ABIArgInfo::Expand when needed. This greatly
improves our x86 ABI compatibility.
- As the infrastructure for target specific ABI handling isn't built
yet, this change means ABI compatibility on other platforms is once
again broken in a different way than before.
- Upcoming: Figure out how to refactor ABI handling into
targets. More documentation.
llvm-svn: 56293
|
| |
|
|
| |
llvm-svn: 56291
|
| |
|
|
|
|
|
|
|
| |
Ensure that ABIArgInfo::Default implementation for aggregrate types
is sensible (StructRet on return and ByVal on arguments).
No functionality change.
llvm-svn: 56289
|
| |
|
|
|
|
| |
- No functionality change.
llvm-svn: 56269
|
| |
|
|
| |
llvm-svn: 56102
|
| |
|
|
| |
llvm-svn: 56101
|
| |
|
|
| |
llvm-svn: 56100
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
value).
- Added ABIArgInfo::ByVal (mostly supported) and ABIArgInfo::Expand
(asserted out).
- Added classifyArgumentType which currently just uses
ABIArgInfo::Default or ByVal. This nearly matches old behavior, but
we now set ByVal in a few situations we may have left it off before
(on complex, for example).
llvm-svn: 56086
|
| |
|
|
|
|
|
|
|
| |
no method declaration was found.
- This was allowing arrays to pass "by value" among other things.
Add assert in CodeGen that arguments cannot have array type.
llvm-svn: 56080
|
| |
|
|
|
|
|
|
| |
- As a test, enable basic usage for some common x86-32 cases. This
increases our x86-32 compliance (on other targets our compliance
will just be broken in a different way).
llvm-svn: 56051
|
| |
|
|
|
|
|
|
|
|
|
|
| |
type of a call.
Change NeXT runtime to use this instead of trying to bitcasting
internally (which doesn't respect the ABI).
Fix subtle bug, use of ConvertTypeRecursive instead of ConvertType is
bad inside GetFunctionType.
llvm-svn: 56050
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
- Added CodeGenTypes::GetFunctionType, taking a CGFunctionInfo.
- Updated Obj-C runtimes to use this instead of rolling the
llvm::FunctionType by hand.
- Killed CodeGenTypes::{ConvertReturnType, DecodeArgumentTypes}.
Add ABIArgInfo class to encapsulate ABI decision of how to lower types
to LLVM.
- Will move to target sometime soon.
llvm-svn: 56047
|
| |
|
|
|
|
|
| |
to LLVM.
- Will move to target sometime soon.
llvm-svn: 56046
|
| |
|
|
|
|
| |
which represents a 'condition' declaration, e.g: "if (int x=0) {...}".
llvm-svn: 56045
|
| |
|
|
|
|
|
|
| |
- Realized these functions will eventually need access to more data,
moved to CodeGenModule. Eventually they should probably live
together in some other helper class.
llvm-svn: 56039
|
| |
|
|
|
|
|
|
| |
- Move actual param attr list creation to
CodeGenFunction::ConstructParamAttrList.
- Make ReturnTypeUsesSret static.
llvm-svn: 56038
|
| |
|
|
|
|
| |
- Hook so NeXT runtime doesn't depend on ABI.
llvm-svn: 56034
|
| |
|
|
|
|
| |
- Factor out EmitFunction{Pro,Epi}log
llvm-svn: 56031
|
| |
|
|
|
|
| |
StartObjCMethod.
llvm-svn: 56030
|
| |
|
|
|
|
|
| |
- For the time being this means our emitted code is somewhat worse,
especially for aggregates. This will be fixed.
llvm-svn: 56013
|
| |
|
|
|
|
| |
- No functionality change.
llvm-svn: 56010
|
| |
|
|
| |
llvm-svn: 55994
|
| |
|
|
| |
llvm-svn: 55991
|
| |
|
|
| |
llvm-svn: 55984
|
| |
|
|
| |
llvm-svn: 55983
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Add CodeGenFunction::EmitAnyExprToTemp
o Like EmitAnyExpr, but emits aggregates to a temporary location if
none is available. Seems like this should be simpler (even aside
from using first class aggregates).
- Killed CodeGenFunction::EmitCallArg (just append the pair)
- Conversion of RValues to actual call arguments is now isolated in
CodeGenFunction::EmitCall.
llvm-svn: 55970
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
aliases.
- Attributes specific to a definition are only set when the
definition is seen.
- Alias generation is delayed until the end of the module; necessary
since the alias may reference forward.
- Fixes: PR2743, <rdr://6140807&6094512>
- Improves: <rdr://6095112> (added XFAIL)
Also, print module on verification failures.
llvm-svn: 55966
|
| |
|
|
|
|
|
|
|
| |
- Add CGCall.h for dealing with ABI issues related to calls.
- Add CGFunctionInfo and CGCallInfo for capturing ABI relevant
information about functions and calls.
- Isolate LLVM parameter attribute handling inside CGCall.cpp
llvm-svn: 55963
|
| |
|
|
|
|
| |
a many-to-one relationship between TagDecl's and types.
llvm-svn: 55870
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RecordDecls, as opposed to creating a single RecordDecl and reusing it.
This change effects both RecordDecls and CXXRecordDecls, but does not effect EnumDecls (yet).
The motivation of this patch is as follows:
- Capture more source information, necessary for refactoring/rewriting clients.
- Pave the way to resolve ownership issues with RecordDecls with the forthcoming
addition of DeclGroups.
Current caveats:
- Until DeclGroups are in place, we will leak RecordDecls not explicitly
referenced by the AST. For example:
typedef struct { ... } x;
The RecordDecl for the struct will be leaked because the TypedefDecl doesn't
refer to it. This will be solved with DeclGroups.
- This patch also (temporarily) breaks CodeGen. More below.
High-level changes:
- As before, TagType still refers to a TagDecl, but it doesn't own it. When
a struct/union/class is first referenced, a RecordType and RecordDecl are
created for it, and the RecordType refers to that RecordDecl. Later, if
a new RecordDecl is created, the pointer to a RecordDecl in RecordType is
updated to point to the RecordDecl that defines the struct/union/class.
- TagDecl and RecordDecl now how a method 'getDefinition()' to return the
TagDecl*/RecordDecl* that refers to the TagDecl* that defines a particular
enum/struct/class/union. This is useful from going from a RecordDecl* that
defines a forward declaration to the RecordDecl* that provides the actual
definition. Note that this also works for EnumDecls, except that in this case
there is no distinction between forward declarations and definitions (yet).
- Clients should no longer assume that 'isDefinition()' returns true from a
RecordDecl if the corresponding struct/union/class has been defined.
isDefinition() only returns true if a particular RecordDecl is the defining
Decl. Use 'getDefinition()' instead to determine if a struct has been defined.
- The main changes to Sema happen in ActOnTag. To make the changes more
incremental, I split off the processing of enums and structs et al into two
code paths. Enums use the original code path (which is in ActOnTag) and
structs use the ActOnTagStruct. Eventually the two code paths will be merged,
but the idea was to preserve the original logic both for comparison and not to
change the logic for both enums and structs all at once.
- There is NO CHAINING of RecordDecls for the same RecordType. All RecordDecls
that correspond to the same type simply have a pointer to that type. If we
need to figure out what are all the RecordDecls for a given type we can build
a backmap.
- The diff in CXXRecordDecl.[cpp,h] is actually very small; it just mimics the
changes to RecordDecl. For some reason 'svn' marks the entire file as changed.
Why is CodeGen broken:
- Codegen assumes that there is an equivalence between RecordDecl* and
RecordType*. This was true before because we only created one RecordDecl* for
a given RecordType*, but it is no longer true. I believe this shouldn't be too
hard to change, but the patch was big enough as it is.
I have tested this patch on both the clang test suite, and by running the static analyzer over Postgresql and a large Apple-internal project (mix of Objective-C and C).
llvm-svn: 55839
|
| |
|
|
|
|
|
|
| |
where RecordDecl or CXXRecordDecl was constructed, always with an argument of 'NULL' for the previous declaration.
The motivation behind this change is that chaining the RecordDecls is simply unnecessary. Once we create multiple RecordDecls for the same struct/union/class, clients that care about all the declarations of the same struct can build a back map by seeing which Decls refer to the same RecordType.
llvm-svn: 55821
|