Commit Graph

10526 Commits

Author SHA1 Message Date
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
Chris Lattner 5c1f4d3c02 convert this to use -verify.
llvm-svn: 66441
2009-03-09 20:31:39 +00:00
Chris Lattner b960cdd255 rename test
llvm-svn: 66440
2009-03-09 20:30:53 +00:00
Ted Kremenek 78b79386d2 Add member template "MemRegion::getAs<RegionType>" that dynamically casts a
given MemRegion object to a target region type. This differs from dyn_cast<> in
that it also ignores TypedViewRegions.

llvm-svn: 66439
2009-03-09 20:28:08 +00:00
Ted Kremenek 701e487520 Remove some dead spacing. No functionality change.
llvm-svn: 66437
2009-03-09 20:26:47 +00:00
Daniel Dunbar 91b000f771 Fix typo in pref commit.
llvm-svn: 66433
2009-03-09 20:16:39 +00:00
Daniel Dunbar 30c653655d NeXT: Add CreateMetadataVar utility method to encapsulate creation of
Obj-C metadata variables (which generally should be handled the same,
although they aren't currently).
 - No functionality change.

llvm-svn: 66432
2009-03-09 20:09:19 +00:00
Douglas Gregor a6778494fb Revert r66423, which was not the right fix for this issue.
llvm-svn: 66431
2009-03-09 20:07:22 +00:00
Daniel Dunbar 1e6efc0cf4 ccc: Parse -T{bss,data,text}, -iwithsysroot, -specs correctly.
Also, fix some test cases.

llvm-svn: 66425
2009-03-09 17:43:51 +00:00
Douglas Gregor 71cb0c723f Fix a little FIXME, thanks to Sebastian
llvm-svn: 66423
2009-03-09 16:48:55 +00:00
Douglas Gregor ce0fc86f07 Mark a non-type template parameter invalid if there was a problem with its type
llvm-svn: 66422
2009-03-09 16:46:39 +00:00
Douglas Gregor ed0cfbdad1 Rename DiagnoseIncompleteType to RequireCompleteType, and update the documentation to reflect the fact that we can instantiate templates here
llvm-svn: 66421
2009-03-09 16:13:40 +00:00
Zhongxing Xu 7219d1bada Only track integer and pointer values.
llvm-svn: 66419
2009-03-09 09:31:22 +00:00
Zhongxing Xu ce270a6dbc Now we do not retrieve untyped regions.
llvm-svn: 66418
2009-03-09 09:15:51 +00:00
Chris Lattner ed9f14c4c9 do not warn about -=/=- confusion with macros, thanks to rdogra for a testcase.
llvm-svn: 66416
2009-03-09 07:11:10 +00:00
Chris Lattner 14aea9a39c link to blocks dox
llvm-svn: 66414
2009-03-09 07:03:22 +00:00
Chris Lattner d6daa1dafd add some description of the block language extension.
llvm-svn: 66413
2009-03-09 07:01:20 +00:00
Chris Lattner da84e0d516 The long-rumored blocks implementation document.
llvm-svn: 66410
2009-03-09 06:57:46 +00:00