Commit Graph

78878 Commits

Author SHA1 Message Date
Ted Kremenek d98d22b9af Enhance the unused ivar checker to not consider an ivar to be accidentally unused
when it is explicitly marked as unused via __attribute__((unused)).

llvm-svn: 97104
2010-02-25 03:26:55 +00:00
Ted Kremenek 6bf658abef Allow __attribute__((unused)) to be applied to ObjC ivars.
llvm-svn: 97103
2010-02-25 03:26:51 +00:00
Daniel Dunbar 12ee380a61 Driver: Use TextDiagnosticPrinter instead of a custom one.
llvm-svn: 97102
2010-02-25 03:23:43 +00:00
Daniel Dunbar aa7d55a3fe Add TextDiagnosticPrinter::setPrefix, for adding a string to prefix diagnostic
messages with.

llvm-svn: 97101
2010-02-25 03:23:40 +00:00
Dan Gohman ec4e1b67bf Truncate from i64 to i32 is "free" on x86-32, because it involves
just discarding one of the registers.

llvm-svn: 97100
2010-02-25 03:04:36 +00:00
Scott Michel 4a99c34873 Revert this patch for the time being. Needs more testing.
llvm-svn: 97099
2010-02-25 02:32:54 +00:00
Johnny Chen 57656da73f Added tSVC and tTRAP for disassembly only.
llvm-svn: 97098
2010-02-25 02:21:11 +00:00
Chris Lattner fef371d2f6 formatting.
llvm-svn: 97097
2010-02-25 02:09:00 +00:00
Chris Lattner 2c3f6492b0 rename fooMatcherNode to fooMatcher.
llvm-svn: 97096
2010-02-25 02:04:40 +00:00
Douglas Gregor 6aade28fd3 Remove some oogly code made dead by the pseudo-destructor
instantiation changes.

llvm-svn: 97095
2010-02-25 02:00:27 +00:00
Chris Lattner c36ab923c6 add some noop code to push it out of my tree.
llvm-svn: 97094
2010-02-25 01:57:41 +00:00
Chris Lattner ac55f9df88 rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does.  Switch the sense of the Next and the Check
arms to be more logical.  No functionality change.

llvm-svn: 97093
2010-02-25 01:56:48 +00:00
Douglas Gregor 678f90df09 Use CXXPseudoDestructorExpr as the stored representation for dependent
expressions that look like pseudo-destructors, e.g.,

  p->T::~T()

where p has dependent type.

At template instantiate time, we determine whether we actually have a
pseudo-destructor or a member access, and funnel down to the
appropriate routine in Sema.

Fixes PR6380.

llvm-svn: 97092
2010-02-25 01:56:36 +00:00
Scott Michel 0ab0ad93bd Large stack frame patch for the CellSPU: handle stack frames that exceed 8176
(511*16) bytes register displacement (D-form).

NOTE: This is a potential headache, given the SPU's local core limitations,
allowing the software developer to commit stack overrun suicide unknowingly.
Also, large SPU stack frames will cause code size explosion. But, one presumes
that the software developer knows what they're doing...

Contributed by Kalle.Raiskila@nokia.com, edited slightly before commit.

llvm-svn: 97091
2010-02-25 01:53:17 +00:00
John McCall 65eb879d22 Catch more uses of uninitialized implicit conversion sequences.
When diagnosing bad conversions, skip the conversion for ignored object
arguments.  Fixes PR 6398.

llvm-svn: 97090
2010-02-25 01:37:24 +00:00
Jeffrey Yasskin e776fbfb82 Filter the future all-of-llvm shared library out of the llvm-config
results.  I'm checking this in before the shared library so that I can
tell if it breaks anything on its own.

llvm-svn: 97089
2010-02-25 01:21:38 +00:00
Ted Kremenek 8cf9eeb519 Remove test case dependancy on platform headers.
llvm-svn: 97088
2010-02-25 01:16:07 +00:00
Bill Wendling 98aa245070 MC'ize padding when padding the ULEB128 value.
llvm-svn: 97087
2010-02-25 00:24:52 +00:00
Ted Kremenek d55522f02e Add UnixAPIChecker, a meta checker to include various precondition checks for calls
to various unix/posix functions, e.g. 'open()'.

As a first check, check that when 'open()' is passed 'O_CREAT' that it has
a third argument.

llvm-svn: 97086
2010-02-25 00:20:35 +00:00
Ted Kremenek bfe9f5f4db Remove stray #include.
llvm-svn: 97085
2010-02-25 00:20:31 +00:00
Ted Kremenek ad744f4b88 Remove #include.
llvm-svn: 97084
2010-02-25 00:20:28 +00:00
Ted Kremenek 11e899c199 Divide list of registration functions in API and foundational checks. Also trim whitespace.
llvm-svn: 97083
2010-02-25 00:20:25 +00:00
Ted Kremenek 43fddf77a4 Sort list of checker registration functions.
llvm-svn: 97082
2010-02-25 00:20:22 +00:00
Chris Lattner e03e2fa3ed add a fixme for an experiment that defeated me for the time being.
llvm-svn: 97081
2010-02-25 00:03:03 +00:00
Douglas Gregor cdbd51551b Keep track of the location of the '~' in a pseudo-destructor expression.
llvm-svn: 97080
2010-02-24 23:50:37 +00:00
Douglas Gregor 651fe5ec20 Retain complete source information for the type after the '~' in a
CXXPseudoDestructorExpr. 

Update template instantiation for pseudo-destructor expressions to use
this source information and to make use of
Sema::BuildPseudoDestructorExpr when the base expression is dependent
or refers to a scalar type.

llvm-svn: 97079
2010-02-24 23:40:28 +00:00
Bill Wendling 88fdcd323d LLVM puts padding bytes in the __gcc_except_tab section after the
GCC_except_table label but before the Lexception, which the FDE references.
This causes problems as the FDE does not point to the start of an LSDA chunk.

Use an unnormalized uleb128 for the call-site table length that includes the
padding.

llvm-svn: 97078
2010-02-24 23:34:35 +00:00
Douglas Gregor 40d732fee7 Make sure that we finish the DeclSpec when parsing a C++
type-specifier-seq. Fixes some conditional-jump-on-unitialized-value
errors in valgrind. Also counts as attempt #2 at making the MSVC
buildbot happy.

llvm-svn: 97077
2010-02-24 23:13:13 +00:00
Douglas Gregor 90ad922a73 Make sure that we have type source information for the scope type of a
pseudo-destructor expression. Attempt #1 at fixing the MSVC buildbot.

llvm-svn: 97076
2010-02-24 23:02:30 +00:00
Fariborz Jahanian 1f7fe2c7f7 Added test case for non-objective-c situation in
my last patch.

llvm-svn: 97075
2010-02-24 22:53:58 +00:00
Chris Lattner 005bb14825 fix a bug I introduced by checking the wrong node's VT in OPC_CheckChildXType
llvm-svn: 97074
2010-02-24 22:52:52 +00:00
Fariborz Jahanian 8652be05b7 Implement nasty rewriting of nested blocks when inner
blocks use variables not used in any of the outer blocks.
(Fixes radar 7682149).

llvm-svn: 97073
2010-02-24 22:48:18 +00:00
Chris Lattner d3aa3aa0ec clean up various VT manipulations, patch by Micah Villmow! PR6337
llvm-svn: 97072
2010-02-24 22:44:06 +00:00
Jakob Stoklund Olesen 63af51c1c8 Create a stack frame on ARM when
- Function uses all scratch registers AND
- Function does not use any callee saved registers AND
- Stack size is too big to address with immediate offsets.

In this case a register must be scavenged to calculate the address of a stack
object, and the scavenger needs a spare register or emergency spill slot.

llvm-svn: 97071
2010-02-24 22:43:17 +00:00
Douglas Gregor b1dd23fbc4 Split ActOnPseudoDestructorExpr into the part that interprets the
parser's data structures and the part that performs semantic analysis
and AST building, in preparation for improved template instantiation
of pseudo-destructor expressions.

llvm-svn: 97070
2010-02-24 22:38:50 +00:00
Chris Lattner 8423d0241f fix PR5954, patch by Roman Divacky.
I don't have a great way to test this myself (it's linux/bsd only), 
but Roman says it works. :)

llvm-svn: 97069
2010-02-24 22:33:41 +00:00
Anders Carlsson 3c1ec97a28 Get rid of 'this' adjustments from the FinalOverriders class since they can be different for the same overrider in different parts of the vtable.
llvm-svn: 97068
2010-02-24 22:32:18 +00:00
Anders Carlsson d8d698da60 Improve this adjustment pointer calculation.
llvm-svn: 97067
2010-02-24 22:27:12 +00:00
Anders Carlsson 8025e7b1b9 Make ComputeThisAdjustmentBaseOffset public for now.
llvm-svn: 97066
2010-02-24 22:18:01 +00:00
Bob Wilson ba8ac74fd9 Check for comparisons of +/- zero when optimizing less-than-or-equal and
greater-than-or-equal SELECT_CCs to NEON vmin/vmax instructions.  This is
only allowed when UnsafeFPMath is set or when at least one of the operands
is known to be nonzero.

llvm-svn: 97065
2010-02-24 22:15:53 +00:00
Dan Gohman 4b2b48daba Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.

Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.

Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.

This fixes PR1784.

llvm-svn: 97064
2010-02-24 22:05:23 +00:00
Douglas Gregor 26623cb13e Add test case for PR6141, which was fixed a few days ago
llvm-svn: 97063
2010-02-24 21:54:27 +00:00
Douglas Gregor f06027db65 Add test for AST importing of C++ namespaces, missing from a prior commit
llvm-svn: 97062
2010-02-24 21:53:36 +00:00
Douglas Gregor 8b1d732f85 Add PCH test for C++ namespaces, missing from a previous commit
llvm-svn: 97061
2010-02-24 21:52:55 +00:00
Douglas Gregor 75d8ec1fbe Retain source information for the "type-name ::" in a
pseudo-destructor expression such as

  p->T::~T()

llvm-svn: 97060
2010-02-24 21:52:20 +00:00
Chris Lattner 9b7cfd39b2 convert cycle checker to smallptrset, add comments and make it
more elegant.

llvm-svn: 97059
2010-02-24 21:34:04 +00:00
Douglas Gregor 0d5b0a1e5e ActOnPseudoDestructorExpr now performs all semantic analysis for
pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr
node directly. Currently, this only affects pseudo-destructor
expressions when they are parsed, but not after template
instantiation. That's coming next...

Improve parsing of pseudo-destructor-names. When parsing the
nested-name-specifier and we hit the sequence of tokens X :: ~, query
the actual module to determine whether X is a type-name (in which case
the X :: is part of the pseudo-destructor-name but not the
nested-name-specifier) or not (in which case the X :: is part of the
nested-name-specifier). 

llvm-svn: 97058
2010-02-24 21:29:12 +00:00
Chris Lattner 02ec121de8 revert david's patch which does not even build.
llvm-svn: 97057
2010-02-24 21:25:08 +00:00
David Greene 8328341d9c Use a SmallPtrSet as suggested by Chris.
llvm-svn: 97056
2010-02-24 20:59:49 +00:00
John McCall aea181de04 Fix an iterator-invalidation bug that was causing selfhost errors
on non-darwin platforms.  Fixes PR6411. Test case doesn't reduce,
unfortunately.

llvm-svn: 97055
2010-02-24 20:32:01 +00:00