Commit Graph

13341 Commits

Author SHA1 Message Date
Benjamin Kramer bbb5deace6 Factor code. No functionality change.
llvm-svn: 102262
2010-04-24 20:19:58 +00:00
Anders Carlsson 7d3360f123 Add base paths for CK_BaseToDerived and CK_BaseToDerivedMemberPointer.
llvm-svn: 102261
2010-04-24 19:36:51 +00:00
Anders Carlsson b78fecaf6f Add base paths to CK_UncheckedDerivedToBase and CK_DerivedToBaseMemberPointer.
llvm-svn: 102260
2010-04-24 19:22:20 +00:00
Anders Carlsson a70cff624e Actually produce base paths for CastExprs of kind CK_DerivedToBase.
llvm-svn: 102259
2010-04-24 19:06:50 +00:00
Anders Carlsson 5d270e8fa6 Add BasePath arguments to all cast expr constructors.
llvm-svn: 102258
2010-04-24 18:38:56 +00:00
Daniel Dunbar df3d1c2d1f Driver/Darwin: Fix Objective-C non-fragile ABI and dispatch method defaults, which were wrong in numerous places.
- <rdar://problem/7903449>

llvm-svn: 102257
2010-04-24 18:37:41 +00:00
Douglas Gregor 53ce178cef When we take the address of a declaration to bind it to a non-type
template parameter, by sure to mark that declaration as
"referenced". The Boost.Iterator library now passes all tests.

llvm-svn: 102256
2010-04-24 18:20:53 +00:00
Daniel Dunbar fca18c1b41 NeXT: Clean up dispatch method policy selection.
- Replace -cc1 level -fobjc-legacy-dispatch with -fobjc-dispatch-method={legacy,non-legacy,mixed}.

 - Lift "mixed" vs "non-mixed" policy choice up to driver level, instead of being buried in CGObjCMac.cpp.

 - No intended functionality change.

llvm-svn: 102255
2010-04-24 17:56:46 +00:00
Daniel Dunbar db059592fe Simplify.
llvm-svn: 102254
2010-04-24 17:56:39 +00:00
Anders Carlsson 7afe4245e2 Pass the base specifiers through to CheckDerivedToBaseConversion. No functionality change yet.
llvm-svn: 102250
2010-04-24 17:11:09 +00:00
Anders Carlsson 0c509eeac7 CastExpr should not hold a pointer to the base path. More cleanup.
llvm-svn: 102249
2010-04-24 16:57:13 +00:00
Douglas Gregor ba41d01b59 Be more careful around dependent nested-name-specifiers, complaining
when they are not complete (since we could not match them up to
anything) and ensuring that enum parsing can cope with dependent
elaborated-type-specifiers. Fixes PR6915 and PR6649.

llvm-svn: 102247
2010-04-24 16:38:41 +00:00
Anders Carlsson b34f88205f isValue is set to false by default.
llvm-svn: 102246
2010-04-24 16:36:20 +00:00
Anders Carlsson 7d96cd7799 Rename InheritancePath to BasePath, rename CastExpr::CXXBaseVector to CXXBaseSpecifierArray. More to come.
llvm-svn: 102245
2010-04-24 16:34:21 +00:00
Douglas Gregor bbdf20acd0 Keep track of when DependentNameTypes have no associated keyword
(e.g., no typename, enum, class, etc.), e.g., because the context is
one that is known to refer to a type. Patch from Enea Zaffanella!

llvm-svn: 102243
2010-04-24 15:35:55 +00:00
Benjamin Kramer fb278831aa Update prototypes.
llvm-svn: 102241
2010-04-24 08:26:17 +00:00
Dan Gohman 7905d187e6 Fix a place in inline asm lowering which was creating a TruncInst with a
pointer operand. This fixes an abort on
MultiSource/Applications/ClamAV/libclamav_mbox.c.

llvm-svn: 102238
2010-04-24 04:55:02 +00:00
John McCall b9467b6c9a Recommit r102215, this time being more careful to only set the "principal
declaration" (i.e. the only which will actually be looked up) to have the
non-member-operator bit.

llvm-svn: 102231
2010-04-24 01:30:58 +00:00
Nick Lewycky 784fad7a41 Teach clang -fixit to modify files in-place, or -fixit=suffix to create new
files with the additional suffix in the middle.

llvm-svn: 102230
2010-04-24 01:30:46 +00:00
Devang Patel 8471593892 Revert accidental check-in.
llvm-svn: 102226
2010-04-24 00:49:16 +00:00
Devang Patel f8b55d478c Revert r102215. This causes clang crash while compiling a test case from gdb testsuite.
llvm-svn: 102224
2010-04-24 00:40:35 +00:00
Fariborz Jahanian 0731763efc With -fno-constant-cfstrrings, class NSConstantString
must be there or it is error (Next runtime).

llvm-svn: 102223
2010-04-23 23:19:04 +00:00
Douglas Gregor e11ee11068 Rework Parser-Sema interface for Objective-C @catch exception object
arguments. Rather than having the parser call ActOnParamDeclarator
(which is a bit of a hack), call a new ActOnObjCExceptionDecl
action. We'll be moving more functionality into this handler to
perform earlier checking of @catch.

llvm-svn: 102222
2010-04-23 23:01:43 +00:00
Douglas Gregor 96c79498fb Improve the AST representation of Objective-C @try/@catch/@finally
statements. Instead of the @try having a single @catch, where all of
the @catch's were chained (using an O(n^2) algorithm nonetheless),
@try just holds an array of its @catch blocks. The resulting AST is
slightly more compact (not important) and better represents the actual
language semantics (good).

llvm-svn: 102221
2010-04-23 22:50:49 +00:00
Fariborz Jahanian d3fa70181d More -fno-constant-cfstrings API work.
llvm-svn: 102219
2010-04-23 22:33:39 +00:00
Anders Carlsson 9759793855 Add an InheritancePath parameter to the ImplicitCastExpr constructor.
llvm-svn: 102218
2010-04-23 22:18:37 +00:00
John McCall 67b29a26df Transition the last acceptable-result filter kind in LookupResult over to use
a simple IDNS mask by introducing a namespace for non-member operators.

llvm-svn: 102215
2010-04-23 21:37:18 +00:00
Argyrios Kyrtzidis 8d7bdba08c Make Parser::ConsumeAndStoreUntil() more consistent with Parser::SkipUntil().
ConsumeAndStoreUntil would stop at tok::unknown when caching an inline method
definition while SkipUntil would go past it while parsing the method.

Fixes PR 6903.

llvm-svn: 102214
2010-04-23 21:20:12 +00:00
Anders Carlsson c20f78c761 Destroy the inheritance path.
llvm-svn: 102211
2010-04-23 21:02:34 +00:00
Anders Carlsson 720130c0cf Turn CXXMethodVector into a generic class template.
llvm-svn: 102208
2010-04-23 19:53:03 +00:00
Daniel Dunbar e3883874c5 NeXT/EH: When generating the rethrow code for a finally block, make sure to
chain outwards when inside a nested exception scope.
 - A real test for this is going into LLVM test-suite.

llvm-svn: 102204
2010-04-23 19:12:32 +00:00
Daniel Dunbar 5a6b3e0865 NeXT/EH: Tidy up EH code a bit, don't emit the catch block EH handler if it is unreachable.
llvm-svn: 102203
2010-04-23 19:12:24 +00:00
John McCall e87beb2591 Recommit my change to how C++ does elaborated type lookups, now with
two bugfixes which fix selfhost and (hopefully) the nightly tests.

llvm-svn: 102198
2010-04-23 18:46:30 +00:00
Fariborz Jahanian e804c28745 More work toward implementing
NeXt's -fno-constant-cfstrings - wip.

llvm-svn: 102189
2010-04-23 17:41:07 +00:00
Chris Lattner db6d5cb892 Implement PR6845. We allow matching constraints to have different
input and output types when the smaller value isn't mentioned in the
asm string.  Extend this support from integers to also allowing 
fp values to be mismatched (if not mentioned in the asm string).

llvm-svn: 102188
2010-04-23 17:27:29 +00:00
Sebastian Redl 26a0f1cff9 Require a complete type for the lhs of member pointer dereference operations if the type isn't exactly the same as the container class. Fixes PR6783.
llvm-svn: 102186
2010-04-23 17:18:26 +00:00
Chris Lattner 1a8f394a1f david conrad points out that {|} in inline assembly on arm are not asm
variants.  This fixes neon inline asm which my patch for PR6780 broke.

llvm-svn: 102181
2010-04-23 16:29:58 +00:00
Douglas Gregor 83eb5032c0 When instantiating a typedef of an anonymous tag type, note in the tag
declaration that this typedef gives the tag a name. Fixes a problem
uncovered by Boost.GIL (Generic Image Library).

llvm-svn: 102180
2010-04-23 16:25:07 +00:00
Anders Carlsson 7a0ffdbe53 Cleanup.
llvm-svn: 102179
2010-04-23 16:24:12 +00:00
Anders Carlsson 423f5d85fd Handle copy initialization in BuildImplicitMemberInitializer. Not used yet.
llvm-svn: 102178
2010-04-23 16:04:08 +00:00
Chris Lattner 092d1c9f64 add GNU C++ include paths for Fedora 11,12 x86_64,
patch by mikem!

llvm-svn: 102177
2010-04-23 15:55:20 +00:00
Daniel Dunbar 45b2d8ab42 Revert "C++ doesn't really use "namespaces" for different kinds of names the same", which seems to break most C++ nightly test apps.
llvm-svn: 102174
2010-04-23 13:07:39 +00:00
Douglas Gregor 914af2182b Handle compound assignment expressions (i += j) as lvalues, which is
permitted in C++ but not in C. Fixes PR6900. Clang can now handle all
of Boost.Lambda's regression tests.

llvm-svn: 102170
2010-04-23 04:16:32 +00:00
Anders Carlsson 11373b5277 Add another 'catch all' access diagnostic.
llvm-svn: 102169
2010-04-23 03:41:35 +00:00
Douglas Gregor ffe0884bc4 Emit a lame diagnostic when we can't mangle operator names
llvm-svn: 102168
2010-04-23 03:19:53 +00:00
Douglas Gregor 173627188d Mangle dependent template names such as the nested-name-specifier in
T::apply <U>::type

Fixes PR6899, although I want to dig a little deeper into the FIXME
for dependent template names that refer to operators.

llvm-svn: 102167
2010-04-23 03:10:43 +00:00
Anders Carlsson 1b00e24d13 Add an ImplicitInitializerKind enum and pass it to BuildImplicitBaseInitializer and BuildImplicitMemberInitializer.
llvm-svn: 102166
2010-04-23 03:10:23 +00:00
Anders Carlsson dca6be04db Fix a think-o that broke self-host.
llvm-svn: 102165
2010-04-23 03:07:47 +00:00
John McCall a245671ae0 C++ doesn't really use "namespaces" for different kinds of names the same
way that C does.  Among other differences, elaborated type specifiers
are defined to skip "non-types", which, as you might imagine, does not
include typedefs.  Rework our use of IDNS masks to capture the semantics
of different kinds of declarations better, and remove most current lookup
filters.  Removing the last remaining filter is more complicated and will
happen in a separate patch.

Fixes PR 6885 as well some spectrum of unfiled bugs.

llvm-svn: 102164
2010-04-23 02:41:41 +00:00
Anders Carlsson 3c1db570b2 Factor code to initialize an implicit member out into a separate function.
llvm-svn: 102162
2010-04-23 02:15:47 +00:00
Douglas Gregor 2c4a7501ee When parsing a cast-expression that starts with a scope annotation,
try to annotate as a type first to determine whether we have a
functional-style cast. Patch by Eli Friedman, fixes PR6830.

llvm-svn: 102161
2010-04-23 02:08:13 +00:00
Douglas Gregor 19043f0a6a I hate default statements. Fixes PR6874.
llvm-svn: 102160
2010-04-23 02:02:43 +00:00
Anders Carlsson 6bd91c387b Remove calls to isDependentContext, since we handle that case earlier in the code. Make BuildImplicitBaseInitializer return a boolean instead.
llvm-svn: 102159
2010-04-23 02:00:02 +00:00
Douglas Gregor 306de2f6a1 Template instantiation for @try and @finally (but not @catch, yet).
llvm-svn: 102147
2010-04-22 23:59:56 +00:00
Douglas Gregor ff1915208d Make TemplateDecl and ObjCContainerDecl abstract
llvm-svn: 102145
2010-04-22 23:35:25 +00:00
Douglas Gregor e93525ed95 Kill off IDNS_ObjCImplementation and IDNS_ObjCCategoryName; they
aren't and never were used. There's a gap in the bit pattern for IDNS
now, but I'm sure *someone* will fill it.

llvm-svn: 102143
2010-04-22 23:19:50 +00:00
Douglas Gregor f68a508586 Template instantiation for the Objective-C "fast enumeration"
statement, i.e., 

  for (element in collection) {
    // do something
  }

llvm-svn: 102138
2010-04-22 23:10:45 +00:00
Douglas Gregor 6148de71dd Template instantiation for Objective-C++ @synchronized statements.
llvm-svn: 102134
2010-04-22 22:01:21 +00:00
Douglas Gregor 2900c16b92 Implement template instantiation for Objective-C++ @throw statements.
llvm-svn: 102133
2010-04-22 21:44:01 +00:00
Fariborz Jahanian 62c560246e Check for -fno-constant-cfstrings consistency
in pch.

llvm-svn: 102130
2010-04-22 21:01:59 +00:00
Fariborz Jahanian 63408e848b Support for -fno-constant-cfstrings option - wip.
llvm-svn: 102112
2010-04-22 20:26:39 +00:00
John McCall 8c12dc4351 Use the naming class from the overloaded lookup when access-checking an
address of overloaded function, instead of assuming that a nested name
specifier was used.  A nested name specifier is not required for static
functions.

Fixes PR6886.

llvm-svn: 102107
2010-04-22 18:44:12 +00:00
Chris Lattner 8b29021712 another tweak for haiku support, patch by Paul Davey!
llvm-svn: 102098
2010-04-22 17:48:00 +00:00
Douglas Gregor 21515a992f Some Objective-C++ types and expressions will never change during
template instantiation, since they cannot be dependent or have
dependent parts. Handle them the simple way.

llvm-svn: 102094
2010-04-22 17:28:13 +00:00
Douglas Gregor b5186b1d44 When a dependent Objective-C++ message send was able to resolve the
method being called at template definition time, retain that method
and pass it through to type-checking. We will not perform any lookup
for the method during template instantiation.

llvm-svn: 102081
2010-04-22 17:01:48 +00:00
Douglas Gregor 049211a670 Remove the SelectorLoc argument to Sema::BuildInstanceMesssage and
Sema::BuildClassMessage; we weren't using it, and template
instantiation was faking it anyway.

llvm-svn: 102074
2010-04-22 16:50:51 +00:00
Douglas Gregor e1f79e868a Expand the one use of TransformPointerLikeType and eliminate this macro. No functionality change
llvm-svn: 102073
2010-04-22 16:46:21 +00:00
Douglas Gregor c298ffcb8b Implement template instantiation for Objective-C++ message sends. We
support dependent receivers for class and instance messages, along
with dependent message arguments (of course), and check as much as we
can at template definition time.

This commit also deals with a subtle aspect of template instantiation
in Objective-C++, where the type 'T *' can morph from a dependent
PointerType into a non-dependent ObjCObjectPointer type.

llvm-svn: 102071
2010-04-22 16:44:27 +00:00
Daniel Dunbar f812506912 ARM/APCS: Don't respect bit-field types when laying out structures.
- This fixes the last known ABI issues with ARM/APCS.

 - I've run the first 1k ABITests with '--no-unsigned --no-vector --no-complex'
   on {armv6, armv7} x {-mno-thumb, -mthumb}, and the first 10k tests for armv7
   -mthumb, for both function return types and single argument calls. These all
   pass now (they failed horribly before without --no-bitfield).

llvm-svn: 102070
2010-04-22 16:14:54 +00:00
Daniel Dunbar 5981377698 IRgen: Fix another case where we generated an invalid access component when we
immediately narrowed the access size. Fix this (and previous case) by just
choosing a better access size up-front.

llvm-svn: 102068
2010-04-22 15:22:33 +00:00
Daniel Dunbar 5d6c07e0e9 IRgen: Fix case where we might generate an access component with width == 0, if
we have to narrow the access side immediately (can happen with packed,
-fno-bitfield-type-align).

llvm-svn: 102067
2010-04-22 14:56:10 +00:00
Douglas Gregor fceea36501 When checking whether to diagnose an initialized "extern" variable,
look for the const on the base type rather than on the top-level
type. Fixes PR6495 properly.

llvm-svn: 102066
2010-04-22 14:36:26 +00:00
Douglas Gregor 73519609d4 Record nested-name-specifiers of when we create
elaborated-type-specifiers. Patch by Enea Zaffanella!

llvm-svn: 102065
2010-04-22 14:24:35 +00:00
Anders Carlsson 05bf00938b Re-land the patch that merges two diagnostics into one now that it passes self-host :)
llvm-svn: 102050
2010-04-22 05:40:53 +00:00
Daniel Dunbar b219780b72 Suppress compiler warning.
llvm-svn: 102047
2010-04-22 03:17:06 +00:00
Daniel Dunbar fc66e0ed87 IRgen: Set alignment correctly on bit-field accesses.
llvm-svn: 102046
2010-04-22 03:17:04 +00:00
Daniel Dunbar 488f55c271 IRgen: Rewrite bit-field access policy to not access data beyond the bounds of the structure, which we also now verify as part of the post-layout consistency checks.
- This fixes some pedantic bugs with packed structures, as well as major problems with -fno-bitfield-type-align.

 - Fixes PR5591, PR5567, and all known -fno-bitfield-type-align issues.

 - Review appreciated.

llvm-svn: 102045
2010-04-22 02:35:46 +00:00
Daniel Dunbar b6f4b05914 IRgen: Fix CGRecordLayout::print to print the bit-field infos in a consistent order.
llvm-svn: 102044
2010-04-22 02:35:36 +00:00
Daniel Dunbar e448942b76 Revert "Unify two diagnostics into one.", it breaks with an assertion failure on bootstrap.
llvm-svn: 102043
2010-04-22 02:35:33 +00:00
Anders Carlsson 046bb5cc3f Unify two diagnostics into one.
llvm-svn: 102040
2010-04-22 01:17:32 +00:00
John McCall 2e6567ae60 Call PerformCopyInitialization to properly initialize the exception temporary
in a throw expression.  Use EmitAnyExprToMem to emit the throw expression,
which magically elides the final copy-constructor call (which raises a new
strict-compliance bug, but baby steps).  Give __cxa_throw a destructor pointer
if the exception type has a non-trivial destructor.

llvm-svn: 102039
2010-04-22 01:10:34 +00:00
Douglas Gregor 4f4946aaaa Whenever we complain about a failed initialization of a function or
method parameter, provide a note pointing at the parameter itself so
the user does not have to manually look for the function/method being
called and match up parameters to arguments. For example, we now get:

t.c:4:5: warning: incompatible pointer types passing 'long *' to
parameter of
      type 'int *' [-pedantic]
  f(long_ptr);
    ^~~~~~~~
t.c:1:13: note: passing argument to parameter 'x' here
void f(int *x);
            ^

llvm-svn: 102038
2010-04-22 00:20:18 +00:00
Anders Carlsson 3eeb741e6c Remove an unused declaration.
llvm-svn: 102037
2010-04-21 23:55:31 +00:00
Dan Gohman ef78c8ebd7 When computing the alignof value for a vector type, ensure that
the alignment is a power of 2, even in the esoteric case of a
vector element which does not have a power-of-2 sizeof value.

llvm-svn: 102036
2010-04-21 23:32:43 +00:00
Douglas Gregor 6b7f12c039 Switch the initialization of Objective-C message parameters (as occurs
during message sends) over to the new initialization code and away
from the C-only CheckSingleAssignmentConstraints. The enables the use
of C++ types in method parameters and message arguments, as well as
unifying more initialiation code overall.

llvm-svn: 102035
2010-04-21 23:24:10 +00:00
Devang Patel b9ab309650 Encode field accessibility.
llvm-svn: 102033
2010-04-21 23:12:37 +00:00
Douglas Gregor 8d4de67e1d Implement parsing for message sends in Objective-C++. Message sends in
Objective-C++ have a more complex grammar than in Objective-C
(surprise!), because

  (1) The receiver of an instance message can be a qualified name such
  as ::I or identity<I>::type.
  (2) Expressions in C++ can start with a type.

The receiver grammar isn't actually ambiguous; it just takes a bit of
work to parse past the type before deciding whether we have a type or
expression. We do this in two places within the grammar: once for
message sends and once when we're determining whether a []'d clause in
an initializer list is a message send or a C99 designated initializer.

This implementation of Objective-C++ message sends contains one known
extension beyond GCC's implementation, which is to permit a
typename-specifier as the receiver type for a class message, e.g.,

  [typename compute_receiver_type<T>::type method];

Note that the same effect can be achieved in GCC by way of a typedef,
e.g.,

  typedef typename computed_receiver_type<T>::type Computed;
  [Computed method];

so this is merely a convenience.

Note also that message sends still cannot involve dependent types or
values.

llvm-svn: 102031
2010-04-21 22:36:40 +00:00
Douglas Gregor e5798dcb41 Migrate the responsibility for turning the receiver name in an
Objective-C class message expression into a type from the parser
(which was doing so in two places) to Action::getObjCMessageKind()
which, in the case of Sema, reduces the number of name lookups we need
to perform.

llvm-svn: 102026
2010-04-21 20:38:13 +00:00
Anders Carlsson 4bb6e92902 Diagnose access to fields with private constructors.
llvm-svn: 102025
2010-04-21 20:28:29 +00:00
Douglas Gregor 4fdba13072 Eliminate unused code in Sema::ActOnSuperMessage and use early exits
to reduce nesting. No functionality change. 

llvm-svn: 102022
2010-04-21 20:01:04 +00:00
Douglas Gregor 0c78ad9665 Rework the Parser-Sema interaction for Objective-C message
sends. Major changes include:

  - Expanded the interface from two actions (ActOnInstanceMessage,
    ActOnClassMessage), where ActOnClassMessage also handled sends to
    "super" by checking whether the identifier was "super", to three
    actions (ActOnInstanceMessage, ActOnClassMessage,
    ActOnSuperMessage). Code completion has the same changes.
  - The parser now resolves the type to which we are sending a class
    message, so ActOnClassMessage now accepts a TypeTy* (rather than
    an IdentifierInfo *). This opens the door to more interesting
    types (for Objective-C++ support).
  - Split ActOnInstanceMessage and ActOnClassMessage into parser
    action functions (with their original names) and semantic
    functions (BuildInstanceMessage and BuildClassMessage,
    respectively). At present, this split is onyl used by
    ActOnSuperMessage, which decides which kind of super message it
    has and forwards to the appropriate Build*Message. In the future,
    Build*Message will be used by template instantiation.
  - Use getObjCMessageKind() within the disambiguation of Objective-C
    message sends vs. array designators.

Two notes about substandard bits in this patch:
  - There is some redundancy in the code in ParseObjCMessageExpr and
  ParseInitializerWithPotentialDesignator; this will be addressed
  shortly by centralizing the mapping from identifiers to type names
  for the message receiver.
  - There is some #if 0'd code that won't likely ever be used---it
  handles the use of 'super' in methods whose class does not have a
  superclass---but could be used to model GCC's behavior more
  closely. This code will die in my next check-in, but I want it in
  Subversion.

llvm-svn: 102021
2010-04-21 19:57:20 +00:00
Anders Carlsson 43c64af5f0 Keep tack of whether a base in an InitializedEntity is an inherited virtual base or not. Use this in CheckConstructorAccess.
llvm-svn: 102020
2010-04-21 19:52:01 +00:00
Daniel Dunbar 53fac692fa ABI/x86-32 & x86-64: Alignment on 'byval' must be set when when the alignment
exceeds the minimum ABI alignment.

llvm-svn: 102019
2010-04-21 19:49:55 +00:00
Daniel Dunbar 557893d2a8 IRgen/x86-32: Factor out getIndirectResult(), to match x86-64 factoring.
llvm-svn: 102015
2010-04-21 19:10:51 +00:00
Daniel Dunbar 2ba67440b6 IRgen: Add checking that the LLVM and AST record layout offsets agree (for
non-bit-fields).

llvm-svn: 102014
2010-04-21 19:10:49 +00:00
Fariborz Jahanian 422cb21862 Improve on source location of diagnostic when default
property synthesis is using a super class ivar.

llvm-svn: 102011
2010-04-21 18:57:20 +00:00
Anders Carlsson a01874bf44 Pass the InitializedEntity to Sema::CheckConstructorAccess and use it to report different diagnostics depending on which entity is being initialized.
llvm-svn: 102010
2010-04-21 18:47:17 +00:00
Anders Carlsson 34f54d55e2 Comment out an assert for now.
llvm-svn: 102007
2010-04-21 18:03:05 +00:00
John McCall bf814c79b6 I failed to notice that my last patch wasn't doing as much as it could
because EmitBranch actually clears the insert point.  This version
actually accomplishes what I initially wanted.

llvm-svn: 101998
2010-04-21 11:18:06 +00:00
John McCall e683359fc9 Teach EmitBlock to put the target block immediately after the current block
(if there's a current block).  The chief advantage of doing this is that it
lets us pick blocks (e.g. EH blocks) to push to the end of the function so
that fallthrough happens consistently --- i.e. it gives us the flexibility
of ordering blocks as we please without having to change the order in which
we generate code.  There are standard (?) optimization passes which can do some
of that for us, but better to generate reasonable code to begin with.

llvm-svn: 101997
2010-04-21 10:29:06 +00:00