Граф коммитов

4378 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner bb57265fdb reduce nesting, use memchr instead of explicit loop, eliminate a
temporary std::string to fix a fixme.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66530 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 06:11:34 +00:00
Chris Lattner 63c8b14ddc 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66528 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 05:39:21 +00:00
Ted Kremenek 0e5c8d4ca6 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 05:16:17 +00:00
Ted Kremenek 2223622d11 Adjust HTML diagnostics CSS to not use "smaller" for font size and instead use
specific point sizes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 05:14:32 +00:00
Ted Kremenek 321abd4583 Add FullSourceLoc::getDecomposedLoc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66522 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 05:13:43 +00:00
Chris Lattner b327793860 add some helper methods to AsmStmt and add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 04:59:06 +00:00
Chris Lattner f1a08caedb slightly simplify some code, pull the 'is simple asm' case up in
ConvertAsmString and shrink it a bit.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 04:38:46 +00:00
Ted Kremenek 0008683bee Handle "Macro" PathDiagnosticPiece kind when getting string identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66518 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 02:49:29 +00:00
Douglas Gregor 26dce44534 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 00:06:19 +00:00
Daniel Dunbar 42745815fa 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).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 23:53:08 +00:00
Douglas Gregor 40808ce6ac 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 23:48:35 +00:00
Ted Kremenek 25d01badc5 retain/release checker: Allow allocations to fail by returning nil.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 22:46:49 +00:00
Ted Kremenek de7ec634a4 RegionStore::getElementLValue(): Handle the case where the base is a null pointer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66486 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 22:44:49 +00:00
Daniel Dunbar 58a2912800 NeXT: Set alignment on a number of ObjC metadata variables (matching llvm-gcc).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 22:18:41 +00:00
Chris Lattner 8d4a9d37fd fix PR3768, Clang does -D__STDC_HOSTED__=1, even if -ffreestanding is passed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 21:50:12 +00:00
Daniel Dunbar 63c5b50d80 NeXT: Move some routines over to CreateMetadataVar.
- No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 21:49:58 +00:00
Chris Lattner 0c73f37f0a 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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 21:19:16 +00:00
Steve Naroff 61f72cbd03 Implement property '.' notation on Factory/Class objects. Parser changes aren't very pretty:-(
This fixes <rdar://problem/6496506> Implement class setter/getter for properties.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66465 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 21:12:44 +00:00
Daniel Dunbar 35bd763b94 Tweak CreateMetadataVar, take the exact alignment instead of relying
on LLVM TargetData.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66455 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:50:13 +00:00
Fariborz Jahanian a6681ae9bb 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:44:22 +00:00
Ted Kremenek 214c6cb45d Teach GRSimpleVals::EvalNE and GRSimplVals::EvalEQ about TypedRegionViews and
SymbolicRegions. This fixes a serious regression when checking symbolic pointers
against null.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66444 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:35:15 +00:00
Chris Lattner 688a248e03 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:33:32 +00:00
Ted Kremenek fda79d1ce6 Remove some dead spacing. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:26:47 +00:00
Daniel Dunbar d6e941d37d Fix typo in pref commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:16:39 +00:00
Daniel Dunbar fd65d370b1 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:09:19 +00:00
Douglas Gregor 8d21721fe9 Revert r66423, which was not the right fix for this issue.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66431 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 20:07:22 +00:00
Douglas Gregor b964c1d84b Fix a little FIXME, thanks to Sebastian
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 16:48:55 +00:00
Douglas Gregor ceef30c9ba Mark a non-type template parameter invalid if there was a problem with its type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 16:46:39 +00:00
Douglas Gregor 86447ec25f Rename DiagnoseIncompleteType to RequireCompleteType, and update the documentation to reflect the fact that we can instantiate templates here
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66421 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 16:13:40 +00:00
Zhongxing Xu ff8d204dcf Only track integer and pointer values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 09:31:22 +00:00
Zhongxing Xu 1038f9f699 Now we do not retrieve untyped regions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66418 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 09:15:51 +00:00
Chris Lattner 3e87209798 do not warn about -=/=- confusion with macros, thanks to rdogra for a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 07:11:10 +00:00
Zhongxing Xu bd4f745c81 Fix a serious bug in RegionStore: we got the new state with new store from
Bind() and BindStruct(), but we returned a state with the old store.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 06:49:50 +00:00
Mike Stump 53d8922556 Be sure to never create two functions with the same name, instead arrange to
reuse the prior one.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09 06:40:26 +00:00
Fariborz Jahanian b21f07e056 Code refactoring. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66391 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 20:18:37 +00:00
Chris Lattner 55660a7489 implement PR3753, warning about comparisons with a string literal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66387 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 19:39:53 +00:00
Steve Naroff 64949d3a2e Remove dead clause (we decided not to support protocol qualified 'Class').
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 19:04:05 +00:00
Steve Naroff 5609ec04ed Improvements to private method lookup.
Patch by Jean-Daniel Dupas. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66383 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 18:56:13 +00:00
Chris Lattner 2bc69bdb29 add \n characters to the scratch buffer *before* returned tokens.
This prevents caret diagnostics from the scratch buffer from 
including other tokens in the scratch buffer that occurred beforei
them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66375 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 08:16:41 +00:00
Chris Lattner cd1148b614 generalize the "end of line" checking logic to stop at any \0 at the
end of line instead of just the end of buffer.  Scratch buffers contain
embedded \0's between tokens which are logic line separators.  If a 
normal text buffer contains \0's, it doesn't make a lot of sense to include
them in the caret diag output anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 08:11:22 +00:00
Chris Lattner 1fa495304c simplify some logic by making ScratchBuffer handle the application of trailing
\0's to created tokens instead of making all clients do it.  No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 08:08:45 +00:00
Chris Lattner 399bd1bc2b refine the "use of unary operator that may be intended as compound assignment (+=)"
warning to only trigger when there is whitespace or something else after the + as
suggested by Eli.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-08 06:51:10 +00:00
Anders Carlsson b1d947b101 Make mangling work with anonymous tag types. Doug, please review
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 23:57:03 +00:00
Anders Carlsson a40c5e4f69 Mangle Objective-C interfaces correctly (where correctly refers to what gcc does)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 22:03:21 +00:00
Eli Friedman a210f350fa Make constant emission for @encode use the common string emission code.
This is a bit cleaner, and also "fixes" bad code that compares the 
addresses of the string constants.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66346 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 20:17:55 +00:00
Fariborz Jahanian 11894a4ad6 correct bitfield ivar offset in ivar meta-data.
(objc abi specific).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 19:43:20 +00:00
Mike Stump 2ace928d27 Fix warnings in build on clang-x86_64-freebsd buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 18:35:41 +00:00
Sanjiv Gupta 863cffbaf6 Mangle param names with .arg. only.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66343 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 18:09:52 +00:00
Mike Stump 286acbdbe0 Fixup our uses of various linkages to match how llvm now works. I think they are all
correct, but an extra set of ObjC eyes would be good.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 16:33:28 +00:00
Mike Stump a91b590575 If someone could figure out this is necessary, that would be good.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66341 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07 16:32:25 +00:00