Commit Graph

10543 Commits

Author SHA1 Message Date
Devang Patel c0f58ea60b Emit super class debug info.
llvm-svn: 66580
2009-03-10 21:30:26 +00:00
Daniel Dunbar ee66cf2249 Driver: Handle magic -ccc- options.
- Follows ccc currently, but this functionality should eventually be
   outside the Driver lib.

llvm-svn: 66575
2009-03-10 20:52:46 +00:00
Douglas Gregor 79cf603428 Extend the notion of active template instantiations to include the
context of a template-id for which we need to instantiate default
template arguments.

In the TextDiagnosticPrinter, don't suppress the caret diagnostic if
we are producing a non-note diagnostic that follows a note diagnostic
with the same location, because notes are (conceptually) a part of the
warning or error that comes before them.

llvm-svn: 66572
2009-03-10 20:44:00 +00:00
Douglas Gregor 2a72edd413 If we run into multiple errors within the same template instantiation,
only print the template instantiation backtrace for the first error.

Also, if a base class has failed to type-check during instantiation,
just drop that base class and continue on to check other base classes.

llvm-svn: 66563
2009-03-10 18:52:44 +00:00
Douglas Gregor 65b2c4c381 Add pretty-printing for class template specializations, e.g.,
'struct A<double, int>'

In the "template instantiation depth exceeded" message, print
"-ftemplate-depth-N" rather than "-ftemplate-depth=N".

An unnamed tag type that is declared with a typedef, e.g., 

  typedef struct { int x, y; } Point;

can be used as a template argument. Allow this, and check that we get
sensible pretty-printing for such things.

llvm-svn: 66560
2009-03-10 18:33:27 +00:00
Douglas Gregor 805dd4cac7 When pretty-printing an anonymous tag type that is associated with a typedef, use the name of the typedef rather than <anonymous>
llvm-svn: 66559
2009-03-10 18:11:21 +00:00
Douglas Gregor 4ea568f213 Add a notion of "post-diagnostic hooks", which are callbacks attached
to a diagnostic that will be invoked after the diagnostic (if it is
not suppressed). The hooks are allowed to produce additional
diagnostics (typically notes) that provide more information. We should
be able to use this to help diagnostic clients link notes back to the
diagnostic they clarify. Comments welcome; I'll write up documentation
and convert other clients (e.g., overload resolution failures) if
there are no screams of protest.

As the first client of post-diagnostic hooks, we now produce a
template instantiation backtrace when a failure occurs during template
instantiation. There's still more work to do to make this output
pretty, if that's even possible.

llvm-svn: 66557
2009-03-10 18:03:33 +00:00
Fariborz Jahanian 156506e749 ir-gen support for class getter/setter call
using property dot-syntax.

llvm-svn: 66556
2009-03-10 18:03:11 +00:00
Daniel Dunbar 4095d89532 Remove some now-unneeded calls to llvm::errs().flush().
llvm-svn: 66555
2009-03-10 18:00:19 +00:00
Steve Naroff c7597f8efa Simplify SelectorTable::constructSetterName() usage...
llvm-svn: 66551
2009-03-10 17:24:38 +00:00
Anders Carlsson 0275115f66 Address Doug's comments wrt the mangler and fix Eli's test case
llvm-svn: 66549
2009-03-10 17:07:44 +00:00
Fariborz Jahanian 524bb20b4b More objc2's gc meta-data work related to ivar layout bitmap.
Work in progress.

llvm-svn: 66546
2009-03-10 16:22:08 +00:00
Chris Lattner 5013d3a893 update this, C headers don't need hacks anymore.
llvm-svn: 66544
2009-03-10 16:01:44 +00:00
Ted Kremenek 07393e0546 Update analyzer build.
llvm-svn: 66538
2009-03-10 07:03:32 +00:00
Chris Lattner f85a938985 Fix PR3682 by just disabling a broken assertion. This check should be
done in sema, and is reflected by the existing PR3258.  In the meantime,
fix PR3682 by disabling a bogus assertion (which doesn't account for + 
operands).

llvm-svn: 66533
2009-03-10 06:42:37 +00:00
Chris Lattner 6dd0f9263d reduce duplication of parsing code between %0 and %x0 and
add support for modifiers on named references, like %c[foo].

llvm-svn: 66532
2009-03-10 06:38:02 +00:00
Chris Lattner d7d5fdf090 move matching of named operands into AsmStmt class. At the same
time handle + operands in operand counting, fixing asm.c:t7 to
expand into $2 instead of $1.

llvm-svn: 66531
2009-03-10 06:33:24 +00:00
Chris Lattner 80337892f4 reduce nesting, use memchr instead of explicit loop, eliminate a
temporary std::string to fix a fixme.

llvm-svn: 66530
2009-03-10 06:11:34 +00:00
Chris Lattner 2d43eaefa2 Expand %= into ${:uid} so that the code generator emits a unique ID for the
asm.  This allows us to properly handle the case when an optimizer duplicates
the asm, such as here:

void bar() {
  int i;
  for (i = 0; i < 3; ++i)
    asm("foo %=" : : "r"(0));
}

we now produce:

_bar:
	xorl	%eax, %eax
	## InlineAsm Start
	foo 0
	## InlineAsm End
	## InlineAsm Start
	foo 1
	## InlineAsm End
	## InlineAsm Start
	foo 2
	## InlineAsm End
	ret

instead of:

_bar:
	xorl	%eax, %eax
	## InlineAsm Start
	foo 1
	## InlineAsm End
	## InlineAsm Start
	foo 1
	## InlineAsm End
	## InlineAsm Start
	foo 1
	## InlineAsm End
	ret

This also fixes a fixme by eliminating a static.

llvm-svn: 66528
2009-03-10 05:39:21 +00:00
Ted Kremenek b4947e4378 BugReporter:
- Group control flow and event PathDiagnosticPieces into PathDiagnosticMacroPieces.
- Afterwards, eliminate any PathDiagnosticMacroPieces from a PathDiagnostic that
  contain no informative events.

HTMLDiagnostics:
- Use new information about PathDiagnosticMacroPieces to specially format
  message bubbles for macro expansions containing interesting events.

llvm-svn: 66524
2009-03-10 05:16:17 +00:00
Ted Kremenek a039a62299 Adjust HTML diagnostics CSS to not use "smaller" for font size and instead use
specific point sizes.

llvm-svn: 66523
2009-03-10 05:14:32 +00:00
Ted Kremenek 3ceb7caf1c Add FullSourceLoc::getDecomposedLoc.
llvm-svn: 66522
2009-03-10 05:13:43 +00:00
Chris Lattner 72bbf17340 add some helper methods to AsmStmt and add some comments.
llvm-svn: 66521
2009-03-10 04:59:06 +00:00
Chris Lattner 57e673772e slightly simplify some code, pull the 'is simple asm' case up in
ConvertAsmString and shrink it a bit.  No functionality change.

llvm-svn: 66520
2009-03-10 04:38:46 +00:00
Ted Kremenek ac8ea533d6 PathDiagnosticControlFlowPiece:
- Correctly set "ControlFlow" kind (fix regression)

PathDiagnosticMacroPiece:
- add method "containsEvent" to determine if a PathDiagnosticMacroPiece
  transitively contains a PathDiagnosticEvent

llvm-svn: 66519
2009-03-10 02:50:49 +00:00
Ted Kremenek 493a4242d9 Handle "Macro" PathDiagnosticPiece kind when getting string identifier.
llvm-svn: 66518
2009-03-10 02:49:29 +00:00
Daniel Dunbar 7ea58c355b Forward -ftemplate-depth-<N> to clang's -ftemplate-depth N.
llvm-svn: 66516
2009-03-10 00:35:30 +00:00
Douglas Gregor fcd5db3bfa Limit the template instantiation depth to some user-configurable value
(default: 99). Beyond this limit, produce an error and consider the
current template instantiation a failure.

The stack we're building to track the instantiations will, eventually,
be used to produce instantiation backtraces from diagnostics within
template instantiation. However, we're not quite there yet.

This adds a new Clang driver option -ftemplate-depth=NNN, which should
eventually be generated from the GCC command-line operation
-ftemplate-depth-NNN (note the '-' rather than the '='!). I did not
make the driver changes to do this mapping.

llvm-svn: 66513
2009-03-10 00:06:19 +00:00
Daniel Dunbar 99d2835099 Backout r66408, we don't want handling of globals to rely on the
module symbol table. The root problem inspiring this was fixed in
r66316 (and again in r66506).

llvm-svn: 66512
2009-03-09 23:53:08 +00:00
Douglas Gregor d9c90a7317 Add a test case that goes with the last commit
llvm-svn: 66510
2009-03-09 23:48:53 +00:00
Douglas Gregor c40290e452 Implement template instantiation for ClassTemplateSpecializationTypes,
such as replacing 'T' in vector<T>. There are a few aspects to this:

  - Extend TemplateArgument to allow arbitrary expressions (an
    Expr*), and switch ClassTemplateSpecializationType to store
    TemplateArguments rather than it's own type-or-expression
    representation.

  - ClassTemplateSpecializationType can now store dependent types. In
    that case, the canonical type is another
    ClassTemplateSpecializationType (with default template arguments
    expanded) rather than a declaration (we don't build Decls for
    dependent types).

  - Split ActOnClassTemplateId into ActOnClassTemplateId (called from
    the parser) and CheckClassTemplateId (called from
    ActOnClassTemplateId and InstantiateType). They're smart enough to
    handle dependent types, now.

llvm-svn: 66509
2009-03-09 23:48:35 +00:00
Ted Kremenek 623d2a3ce4 Update checker build.
llvm-svn: 66507
2009-03-09 23:45:57 +00:00
Daniel Dunbar 187c973e38 Reapply r66316, it got accidentally reverted in r66317.
llvm-svn: 66506
2009-03-09 23:43:07 +00:00
Ted Kremenek 6f74418bd7 scan-build: Also look for clang in the same directory as scan-build.
llvm-svn: 66491
2009-03-09 23:14:38 +00:00
Ted Kremenek 0b891a343a retain/release checker: Allow allocations to fail by returning nil.
llvm-svn: 66487
2009-03-09 22:46:49 +00:00
Ted Kremenek 0603222888 RegionStore::getElementLValue(): Handle the case where the base is a null pointer.
llvm-svn: 66486
2009-03-09 22:44:49 +00:00
Ted Kremenek 3987bbee34 Add test case for <rdar://problem/6659160>.
llvm-svn: 66483
2009-03-09 22:28:18 +00:00
Daniel Dunbar ae3338429f NeXT: Set alignment on a number of ObjC metadata variables (matching llvm-gcc).
llvm-svn: 66481
2009-03-09 22:18:41 +00:00
Chris Lattner 5b4725861e move -g option down into rest of codegen section
llvm-svn: 66480
2009-03-09 22:05:03 +00:00
Chris Lattner 1349ab7c9f move debug info generation flag into CompileOptions.
llvm-svn: 66478
2009-03-09 22:00:34 +00:00
Chris Lattner 3cdd6493e9 update project for driver -> frontend rename.
llvm-svn: 66477
2009-03-09 21:57:09 +00:00
Chris Lattner da248f4f30 fix PR3768, Clang does -D__STDC_HOSTED__=1, even if -ffreestanding is passed.
llvm-svn: 66474
2009-03-09 21:50:12 +00:00
Daniel Dunbar c2d4b62046 NeXT: Move some routines over to CreateMetadataVar.
- No intended functionality change.

llvm-svn: 66473
2009-03-09 21:49:58 +00:00
Chris Lattner 1897de1c38 Fix PR3766, a really nasty silent miscompilation case where we emitted
a warning and then threw away the AST.  While I'm in there, tighten up the
code to actually reject completely bogus cases (sending a message to a 
struct).  We still allow sending a message to an int, which doesn't make
sense but GCC allows it and is easy to support.

llvm-svn: 66468
2009-03-09 21:19:16 +00:00
Steve Naroff 9527bbfc08 Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(
This fixes <rdar://problem/6496506> Implement class setter/getter for properties.

llvm-svn: 66465
2009-03-09 21:12:44 +00:00
Daniel Dunbar 463cc8ade5 Tweak CreateMetadataVar, take the exact alignment instead of relying
on LLVM TargetData.

llvm-svn: 66455
2009-03-09 20:50:13 +00:00
Fariborz Jahanian de2f33373b More fix for bitfield ivar meta-data and code gen accessing it.
Now, we can actually execute dejagnu test with bitfield ivars
in non-fragile abi mode.

llvm-svn: 66448
2009-03-09 20:44:22 +00:00
Chris Lattner 4f912e6f98 implement -Wsystem-headers, eliminating the wierd thing I added for testing.
llvm-svn: 66447
2009-03-09 20:44:22 +00:00
Ted Kremenek 06eb672f24 Teach GRSimpleVals::EvalNE and GRSimplVals::EvalEQ about TypedRegionViews and
SymbolicRegions. This fixes a serious regression when checking symbolic pointers
against null.

llvm-svn: 66444
2009-03-09 20:35:15 +00:00
Chris Lattner 794c001ad4 fix PR3764 - A redefinition of a pre-processor macro fails
Redefinition checking should ignore the leading whitespace and
start of line flags on the first token of an expansion.

llvm-svn: 66442
2009-03-09 20:33:32 +00:00