Commit Graph

70341 Commits

Author SHA1 Message Date
Dan Gohman afbf256184 Make DominanceFrontier::addBasicBlock return the iterator for the newly
inserted block.

llvm-svn: 85010
2009-10-24 19:57:58 +00:00
Dan Gohman 8cd7c22527 Add an explicit keyword.
llvm-svn: 85009
2009-10-24 19:56:23 +00:00
Sanjiv Gupta 9e8d42f295 Revert back 85006 for now as it breaks PIC16 tests.
llvm-svn: 85008
2009-10-24 18:19:41 +00:00
Sanjiv Gupta 84f0f776e9 Add a preprocessor define for adding a "near" section attribute for allowing
objects to be placed at shared memory.

llvm-svn: 85007
2009-10-24 18:08:20 +00:00
Sanjiv Gupta 055c3305a1 Adding support for placing global objects in shared data memory.
llvm-svn: 85006
2009-10-24 18:02:44 +00:00
Benjamin Kramer 3f81d655d7 Remove duplicated constructor declaration.
llvm-svn: 84997
2009-10-24 10:09:11 +00:00
Benjamin Kramer 1402ce3e42 Switch alloca/sprintf to SmallString/raw_ostream.
llvm-svn: 84996
2009-10-24 09:57:09 +00:00
John McCall 703a3f8a7b Preserve type source information in TypedefDecls. Preserve it across
template instantiation.  Preserve it through PCH.  Show it off to the indexer.

I'm healthily ignoring the vector type cases because we don't have a sensible
TypeLoc implementation for them anyway.

llvm-svn: 84994
2009-10-24 08:00:42 +00:00
Chris Lattner 3db7bd27c2 various cleanups suggested by Duncan
llvm-svn: 84993
2009-10-24 05:27:19 +00:00
Chris Lattner 9e2d5b3b8e fix PR5287, a serious regression from my previous patches. Thanks to
Duncan for the nice tiny testcase.

llvm-svn: 84992
2009-10-24 05:22:15 +00:00
Douglas Gregor d33198420d Fix overload resolution when calling a member template or taking the
address of a member template when explicit template arguments are
provided.

llvm-svn: 84991
2009-10-24 04:59:53 +00:00
Victor Hernandez e297149e26 Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.

llvm-svn: 84987
2009-10-24 04:23:03 +00:00
Evan Cheng 46ed1f8341 80 col violation.
llvm-svn: 84986
2009-10-24 02:07:42 +00:00
Anton Korobeynikov b4a1347be2 Add some asserts to catch copyRegToReg() fails early
llvm-svn: 84983
2009-10-24 00:27:00 +00:00
Jim Grosbach e2871d69db Restrict Thumb1 register allocation to low registers, even for instructions that
can access the hi regs. Our prologue and epilogue code doesn't know how to
properly handle save/restore of the hi regs, so things go badly when we alloc
them.

llvm-svn: 84982
2009-10-24 00:19:24 +00:00
Fariborz Jahanian aa9894c583 Make the local buffer overflow safe.
llvm-svn: 84981
2009-10-24 00:16:42 +00:00
Fariborz Jahanian 205baf61c4 Fixe a buffer overflow problem which causes a crash
in a certain project. Need to have a permananent fix later
(FIXME added).

llvm-svn: 84980
2009-10-23 23:55:43 +00:00
Douglas Gregor 6b815c8799 Implement template instantiation for non-type template
parameters. Fixes PR5103.

llvm-svn: 84979
2009-10-23 23:25:44 +00:00
Evan Cheng d638bc310a Identity copies should not contribute to spill weight.
llvm-svn: 84978
2009-10-23 23:09:19 +00:00
Jim Grosbach 22b2c011f9 FIXME no longer applies. R12 and R3 are available for allocation
llvm-svn: 84977
2009-10-23 23:07:42 +00:00
John McCall 48f2d5860d Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,
but also remove some methods that cause ambiguities, and generally
make CanQual<blah> more analogous to QualType.

llvm-svn: 84976
2009-10-23 23:03:21 +00:00
Jeffrey Yasskin d0fc8f809a Fix http://llvm.org/PR4822: allow module deletion after a function has been
compiled.

When functions are compiled, they accumulate references in the JITResolver's
stub maps. This patch removes those references when the functions are
destroyed.  It's illegal to destroy a Function when any thread may still try to
call its machine code.

This patch also updates r83987 to use ValueMap instead of explicit CallbackVHs
and fixes a couple "do stuff inside assert()" bugs from r84522.

llvm-svn: 84975
2009-10-23 22:37:43 +00:00
Douglas Gregor 091f04256a Migrate Sema::ActOnCallExpr to Sema::FixOverloadedFunctionReference,
so that we maintain better source information after template argument
deduction and overloading resolves down to a specific
declaration. Found and dealt with a few more cases that 
FixOverloadedFunctionReference didn't cope with.

(Finally) added a test case that puts together this change with the
DeclRefExpr change to (optionally) include nested-name-specifiers and
explicit template argument lists.

llvm-svn: 84974
2009-10-23 22:18:25 +00:00
Sebastian Redl e2530ec0c0 Correct a comment.
llvm-svn: 84973
2009-10-23 22:13:42 +00:00
John McCall 856bbea332 Remove OriginalTypeParmDecl; the original type is the one specified
in the DeclaratorInfo, if one is present.

Preserve source information through template instantiation.  This is made
more complicated by the possibility that ParmVarDecls don't have DIs, which
is possibly worth fixing in the future.

Also preserve source information for function parameters in ObjC method
declarations.

llvm-svn: 84971
2009-10-23 21:48:59 +00:00
John McCall 3665e00c87 Add ASTContext::getTrivialDeclaratorInfo, which initializes a new
source info block with a single location.

llvm-svn: 84970
2009-10-23 21:14:09 +00:00
Victor Hernandez 8acf2956b8 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
llvm-svn: 84969
2009-10-23 21:09:37 +00:00
Fariborz Jahanian 9a14b84ac5 Diagnose misuse of '.*' and '->*' operators during parse
instead of crashing in code gen.

llvm-svn: 84968
2009-10-23 21:01:39 +00:00
Jeffrey Yasskin 61ade25834 Fix stylistic and documentation problems in ValueMap found by Nick Lewycky and
Evan Cheng.

llvm-svn: 84967
2009-10-23 20:54:00 +00:00
Sebastian Redl f212a92bb6 Fix operator precedence in Doug's most recent commit.
llvm-svn: 84964
2009-10-23 19:38:17 +00:00
Sebastian Redl c057f423a0 Apply the special enum restrictions from [over.match.oper]p3b2 in argument-dependent lookup too. This fixes PR5244.
llvm-svn: 84963
2009-10-23 19:23:15 +00:00
Douglas Gregor 4bd90e53c2 Eliminate QualifiedDeclRefExpr, which captured the notion of a
qualified reference to a declaration that is not a non-static data
member or non-static member function, e.g., 

  namespace N { int i; }
  int j = N::i;

Instead, extend DeclRefExpr to optionally store the qualifier. Most
clients won't see or care about the difference (since
QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the
number of top-level expression types that clients need to cope with,
brings the implementation of DeclRefExpr into line with MemberExpr,
and simplifies and unifies our handling of declaration references.

Extended DeclRefExpr to (optionally) store explicitly-specified
template arguments. This occurs when naming a declaration via a
template-id (which will be stored in a TemplateIdRefExpr) that,
following template argument deduction and (possibly) overload
resolution, is replaced with a DeclRefExpr that refers to a template
specialization but maintains the template arguments as written.

llvm-svn: 84962
2009-10-23 18:54:35 +00:00
Fariborz Jahanian c9af8fd76b Fixed a code gen bug (by fixing the AST) involving user-defined
pointer-to-member type conversion follwed by a pointer-to-member
standard conversion.

llvm-svn: 84955
2009-10-23 18:08:22 +00:00
Dan Gohman 4ef112be62 APInt-ify the gep scaling code, so that it correctly handles the case where
the scale overflows pointer-sized arithmetic. This fixes PR5281.

llvm-svn: 84954
2009-10-23 17:57:43 +00:00
John McCall 24e7cb6f26 Rebuild dependently-sized ext vectors if either the element type or the size
changed under the transform.

llvm-svn: 84953
2009-10-23 17:55:45 +00:00
Dan Gohman 41d00ac45b Make LoopDeletion check the maximum backedge taken count, rather than the
exact backedge taken count, when checking for infinite loops. This allows
it to delete loops with multiple exit conditions.

llvm-svn: 84952
2009-10-23 17:10:01 +00:00
Benjamin Kramer 0c78c7aa20 Silence GCC 4.3 warning.
TreeTransform.h:2333: warning: suggest parentheses around && within ||

llvm-svn: 84949
2009-10-23 10:48:09 +00:00
John McCall 6fd4c23324 Emit calls using the canonical prototype of the called function.
llvm-svn: 84947
2009-10-23 08:22:42 +00:00
Chris Lattner 851193b873 some stuff is done, we still have constantexpr simplification to do.
llvm-svn: 84943
2009-10-23 07:00:55 +00:00
Chris Lattner ccf1e84779 teach libanalysis to simplify vector loads with bitcast sources. This
implements something out of Target/README.txt producing:

_foo:                                                       ## @foo
	movl	4(%esp), %eax
	movapd	LCPI1_0, %xmm0
	movapd	%xmm0, (%eax)
	ret	$4

instead of:

_foo:                                                       ## @foo
	movl	4(%esp), %eax
	movapd	_b, %xmm0
	mulpd	LCPI1_0, %xmm0
	addpd	_a, %xmm0
	movapd	%xmm0, (%eax)
	ret	$4

llvm-svn: 84942
2009-10-23 06:57:37 +00:00
Chris Lattner 59f94c01dd enhance FoldReinterpretLoadFromConstPtr to handle loads of up to 32
bytes (i256).

llvm-svn: 84941
2009-10-23 06:50:36 +00:00
Chris Lattner ed00b80bf8 teach libanalysis to fold int and fp loads from almost arbitrary
non-type-safe constant initializers.  This sort of thing happens
quite a bit for 4-byte loads out of string constants, unions, 
bitfields, and an interesting endianness check from sqlite, which
is something like this:

const int sqlite3one = 1;
# define SQLITE_BIGENDIAN    (*(char *)(&sqlite3one)==0)
# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN?SQLITE_UTF16BE:SQLITE_UTF16LE)

all of these macros now constant fold away.

This implements PR3152 and is based on a patch started by Eli, but heavily
modified and extended.

llvm-svn: 84936
2009-10-23 06:23:49 +00:00
Tanya Lattner 9d3ba88b1d Add 2.6 release note.
llvm-svn: 84934
2009-10-23 06:20:06 +00:00
Evan Cheng 36f4bd0b62 Update tests for 84931.
llvm-svn: 84932
2009-10-23 05:58:34 +00:00
Evan Cheng 8b86efefec X86 needs critical path anti-dependency breaking.
llvm-svn: 84931
2009-10-23 05:57:35 +00:00
Ted Kremenek ca42a51dce Add comment.
llvm-svn: 84930
2009-10-23 04:45:31 +00:00
Dale Johannesen 0d670b5b92 Commit fixes for half precision I noted in review, so
they don't get lost; I don't think the originator has
write access.

llvm-svn: 84928
2009-10-23 04:02:51 +00:00
Ted Kremenek 49c5232d9f Fix integer overflow in PCHReader when reading the length of an
identifier.  This caused a crash when reading PCH files that contained
long identifier names.

The issue is that 'StrLenPtr' was previously a 'const char *', meaning
the byte loaded from it would be interpretted as a signed integer.  If
the topmost bit was set, conversion to 'unsigned' would extend that
bit, causing an overflow.

The solution is to make 'StrLenPtr' an 'unsigned char *', always
treating the value as an unsigned integer.

This fixes: <rdar://problem/7328900>

llvm-svn: 84925
2009-10-23 03:57:22 +00:00
John Thompson d73d7add37 Fixed undefined behavior in pushMappings when the stack has to resize.
llvm-svn: 84924
2009-10-23 02:21:17 +00:00
Mike Stump 9bb0059449 Add radar number.
llvm-svn: 84923
2009-10-23 02:13:20 +00:00