Commit Graph

75465 Commits

Author SHA1 Message Date
Douglas Gregor 712dcfe921 Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.

llvm-svn: 92879
2010-01-07 00:31:29 +00:00
Douglas Gregor 43a0857631 When we typo-correct a base class initializer, point to the base class
specifier that we corrected to.

llvm-svn: 92878
2010-01-07 00:26:25 +00:00
Douglas Gregor 6da83624e4 Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).

llvm-svn: 92877
2010-01-07 00:17:44 +00:00
Jim Grosbach b907a467e2 80 column violations
llvm-svn: 92876
2010-01-06 23:54:42 +00:00
Fariborz Jahanian bdf198bc59 Fixes the test.
llvm-svn: 92875
2010-01-06 23:54:34 +00:00
Jakob Stoklund Olesen 29c7234eb7 Allow double defs after tail duplication.
llvm-svn: 92874
2010-01-06 23:52:46 +00:00
Jakob Stoklund Olesen 29a64c9575 Add Target hook to duplicate machine instructions.
Some instructions refer to unique labels, and so cannot be trivially cloned
with CloneMachineInstr.

llvm-svn: 92873
2010-01-06 23:47:07 +00:00
Jim Grosbach 5fd6feb883 Addressing mode 6 (load/store) instructions can't encode an immediate offset
for stack references.

llvm-svn: 92871
2010-01-06 23:45:18 +00:00
Douglas Gregor 10f1e4dda8 When suggesting a typo correction for an @implementation without a
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.

Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.

llvm-svn: 92870
2010-01-06 23:44:25 +00:00
Ted Kremenek 2a43fd58ee Change clang_getDeclExtent() to have the endpoint point to the last character in the last token.
llvm-svn: 92869
2010-01-06 23:43:31 +00:00
Fariborz Jahanian 017a6067e5 Test case for rewriting of __weak byref objects.
llvm-svn: 92868
2010-01-06 23:31:34 +00:00
Douglas Gregor 03e8bdc07e Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.

llvm-svn: 92867
2010-01-06 23:17:19 +00:00
John McCall 7443052652 Don't assert when dealing with unsigned casts of lvalues. Fixes PR5961.
llvm-svn: 92866
2010-01-06 22:57:21 +00:00
Jim Grosbach a7cef4fab5 Anti-dependency breaking needs to be careful regarding instructions with
multiple register definitions.

llvm-svn: 92864
2010-01-06 22:21:25 +00:00
Douglas Gregor b3d8deecbf Add test from PR5913, which has already been fixed
llvm-svn: 92863
2010-01-06 22:09:05 +00:00
John McCall 2ce81adbb3 Derive tighter ranges for & and >> in the conversion-checking code.
llvm-svn: 92862
2010-01-06 22:07:33 +00:00
Douglas Gregor dfdda291e0 Add testcase for PR5817, although the bug was already fixed
llvm-svn: 92858
2010-01-06 22:06:13 +00:00
Douglas Gregor 2a34df3264 Fix linkage for RTTI names by re-using the logic for computing the
linkage of vtables. Before this, we were emitting RTTI names for
template instantiations with strong external linkage rather than with
weak ODR linkage.

llvm-svn: 92857
2010-01-06 22:00:56 +00:00
Fariborz Jahanian 8e356bfe28 Fix a bug when property is redeclared in multiple
continuation classes and its original declaration
is imported from a protocol. This fixes radar 7509234.

llvm-svn: 92856
2010-01-06 21:38:30 +00:00
Douglas Gregor ccecc1bb43 Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class
llvm-svn: 92855
2010-01-06 20:27:16 +00:00
Eric Christopher 2cdb806fd8 Move the object size intrinsic optimization to inst-combine and make
it work for any integer size return type.

llvm-svn: 92853
2010-01-06 20:04:44 +00:00
Evan Cheng 746012a6c1 Comment.
llvm-svn: 92850
2010-01-06 19:43:21 +00:00
Evan Cheng 166a4e6caa Teach dag combine to fold the following transformation more aggressively:
(OP (trunc x), (trunc y)) -> (trunc (OP x, y))

Unfortunately this simple change causes dag combine to infinite looping. The problem is the shrink demanded ops optimization tend to canonicalize expressions in the opposite manner. That is badness. This patch disable those optimizations in dag combine but instead it is done as a late pass in sdisel.

This also exposes some deficiencies in dag combine and x86 setcc / brcond lowering. Teach them to look pass ISD::TRUNCATE in various places.

llvm-svn: 92849
2010-01-06 19:38:29 +00:00
David Chisnall 9a2073c035 Fix for PR5691
llvm-svn: 92846
2010-01-06 18:02:59 +00:00
Douglas Gregor 3e38656da4 Fix struct/class mismatch
llvm-svn: 92841
2010-01-06 17:16:00 +00:00
Douglas Gregor 859f0ae041 Make sure that the key-function computation produces the correct
result for a nested class whose first non-pure virtual member function
has an inline body. Previously, we were checking for the key function
before we had seen the (delayed) inline body. 

llvm-svn: 92839
2010-01-06 17:00:51 +00:00
Victor Hernandez 127286c58b When parsing function-local metadata, create a function-local MDNode
llvm-svn: 92838
2010-01-06 17:00:21 +00:00
Jim Grosbach eb431da074 80 column and whitespace cleanup
llvm-svn: 92837
2010-01-06 16:48:02 +00:00
Duncan Sands c8493da5b1 Fix a README item: have functionattrs look through selects and
phi nodes when deciding which pointers point to local memory.
I actually checked long ago how useful this is, and it isn't
very: it hardly ever fires in the testsuite, but since Chris
wants it here it is!

llvm-svn: 92836
2010-01-06 15:37:47 +00:00
John McCall fd0b2f8fe4 Improve the diagnostics used to report implicitly-generated class members
as parts of overload sets.  Also, refer to constructors as 'constructors'
rather than functions.

Adjust a lot of tests.

llvm-svn: 92832
2010-01-06 09:43:14 +00:00
Mikhail Glushenkov 40d2429b28 Formatting.
llvm-svn: 92831
2010-01-06 09:20:39 +00:00
Lang Hames 68dd9c7dd7 Fixed malformed -*- lines in PBQP headers.
llvm-svn: 92830
2010-01-06 08:53:34 +00:00
Duncan Sands 78376ad7e1 Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.

llvm-svn: 92829
2010-01-06 08:45:52 +00:00
Daniel Dunbar a671c2a9fe Fix (invalid) may-be-uninitialized warning.
llvm-svn: 92828
2010-01-06 07:13:04 +00:00
Daniel Dunbar 143a5b9f3c Add missing CINDEX_LINKAGE.
llvm-svn: 92827
2010-01-06 06:51:48 +00:00
Duncan Sands 2e728619f0 This is testing a darwin specific feature, so only turn
it on for darwin (it fails on linux).

llvm-svn: 92826
2010-01-06 05:49:26 +00:00
Daniel Dunbar 4ff42d6500 Add _clang_getDeclExtent to export list.
llvm-svn: 92825
2010-01-06 05:41:00 +00:00
Chris Lattner 4339f2abdb tweaks suggested by Duncan
llvm-svn: 92824
2010-01-06 05:32:15 +00:00
John McCall 70aa5391dd Significantly rework the calculation of effective integer-expression ranges
for -Wsign-compare and -Wconversion, and use that coordinated logic to drive
both diagnostics.  The new logic works more transparently with implicit
conversions, conditional operators, etc., as well as bringing -Wconversion's
ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to
-Wsign-compare.

Fixes PRs 5887, 5937, 5938, and 5939.

llvm-svn: 92823
2010-01-06 05:24:50 +00:00
Douglas Gregor d01472beee Revert my available_externally vtables experiment. It's breaking the LLVM-with-Clang build with linker errors that I have yet to investigate.
llvm-svn: 92822
2010-01-06 04:50:56 +00:00
Douglas Gregor 0a0f04dcb9 Make our marking of virtual members functions in a class be
deterministic and work properly with templates. Once a class that
needs a vtable has been defined, we now do one if two things:

  - If the class has no key function, we place the class on a list of
    classes whose virtual functions will need to be "marked" at the
    end of the translation unit. The delay until the end of the
    translation unit is needed because we might see template
    specializations of these virtual functions.
  - If the class has a key function, we do nothing; when the key
    function is defined, the class will be placed on the
    aforementioned list.

At the end of the translation unit, we "mark" all of the virtual
functions of the classes on the list as used, possibly causing
template instantiation and other classes to be added to the
list. This gets LLVM's lib/Support/CommandLine.cpp compiling again.

llvm-svn: 92821
2010-01-06 04:44:19 +00:00
Ted Kremenek 991eb3f6c0 Add enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().
llvm-svn: 92820
2010-01-06 03:42:32 +00:00
Mike Stump 81478719a7 Reorder to avoid invalidating idx which is an accessor into VCall.
llvm-svn: 92819
2010-01-06 03:09:19 +00:00
Dale Johannesen 237b1c12be Reenable debug info on PPC. Works well enough to
bootstrap.

llvm-svn: 92818
2010-01-06 02:21:00 +00:00
Dale Johannesen 3257b4cc9b Make sure debug info hook gets called when emitting
synonyms for PPC.

llvm-svn: 92817
2010-01-06 02:20:18 +00:00
Mike Stump 13c6670273 Fix spelling.
llvm-svn: 92816
2010-01-06 02:05:39 +00:00
Chris Lattner 98748c0964 Teach instcombine's sext elimination logic to be more aggressive.
Previously, instcombine would only promote an expression tree to
the larger type if doing so eliminated two casts.  This is because
a need to manually do the sign extend after the promoted expression
tree with two shifts.  Now, we keep track of whether the result of
the computation is going to be properly sign extended already.  If
so, we can unconditionally promote the expression, which allows us
to zap more sext's.

This implements rdar://6598839 (aka gcc pr38751)

llvm-svn: 92815
2010-01-06 01:56:21 +00:00
Jakob Stoklund Olesen 7725526de1 Add <imp-def> and <imp-kill> operands when replacing virtual sub-register defs and kills.
An instruction like this:

  %reg1097:1<def> = VMOVSR %R3<kill>, 14, %reg0

Must be replaced with this when substituting physical registers:

  %S0<def> = VMOVSR %R3<kill>, 14, %reg0, %D0<imp-def>

llvm-svn: 92812
2010-01-06 00:29:28 +00:00
Bill Wendling c075acbb54 The previous code could potentially cause a cycle. Allow ordering w.r.t. a 0 order.
llvm-svn: 92810
2010-01-06 00:23:35 +00:00
Ted Kremenek e51136ee05 Per offline discussion with Doug, don't perform typo correction when we have encountered a fatal error. On some files that are woefully wrong (missing headers) this can cause a 3x slowdown in some cases when parsing the file. It makes sense not to perform typo correction in this case because after a fatal error diagnostics will either be suppressed or not really make any sense.
llvm-svn: 92809
2010-01-06 00:23:04 +00:00