Commit Graph

69013 Commits

Author SHA1 Message Date
Douglas Gregor 42909754f6 Improve template argument deduction in the case where the parameter
type is a template-id (e.g., basic_ostream<CharT, Traits>) and the
argument type is a class that has a derived class matching the
parameter type. Previously, we were giving up on template argument
deduction too early.

llvm-svn: 83177
2009-09-30 22:13:51 +00:00
Bob Wilson b633d7a665 Add a new virtual EmitStartOfAsmFile method to the AsmPrinter and use this
to emit target-specific things at the beginning of the asm output.  This
fixes a problem for PPC, where the text sections are not being kept together
as expected.  The base class doInitialization code calls DW->BeginModule()
which emits a bunch of DWARF section directives.  The PPC doInitialization
code then emits all the TEXT section directives, with the intention that they
will be kept together. But as I understand it, the Darwin assembler treats
the default TEXT section as a special case and moves it to the beginning of
the file, which means that all those DWARF sections are in the middle of
the text.  With this change, the EmitStartOfAsmFile hook is called before
the DWARF section directives are emitted, so that all the PPC text section
directives come out right at the beginning of the file.

llvm-svn: 83176
2009-09-30 22:06:26 +00:00
Douglas Gregor 66950a32d9 When overload resolution fails for an overloaded operator, show the
overload candidates (but not the built-in ones). We still rely on the
underlying built-in semantic analysis to produce the initial
diagnostic, then print the candidates following that diagnostic. 

One side advantage of this approach is that we can perform more validation
of C++'s operator overloading with built-in candidates vs. the
semantic analysis for those built-in operators: when there are no
viable candidates, we know to expect an error from the built-in
operator handling code. Otherwise, we are not modeling the built-in
semantics properly within operator overloading. This is checked as:

      assert(Result.isInvalid() && 
             "C++ binary operator overloading is missing
             candidates!");
      if (Result.isInvalid())
        PrintOverloadCandidates(CandidateSet, /*OnlyViable=*/false);

The assert() catches cases where we're wrong in a +Asserts build. The
"if" makes sure that, if this happens in a production clang
(-Asserts), we still build the proper built-in operator and continue
on our merry way. This is effectively what happened before this
change, but we've added the assert() to catch more flies.

llvm-svn: 83175
2009-09-30 21:46:01 +00:00
Bob Wilson 64c8d5a004 Fix a comment typo.
llvm-svn: 83174
2009-09-30 21:44:42 +00:00
Douglas Gregor 3dc959f88b Tweak CHECK lines to eliminate a failure on i686-apple-darwin10
llvm-svn: 83173
2009-09-30 21:39:51 +00:00
Devang Patel 48575e3f2e Check for null MDNode element while printing comment.
llvm-svn: 83172
2009-09-30 21:26:51 +00:00
Bob Wilson 53904987ae Fix a comment.
llvm-svn: 83171
2009-09-30 21:26:13 +00:00
Bob Wilson 699702e0a8 The AsmPrinter base class contains a DwarfWriter member, so there's no need
for derived AsmPrinters to add another one.  In some cases, fixing this
removes the need to override the doInitialization method.

llvm-svn: 83170
2009-09-30 21:24:45 +00:00
Fariborz Jahanian db82308633 Issue good diagnostics when initializing a refernce type with
a bad initializer. Fixes pr4274.

llvm-svn: 83169
2009-09-30 21:23:30 +00:00
Jeffrey Yasskin 8ce67f83bc Assert that ConstantArrays are created with correctly-typed elements.
llvm-svn: 83168
2009-09-30 21:08:08 +00:00
Dan Gohman ea0bb8f555 Fix this code so that it doesn't try to iterate through a std::vector
while calling changeImmediateDominator, which removes elements from the
vector. This fixes PR5097.

llvm-svn: 83166
2009-09-30 20:54:16 +00:00
Tanya Lattner fd2dcba7f3 Add an error for function parameters that have a qualified address space since this is not allowed by the embedded c extension spec.
llvm-svn: 83165
2009-09-30 20:47:43 +00:00
Reid Kleckner cea8dab1d1 Silence comparison always false warning in -Asserts mode.
llvm-svn: 83164
2009-09-30 20:43:07 +00:00
Jim Grosbach c87197784a Add additional assert() to verify no extraneous use of a scavenged register.
llvm-svn: 83163
2009-09-30 20:35:36 +00:00
Chris Lattner b355495660 fix line #'s
llvm-svn: 83162
2009-09-30 20:20:06 +00:00
Chris Lattner 859f1b5b86 add some more popular examples, color code warning: and error: like the command line.
llvm-svn: 83161
2009-09-30 20:19:10 +00:00
Devang Patel 711ab5b8ec Print tag name for MDNodes that are used to encode debug info.
llvm-svn: 83160
2009-09-30 20:16:54 +00:00
Reid Kleckner 8ff5c19ebd Fix integer overflow in instruction scheduling. This can happen if we have
basic blocks that are so long that their size overflows a short.

Also assert that overflow does not happen in the future, as requested by Evan.

This fixes PR4401.

llvm-svn: 83159
2009-09-30 20:15:38 +00:00
Chris Lattner 24440102aa Convert from nonportable grep to filecheck, patch by John Thompson
llvm-svn: 83158
2009-09-30 19:55:07 +00:00
Douglas Gregor 49663d2a23 Update C++ status page
llvm-svn: 83157
2009-09-30 18:32:57 +00:00
Fariborz Jahanian ac3005cecc Note location of operators caused the circularity.
llvm-svn: 83153
2009-09-30 17:46:20 +00:00
Devang Patel 7ba3c0906b Silence unused variable warning.
llvm-svn: 83151
2009-09-30 17:13:41 +00:00
Fariborz Jahanian e01e434aef <rdar://problem/7263113> Make clang produce gcc's objc_assign_StrongCast as a result of type-cast of an ivar in assignment.
llvm-svn: 83150
2009-09-30 17:10:29 +00:00
Chris Lattner e0527b2de1 update copyright.
llvm-svn: 83149
2009-09-30 15:59:45 +00:00
Jim Grosbach a2fe1a6811 Clarify comment phrasing.
llvm-svn: 83148
2009-09-30 15:23:38 +00:00
Evan Cheng ce5a8ca3ef Add a option which would move ld/st multiple pass before post-alloc scheduling.
llvm-svn: 83145
2009-09-30 08:53:01 +00:00
Evan Cheng f305ead1cc Add a target hook to add pre- post-regalloc scheduling passes.
llvm-svn: 83144
2009-09-30 08:49:50 +00:00
Evan Cheng 3ea1ba7739 Forgot this test earlier.
llvm-svn: 83143
2009-09-30 08:41:27 +00:00
Chris Lattner d6248143fa add macruby, fix a validation problem.
llvm-svn: 83142
2009-09-30 06:27:22 +00:00
Nick Lewycky 6d59690c3e Fix compile error as debug interface changed.
By the way, this code is buggy. You can't keep a map<MDNode *, something>
because the MDNode may be destroyed and reused for something else.

llvm-svn: 83141
2009-09-30 04:50:26 +00:00
Mike Stump 2e722b915c Improve debugging information for BlockDeclRefExpr. WIP. Given this
scheme, we can switch the previous scheme over to using this code
path.  There's a bit of simplifications yet to do as well.

llvm-svn: 83138
2009-09-30 02:43:10 +00:00
Jim Grosbach 882f4c11ed replace TRI->isVirtualRegister() with TargetRegisterInfo::isVirtualRegister()
per customary usage

llvm-svn: 83137
2009-09-30 01:47:59 +00:00
Jim Grosbach 70ce8a03b1 When checking whether we need to reserve a register for the scavenger,
the size of the saved frame pointer needs to be taken into account.

llvm-svn: 83136
2009-09-30 01:43:29 +00:00
Jim Grosbach bcad0c8421 Add "isBarrier = 1" to return instructions.
Patch by Sylvere Teissier.

llvm-svn: 83135
2009-09-30 01:35:11 +00:00
John McCall bd0465bbd2 Spare the processors of those poor wretches who have no choice but to write
unbounded chains of operator-> delegations.

llvm-svn: 83134
2009-09-30 01:30:54 +00:00
John McCall c1538c08d7 Detect operator-> chains of arbitrary length. Use a terrible data structure
to strike fear into the hearts of CPUs everywhere.

llvm-svn: 83133
2009-09-30 01:01:30 +00:00
Jim Grosbach cdd3e35005 fix compiler warning
llvm-svn: 83132
2009-09-30 00:37:40 +00:00
David Goodwin 8dc2f6fefa Remove regression that requires post-RA scheduling from a target that does not use that scheduler.
llvm-svn: 83128
2009-09-30 00:23:57 +00:00
Bob Wilson 20e5f5ed79 For Darwin, emit all the text section directives together before the dwarf
section directives.  This causes the assembler to put the text sections at
the beginning of the object file, which helps work around a limitation of the
Darwin ARM relocations.  Radar 7255355.

llvm-svn: 83127
2009-09-30 00:23:42 +00:00
Fariborz Jahanian 10ce958550 self-referecing operator '->' member function was causing
infinit recursion. This patch fixes it. [13.3.1.2]-p2

llvm-svn: 83124
2009-09-30 00:19:41 +00:00
Devang Patel c2105298cc Simplify.
llvm-svn: 83123
2009-09-30 00:14:40 +00:00
David Goodwin 17199b56b0 Remove -post-RA-schedule flag and add a TargetSubtarget method to enable post-register-allocation scheduling. By default it is off. For ARM, enable/disable with -mattr=+/-postrasched. Enable by default for cortex-a8.
llvm-svn: 83122
2009-09-30 00:10:16 +00:00
Douglas Gregor aa0beea9a1 Forward-declare ValueSymbolTable so that SymbolTableListTraits.h can be parsed by itself
llvm-svn: 83121
2009-09-30 00:08:25 +00:00
Mike Stump 14cf8ecf0b Add a way for a frontend to generate more complex dwarf location
information.  This allows arbitrary code involving DW_OP_plus_uconst
and DW_OP_deref.  The scheme allows for easy extention to include,
any, or all of the DW_OP_ opcodes.  I thought about just exposing all
of them, but, wasn't sure if people wanted the dwarf opcodes exposed
in the api.  Is that a layering violation?

With this scheme, the entire existing block scheme used by llvm-gcc
can be switched over to the new scheme.  I think that would be
cleaner, as then the compiler specific bits are not present in llvm
proper.  Before the old code can be yanked however, similar code in
clang would have to be removed.

Next up, more testing.

llvm-svn: 83120
2009-09-30 00:08:22 +00:00
Douglas Gregor 80a6cc5800 Find operators new/delete in base classes. FIXME -= 2;
llvm-svn: 83119
2009-09-30 00:03:47 +00:00
Jim Grosbach fa6847f099 minor cleanup and add clarifying comment
llvm-svn: 83117
2009-09-29 23:17:20 +00:00
John McCall a192536ebe Desugaring optimizations. Add single-step desugaring methods to all
concrete types.  Use unqualified desugaring for getAs<> and sundry.
Fix a few users to either not desugar or use qualified desugar, as seemed
appropriate.  Removed Type's qualified desugar method, as it was easy
to accidentally use instead of QualType's.

llvm-svn: 83116
2009-09-29 23:03:30 +00:00
Devang Patel 7b4d52b170 Lookup handler name only when assertions are enabled.
llvm-svn: 83114
2009-09-29 22:05:52 +00:00
Douglas Gregor 98496dc3eb The C++ delete expression strips cv-qualifiers from the pointed-to type. My previous fix eliminated this behavior, so bring it back again.
llvm-svn: 83113
2009-09-29 21:38:53 +00:00
Argyrios Kyrtzidis 8da9ce6328 Pull TypeLocVisitor into its own header file.
llvm-svn: 83112
2009-09-29 21:27:32 +00:00