Commit Graph

99075 Commits

Author SHA1 Message Date
Peter Collingbourne 0ff0b37627 Move name mangling support from CodeGen to AST. In the
process, perform a number of refactorings:

- Move MiscNameMangler member functions to MangleContext
- Remove GlobalDecl dependency from MangleContext
- Make MangleContext abstract and move Itanium/Microsoft functionality
  to their own classes/files
- Implement ASTContext::createMangleContext and have CodeGen use it

No (intended) functionality change.

llvm-svn: 123386
2011-01-13 18:57:25 +00:00
Douglas Gregor 018778af3d Only apply the parameter pack matching of C++0x [temp.arg.template]p3
when we're actually matching a template template argument to a
template template parameter. Otherwise, use strict matching.

Fixes <rdar://problem/8859985> clang++: variadics and out-of-line definitions.

llvm-svn: 123385
2011-01-13 18:47:47 +00:00
Jakob Stoklund Olesen 0e233ae183 Teach MachineBasicBlock::getFirstTerminator to ignore debug values.
It will still return an iterator that points to the first terminator or end(),
but there may be DBG_VALUE instructions following the first terminator.

llvm-svn: 123384
2011-01-13 18:41:05 +00:00
Bob Wilson c8056a952e Check for empty structs, and for consistency, zero-element arrays.
llvm-svn: 123383
2011-01-13 18:26:59 +00:00
Douglas Gregor d43037cb70 Fix a test case
llvm-svn: 123382
2011-01-13 18:03:24 +00:00
Bob Wilson 08713d3c5f Extend SROA to handle arrays accessed as homogeneous structs and vice versa.
This is a minor extension of SROA to handle a special case that is
important for some ARM NEON operations.  Some of the NEON intrinsics
return multiple values, which are handled as struct types containing
multiple elements of the same vector type.  The corresponding return
types declared in the arm_neon.h header have equivalent arrays.  We
need SROA to recognize that it can split up those arrays and structs
into separate vectors, even though they are not always accessed with
the same type.  SROA already handles loads and stores of an entire
alloca by using insertvalue/extractvalue to access the individual
pieces, and that code works the same regardless of whether the type
is a struct or an array.  So, all that needs to be done is to check
for compatible arrays and homogeneous structs.

llvm-svn: 123381
2011-01-13 17:45:11 +00:00
Bob Wilson 12eec40c83 Make SROA more aggressive with allocas containing padding.
SROA only split up structs and arrays one level at a time, so padding can
only cause trouble if it is located in between the struct or array elements.

llvm-svn: 123380
2011-01-13 17:45:08 +00:00
Douglas Gregor b720ff2f62 When your comments and your code are out-of-sync, the test case is wrong.
llvm-svn: 123379
2011-01-13 17:44:36 +00:00
Douglas Gregor d81c7c1659 Add tests for name mangling of variadic templates.
llvm-svn: 123378
2011-01-13 16:39:34 +00:00
Oscar Fuentes b7c43b8c59 Disable RTTI when building unit tests. This avoids errors at link time.
llvm-svn: 123377
2011-01-13 15:31:45 +00:00
Oscar Fuentes f8e26b123c Platform tests for argz_* functions.
Patch by arrowdodger!

llvm-svn: 123376
2011-01-13 15:06:32 +00:00
Zhongxing Xu 3a3c0fd2d1 CXXBaseObjectRegion is like FieldRegion. Need to blast through it when
getting the base region. This makes the RemoveDeadBindings() correct.

llvm-svn: 123375
2011-01-13 12:46:31 +00:00
Zhongxing Xu 0d87e0c65b Support inlining base initializers. We still haven't got it completely right,
since the bindings are purged after they are set up. Need to investigate
RemoveDeadBindings algorithm.

llvm-svn: 123374
2011-01-13 12:30:12 +00:00
Duncan Sands ad000d8f16 Remove some wrong code which fortunately was never executed (as explained in
the comment I added): an extern weak global may have a null address.

llvm-svn: 123373
2011-01-13 10:43:08 +00:00
Duncan Sands 8d25a7c3a0 The most common simplification missed by instsimplify in unoptimized bitcode
is "X != 0 -> X" when X is a boolean.  This occurs a lot because of the way
llvm-gcc converts gcc's conditional expressions.  Add this, and a few other
similar transforms for completeness.

llvm-svn: 123372
2011-01-13 08:56:29 +00:00
Sean Callanan 92adcac9ec Implemented a major overhaul of the way variables are handled
by LLDB.  Instead of being materialized into the input structure
passed to the expression, variables are left in place and pointers
to them are materialzied into the structure.  Variables not resident
in memory (notably, registers) get temporary memory regions allocated
for them.

Persistent variables are the most complex part of this, because they
are made in various ways and there are different expectations about
their lifetime.  Persistent variables now have flags indicating their
status and what the expectations for longevity are.  They can be
marked as residing in target memory permanently -- this is the
default for result variables from expressions entered on the command
line and for explicitly declared persistent variables (but more on
that below).  Other result variables have their memory freed.

Some major improvements resulting from this include being able to
properly take the address of variables, better and cleaner support
for functions that return references, and cleaner C++ support in
general.  One problem that remains is the problem of explicitly
declared persistent variables; I have not yet implemented the code
that makes references to them into indirect references, so currently
materialization and dematerialization of these variables is broken.

llvm-svn: 123371
2011-01-13 08:53:35 +00:00
Zhongxing Xu 02cde7ffa4 Add comments.
llvm-svn: 123370
2011-01-13 07:59:59 +00:00
Evan Cheng 965b3c7323 Model :upper16: and :lower16: as ARM specific MCTargetExpr. This is a step
in the right direction. It eliminated some hacks and will unblock codegen
work. But it's far from being done. It doesn't reject illegal expressions,
e.g. (FOO - :lower16:BAR). It also doesn't work in Thumb2 mode at all.

llvm-svn: 123369
2011-01-13 07:58:56 +00:00
Ted Kremenek 304b6e4aa1 Fix a corner case in RegionStore where we assign
a struct value to a symbolic index into array.
RegionStore can't actually reason about this,
so we were getting bogus warnings about loading
uninitialized values from the array.  The solution
is invalidate the entire array when we cannot
represent the binding explicitly.

Fixes <rdar://problem/8848957>

llvm-svn: 123368
2011-01-13 06:58:15 +00:00
Eric Christopher da2d2f4d1f Experiment with changing the default 32-bit linux stack alignment to
16 bytes for PR8969. Update all testcases accordingly.

llvm-svn: 123367
2011-01-13 06:47:10 +00:00
Rafael Espindola 9ebe8ce68c Keep unnamed_addr when linking.
llvm-svn: 123364
2011-01-13 05:12:34 +00:00
Ted Kremenek f41bdd7c24 Rename 'HasGeneratedNode' to 'hasGeneratedNode'
and 'getBasePredecessor()' to 'getPredecessor()'.

Also remove a unneeded save-and-restore of
node builder's tag field.

llvm-svn: 123363
2011-01-13 04:36:46 +00:00
Ted Kremenek b86ec25256 Remove unnecessary save-and-restore of the
node builder's 'HasGeneratedNode' field.

llvm-svn: 123362
2011-01-13 04:36:40 +00:00
Ted Kremenek f044bd68e1 Remove CheckerContext's dependence on setting
the node builder's "tag" ivar (which we would
like to remove).

llvm-svn: 123361
2011-01-13 04:36:36 +00:00
John McCall 294c2db42b Ensure an insertion point at the end of a statement-expression.
Fixes PR8967.

llvm-svn: 123360
2011-01-13 02:03:06 +00:00
Chris Lattner 8cf302a1e7 optimize out a temporary sys::Path
llvm-svn: 123359
2011-01-13 01:35:58 +00:00
Rafael Espindola 026d152e58 Reject uses of unnamed_addr in declarations.
llvm-svn: 123358
2011-01-13 01:30:30 +00:00
Greg Clayton 87ff1acc0c Plug Free BSD memory leak.
llvm-svn: 123357
2011-01-13 01:27:55 +00:00
Greg Clayton 984cb75b2b Call SetFile instead of constructing a temp object and assigning to g_program_filespec for Free BSD port.
llvm-svn: 123356
2011-01-13 01:25:48 +00:00
Greg Clayton b332639004 Don't have the program path be resolved when they already are when assigning g_program_filespec in the Host calls.
llvm-svn: 123355
2011-01-13 01:23:43 +00:00
Rafael Espindola d09776b945 Only add unnamed_addr to definitions.
llvm-svn: 123354
2011-01-13 01:12:55 +00:00
Kevin Enderby 4d58d5f88f Add a FIXME and two asserts for now in the ARMAsmParser when it sees .code 16 or
.code 32 if the TargetMachine's isThumb() boolean does not match.  The correct
fix is to switch ARM subtargets at that point and is tracked by rdar://8856789
which is bigger task.

llvm-svn: 123353
2011-01-13 01:07:01 +00:00
Dan Gohman 958620dd6d Fix r123346 to handle scalar types too.
llvm-svn: 123352
2011-01-13 01:06:51 +00:00
Jakob Stoklund Olesen 9472847bcc Add missing space in debug output
llvm-svn: 123351
2011-01-13 00:57:35 +00:00
Jason W Kim 9322997b60 Change call to Error() to assert()
llvm-svn: 123350
2011-01-13 00:27:00 +00:00
Douglas Gregor 0f836ea213 Allow us to transform pack expansion expressions.
llvm-svn: 123349
2011-01-13 00:19:55 +00:00
Douglas Gregor fd4344b5a6 Implement C++0x [temp.arg.template]p3, which allows slightly fuzzy
matching of variadic template template parameters to template
arguments. This paragraph was the subject of ISO C++ committee
document N2555: Extending Variadic Template Template Parameters.

llvm-svn: 123348
2011-01-13 00:08:50 +00:00
Jason W Kim 39e36e7ab4 Style clean up - break up the breaks.
llvm-svn: 123347
2011-01-13 00:07:51 +00:00
Dan Gohman 6e017a1134 Apply the patch from PR8958, which allows llc to get slightly
further on the associated testcase before aborting.

llvm-svn: 123346
2011-01-12 23:56:26 +00:00
Michael J. Spencer d9960c69b5 Support/Path: Deprecate PathV1::IsSymlink and replace all uses with PathV2::is_symlink.
llvm-svn: 123345
2011-01-12 23:55:06 +00:00
Michael J. Spencer 634f13eacb replace all uses of PathV1::IsSymlink with PathV2::is_symlink.
llvm-svn: 123344
2011-01-12 23:54:48 +00:00
Douglas Gregor 641040afba Refactor and simplify Sema::TemplateParameterListsAreEqual. We had a
bunch of duplicated checks for parameter pack/non-pack mismatches.

llvm-svn: 123343
2011-01-12 23:45:44 +00:00
Jakob Stoklund Olesen 74ded57bb8 Try again enabling LiveDebugVariables.
llvm-svn: 123342
2011-01-12 23:36:21 +00:00
Jason W Kim 1455842275 Added clarifying comment
llvm-svn: 123341
2011-01-12 23:25:02 +00:00
Jason W Kim e9eae0f887 JimG sez: "The value-kinds look like masks, but they're not consistently used
that way, unfortunately. If you want to change them to work additively instead
of a one-variant-kind-per-symbolref, that's great and I completely agree it's
worth doing, but it really should be a separate patch. Until then, this isn't
correct."

So I am reverting this bit until a more opportune time.

llvm-svn: 123340
2011-01-12 23:21:49 +00:00
Jakob Stoklund Olesen e63dfeee36 Don't emit a DBG_VALUE for a spill slot that the rewriter decided not to use after all.
llvm-svn: 123339
2011-01-12 23:14:07 +00:00
Jakob Stoklund Olesen 2ffee66e10 Fix braino in dominator tree walk.
llvm-svn: 123338
2011-01-12 23:14:04 +00:00
Howard Hinnant 59a7dc95de Fixing an ambiguity in variadics found by clang.
llvm-svn: 123337
2011-01-12 22:56:59 +00:00
Douglas Gregor 4478f858b5 Add the location of the right parenthesis of a C++ named cast
(static_cast, dynamic_cast, reinterpret_cast, or const_cast) to
improve source-location information. Fixes PR8960.

llvm-svn: 123336
2011-01-12 22:41:29 +00:00
Jakob Stoklund Olesen 1a3534afc4 Sometimes, old virtual registers can linger on DBG_VALUE instructions.
Make sure we don't crash in that case, but simply turn them into %noreg instead.

llvm-svn: 123335
2011-01-12 22:37:49 +00:00