Commit Graph

75437 Commits

Author SHA1 Message Date
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
Fariborz Jahanian 1a5f292fbf Do not diagnose method disguised as property setter
for a 'readonly' property. Fixes radar 7427072.

llvm-svn: 92808
2010-01-06 00:18:12 +00:00
Bill Wendling 578865ff3d Only check the ordering if there is an ordering for each nodes.
llvm-svn: 92807
2010-01-06 00:09:23 +00:00
Bill Wendling 0a7056fe52 Add a semi-primitive form of scheduling via the "SDNode ordering" to the
bottom-up scheduler. We prefer the lower order number.

llvm-svn: 92806
2010-01-05 23:48:12 +00:00
John McCall 1be1c63634 Add Expr::EvaluateAsBooleanCondition(), which does unprincipled folding to
try to evaluate an expression as a constant boolean condition.  This has
the same intended semantics as used in folding conditional operators.

llvm-svn: 92805
2010-01-05 23:42:56 +00:00
Ted Kremenek e50486bbca Remove unused variables.
llvm-svn: 92804
2010-01-05 23:22:20 +00:00
Ted Kremenek bde648030b Remove deprecated function 'clang_getDeclSource()'. Use 'clang_getDeclFile()' instead.
llvm-svn: 92803
2010-01-05 23:21:30 +00:00
Ted Kremenek a44d99c934 Add C API hook 'clang_getDeclExtent()', which returns the source extent of a declaration. This implements <rdar://problem/7280072>.
llvm-svn: 92802
2010-01-05 23:18:49 +00:00
Fariborz Jahanian b8646edecd Fixed a bug where initializer is a macro in rewrite.
llvm-svn: 92801
2010-01-05 23:06:29 +00:00
Chris Lattner 8600dd3d7c simplify this code.
llvm-svn: 92800
2010-01-05 23:00:30 +00:00
Dan Gohman f34b289057 Move this test from test/Transforms/IndVarSimplify to
test/CodeGen/X86, as doesn't use -indvars, and it does use
llc -march=x86-64.

llvm-svn: 92799
2010-01-05 22:52:54 +00:00
Bill Wendling 03f0af372c Don't assign the shift the same type as the variable being shifted. This could
result in illegal types for the SHL operator.

llvm-svn: 92797
2010-01-05 22:39:10 +00:00
Johnny Chen 567945636f Undo r92785, it caused test failure.
llvm-svn: 92796
2010-01-05 22:37:28 +00:00
Chris Lattner 554d0564ff make this a static function instead of a method.
llvm-svn: 92795
2010-01-05 22:30:42 +00:00
Dan Gohman 404a984780 Don't use the ISD::NodeType enum for SDNode opcodes, as CodeGen
uses several kinds of opcode values which are not declared within
that enum. This fixes PR5946.

llvm-svn: 92794
2010-01-05 22:26:32 +00:00
Victor Hernandez dc6e65a6a8 Re-add parsing of function-local metadata; this time with testcase.
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Chris Lattner a93c63c22d more rearrangement and cleanup, fix my test failure.
llvm-svn: 92792
2010-01-05 22:21:18 +00:00
Chris Lattner f476ef502c cleanup
llvm-svn: 92790
2010-01-05 22:07:33 +00:00
Ted Kremenek 9cd9f6d861 Split (mostly nonexistent) USR code out from the main CIndex logic.
llvm-svn: 92789
2010-01-05 22:06:45 +00:00
Chris Lattner f88dd5ed64 remove two trunc xforms that are subsumed by EvaluateInDifferentType.
The only difference is that EvaluateInDifferentType checks to ensure
they are profitable before doing them :)

llvm-svn: 92788
2010-01-05 22:01:41 +00:00
Douglas Gregor 26751ffc53 Silence bogus GCC warning
llvm-svn: 92787
2010-01-05 21:55:26 +00:00
Chris Lattner 7c0c64831c merge some tests.
llvm-svn: 92786
2010-01-05 21:54:09 +00:00
Johnny Chen a9f39bdbb6 Add Rt2 to the asm format string for 32-bit Thumb load/store register dual
instructions.  Thumb does not have the restriction that t2 = t+1.

llvm-svn: 92785
2010-01-05 21:51:46 +00:00
Chris Lattner dec34d8cef merge cast2 into cast.ll
llvm-svn: 92784
2010-01-05 21:48:13 +00:00
Devang Patel 6edcd3994c Allow null to be an element of NamedMDNode. e.g. !llvm.stuff = !{!0, !1, null}
llvm-svn: 92783
2010-01-05 21:47:32 +00:00
Chris Lattner f312cfa250 remove useless test.
llvm-svn: 92782
2010-01-05 21:46:22 +00:00
Chris Lattner 16c7a332d2 another example.
llvm-svn: 92781
2010-01-05 21:43:08 +00:00
Daniel Dunbar d79f40ac7a Fix -plugin command line argument syntax for clang -cc1 change.
llvm-svn: 92780
2010-01-05 21:42:23 +00:00
Douglas Gregor 1a68ab6c83 Make use of available_externally linkage for vtables when the
non-inline key function of a class template instantiation, when no key
function is present, the class template instantiation itself was
instantiated with an explicit instantiation declaration (aka extern
template). I'm fairly certain that the C++0x specification gives us
this lattitude, although GCC doesn't take advantage of it.

llvm-svn: 92779
2010-01-05 21:40:05 +00:00