Commit Graph

83419 Commits

Author SHA1 Message Date
Nathan Jeffords 2760216c89 made COFF target dllexport logic apply to all subtargets
llvm-svn: 103373
2010-05-09 05:52:28 +00:00
Nathan Jeffords da7d01404d test commit, added a comment to MCSectionCOFF::PrintSwitchToSection function
llvm-svn: 103372
2010-05-09 05:49:00 +00:00
Chris Lattner b7e7f722a2 pchify CXXMemberCallExpr correctly. Before it would serialize
and deserialize as a CallExpr which is close, but ends up
deserializing with the wrong stmt class.

llvm-svn: 103371
2010-05-09 05:36:05 +00:00
Anders Carlsson 82828a31f6 Cleanup.
llvm-svn: 103370
2010-05-09 05:03:38 +00:00
Douglas Gregor 62c281a873 Be more careful about picking a template parameter when we fail to substitute explicit template arguments into a function template
llvm-svn: 103369
2010-05-09 01:26:06 +00:00
David Chisnall e0b5b3a1c5 Tweaked selector mangling again (GNU runtime).
llvm-svn: 103368
2010-05-09 01:01:43 +00:00
Douglas Gregor 6d319c62c5 Fix a silly bootstrap-breaking thinko, where we were trying to convert
non-existent condition expressions to boolean values during template
instantiation.

llvm-svn: 103364
2010-05-08 23:34:38 +00:00
Anders Carlsson 15837f8f63 Actually compute the empty subobject sizes. No functionality change yet.
llvm-svn: 103363
2010-05-08 23:06:26 +00:00
Douglas Gregor 14f232ea20 Improve our handling of the -Wunused-variable warning in templates. In
particular, don't complain about unused variables that have dependent
type until instantiation time, so that we can look at the type of the
variable. Moreover, only complain about unused variables that have
neither a user-declared constructor nor a non-trivial destructor.

llvm-svn: 103362
2010-05-08 23:05:03 +00:00
Douglas Gregor 0bbe94d6df Don't complain about an __builtin_va_arg expression's result being
unused, since the operation has side effects.

llvm-svn: 103360
2010-05-08 22:41:50 +00:00
Anders Carlsson 2357bfd9d0 Add a SizeOfLargestEmptySubobject member to ASTRecordLayout. For C++ classes this will hold the largest empty subobject or 0 if the class doesn't have any empty subobjects.
llvm-svn: 103359
2010-05-08 22:35:05 +00:00
Douglas Gregor ffa56e90f8 Attempted workaround for MSVC compile error
llvm-svn: 103358
2010-05-08 22:24:24 +00:00
Douglas Gregor ff73a9e380 When instantiating statements that involve conditions (if, while, do,
for, and switch), be careful to construct the full expressions as soon
as we perform template instantation, so we don't either forget to call
temporary destructors or destroy temporaries at the wrong time. This
is the template-instantiation analogue to r103187, during which I
hadn't realized that the issue would affect the handling of these
constructs differently inside and outside of templates.

Fixes a regression in Boost.Function.

llvm-svn: 103357
2010-05-08 22:20:28 +00:00
Chris Lattner 84d4618659 make simplifycfg insert an llvm.trap before the 'unreachable' it introduces
when it detects undefined behavior.  llvm.trap generally codegens into some
thing really small (e.g. a 2 byte ud2 instruction on x86) and debugging this
sort of thing is "nontrivial".  For example, we now compile:

void foo() { *(int*)0 = 42; }

into:

_foo:
	pushl	%ebp
	movl	%esp, %ebp
	ud2

Some may even claim that this is a security hole, though that seems dubious
to me.  This addresses rdar://7958343 - Optimizing away null dereference 
potentially allows arbitrary code execution

llvm-svn: 103356
2010-05-08 22:15:59 +00:00
David Chisnall 2ec6cff9d0 Fixed linkage problem from last commit (GNU runtime).
llvm-svn: 103355
2010-05-08 21:55:04 +00:00
Chris Lattner 02b0df5338 Teach instcombine to transform a bitcast/(zext|trunc)/bitcast sequence
with a vector input and output into a shuffle vector.  This sort of 
sequence happens when the input code stores with one type and reloads
with another type and then SROA promotes to i96 integers, which make
everyone sad.

This fixes rdar://7896024

llvm-svn: 103354
2010-05-08 21:50:26 +00:00
David Chisnall 0a24fd3744 Tweaked selector generation (GNU runtime). Removed the use of GlobalAliases in the generated bitcode.
llvm-svn: 103353
2010-05-08 20:58:05 +00:00
Douglas Gregor b02d6b3b94 Don't destroy the data associated with an overload resolution candidate; it's ASTContext-allocated now
llvm-svn: 103350
2010-05-08 20:20:05 +00:00
Douglas Gregor 90cf2c98bb Record template argument deduction failures for member function
templates and conversion function templates. 

llvm-svn: 103349
2010-05-08 20:18:54 +00:00
Douglas Gregor d09efd43d3 When printing an overload candidate that failed due to SFINAE, print a
specific message that includes the template arguments, e.g.,

test/SemaTemplate/overload-candidates.cpp:27:20: note: candidate template
      ignored: substitution failure [with T = int *]
  typename T::type get_type(const T&); // expected-note{{candidate ...
                   ^

llvm-svn: 103348
2010-05-08 20:07:26 +00:00
Chris Lattner 5a62d6e578 Fix PR7052, patch by Jakub Staszak!
llvm-svn: 103347
2010-05-08 20:01:44 +00:00
Chris Lattner 72afa956db break coff symbol definition stuff out into proper MCStreamer callbacks,
patch by Nathan Jeffords!

llvm-svn: 103346
2010-05-08 19:54:22 +00:00
Douglas Gregor 1d72edd7c5 Improve overload-candidate diagnostic for a function template that
failed because the explicitly-specified template arguments did not
match its template parameters, e.g.,

test/SemaTemplate/overload-candidates.cpp:18:8: note: candidate
template
      ignored: invalid explicitly-specified argument for template
      parameter 'I'
  void get(const T&);
       ^
test/SemaTemplate/overload-candidates.cpp:20:8: note: candidate
template
      ignored: invalid explicitly-specified argument for 1st template
      parameter
  void get(const T&);
       ^

llvm-svn: 103344
2010-05-08 19:15:54 +00:00
Douglas Gregor 564767cf39 A leak is better than a double-free while I figure out how to address
this issue.

llvm-svn: 103343
2010-05-08 18:32:25 +00:00
Douglas Gregor 461761d68f Minor cleanup, and ban copying of OverloadCandidateSets. No
functionality change. 

llvm-svn: 103342
2010-05-08 18:20:53 +00:00
Douglas Gregor 02eb4835ce When template argument deduction fails because the call had too
many/too few arguments, use the same diagnostic we use for arity
mismatches in non-templates (but note that it's a function template).

llvm-svn: 103341
2010-05-08 18:13:28 +00:00
Douglas Gregor 3626a5cac2 When printing a non-viable overload candidate that failed due to
conflicting deduced template argument values, give a more specific
reason along with those values, e.g.,

test/SemaTemplate/overload-candidates.cpp:4:10: note: candidate template
      ignored: deduced conflicting types for parameter 'T' ('int' vs. 'long')
const T& min(const T&, const T&); 
         ^

llvm-svn: 103339
2010-05-08 17:41:32 +00:00
Douglas Gregor 14653638de Fix test for Release-Asserts build
llvm-svn: 103337
2010-05-08 16:04:01 +00:00
Bill Wendling cd476b6760 Readd testcase.
llvm-svn: 103335
2010-05-08 04:47:54 +00:00
Daniel Dunbar 401d4c9341 Run interrupt routines as part of report_fatal_error, since we are failing
ungracefully.

llvm-svn: 103334
2010-05-08 02:10:36 +00:00
Daniel Dunbar 68272566c6 Add llvm::sys::RunInterruptHandlers(), which runs the registered SIGINT cleanup
stuff.

llvm-svn: 103333
2010-05-08 02:10:34 +00:00
Daniel Dunbar d43f08d06e Update latest checker build to a local link.
llvm-svn: 103332
2010-05-08 02:03:49 +00:00
Nick Kledzik 386e5f364e tweak arm exports
llvm-svn: 103331
2010-05-07 23:44:43 +00:00
Nick Kledzik c6cacf9858 sjlj based personality requires a different name
llvm-svn: 103330
2010-05-07 23:44:20 +00:00
Dan Gohman d0800241d2 When pruning candidate formulae out of an LSRUse, update the
LSRUse's Regs set after all pruning is done, rather than trying
to do it on the fly, which can produce an incomplete result.

This fixes a case where heuristic pruning was stripping all
formulae from a use, which led the solver to enter an infinite
loop.

Also, add a few asserts to diagnose this kind of situation.

llvm-svn: 103328
2010-05-07 23:36:59 +00:00
Devang Patel 0625af2a88 Instead of just verifying compile unit, verify entire type, variable, namespace etc..
llvm-svn: 103327
2010-05-07 23:33:41 +00:00
Devang Patel cbe7a8508a Remove DIGlobal.
llvm-svn: 103325
2010-05-07 23:19:07 +00:00
Douglas Gregor 5597ab4076 When we encounter a non-dependent type during template instantiation,
mark any declarations we see inside of that type as
"referenced". Fixes PR7079.

llvm-svn: 103323
2010-05-07 23:12:07 +00:00
Bill Wendling 6b5897b4de Remove. Don't XFAIL.
llvm-svn: 103321
2010-05-07 23:09:17 +00:00
Devang Patel 67eba80672 If there is not any debug info for type then do not emit debug info for this variable.
A recent change to tightly verify debug info prepared by FE caught this.
This fixes unittest build.

llvm-svn: 103320
2010-05-07 23:05:55 +00:00
Devang Patel 54c59312b1 Add DINameSpace::Verify().
llvm-svn: 103318
2010-05-07 23:04:32 +00:00
Bill Wendling 32d8981ec0 Temorarily revert r101984.
llvm-svn: 103314
2010-05-07 22:45:36 +00:00
Douglas Gregor 1b770bb946 Clang is dying on this with an ambiguous conversion sequence. We're working on it
llvm-svn: 103312
2010-05-07 22:28:25 +00:00
Dan Gohman 7de01ec2c9 SDDbgValues are apparently not being legalized. Fix a symptom of the problem,
and not the real problem itself, by dropping debug info for i128 values.
rdar://7958162.

llvm-svn: 103310
2010-05-07 22:19:08 +00:00
Dan Gohman 2fb68300a0 Minimally fix this code to not abort on mdnodes with integer data
wider than 64 bits.

llvm-svn: 103309
2010-05-07 22:15:24 +00:00
Douglas Gregor e0c5497935 Introduce a recursive AST visitor that makes it trivial to recursively
walk an entire AST, including all of the types, declarations,
statements, and expressions, and allowing one to easily override the
behavior of the walk at any particular node kind.

llvm-svn: 103308
2010-05-07 22:11:34 +00:00
John McCall b1fb0d3610 The FP constant evaluator was missing a few cases of unary operators that return floats
but whose operand isn't a float:  specifically, __real__ and __imag__.  Instead
of filtering these out, just implement them.

Fixes <rdar://problem/7958272>.

llvm-svn: 103307
2010-05-07 22:08:54 +00:00
Devang Patel 2ae3397536 Verify variable directly.
llvm-svn: 103305
2010-05-07 22:04:20 +00:00
Chris Lattner 028449325b add COFF support for COMDAT sections, patch by Nathan Jeffords!
llvm-svn: 103304
2010-05-07 21:49:09 +00:00
Devang Patel 8d6a2b7428 Verify entire type descriptor not just tag.
llvm-svn: 103303
2010-05-07 21:45:47 +00:00