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

5580 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar d7e6221878 Fix const qualifiers on ProtocolQualifierListTy.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 20:22:44 +00:00
Argyrios Kyrtzidis 154d8e2280 Revert my previous change, got stupidly confused with my local changes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 18:28:48 +00:00
Argyrios Kyrtzidis be6e3101e7 Fix a call to Sema::LookupDecl that had incorrect parameters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 17:28:09 +00:00
Daniel Dunbar d17c24ff85 Add serialization support in several missing places.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57502 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 16:57:09 +00:00
Daniel Dunbar 708ef456a1 Move Type::EmitImpl into header, add FIXME to make abstract.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57501 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 16:55:17 +00:00
Daniel Dunbar b8b10e3fef Fix typo in testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 16:46:03 +00:00
Chris Lattner 94dcecba32 add a testcase.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57479 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 06:32:07 +00:00
Daniel Dunbar 7cbed03c00 Fix test suite regression, getFloatTypeSemantics shouldn't be called
on non-float types.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 05:41:12 +00:00
Daniel Dunbar 4cde927072 Add Sema implementation of #pragma pack stack.
- Follows the MSVC (original) implementation, including support of
   pack(show) (useful for testing).
 - Implements support for named pack records which gcc seems to
   ignore (or implements incorrectly).
 - Not currently wired to anything, only functionality change is the
   type checking of the pragma.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 05:35:18 +00:00
Ted Kremenek e15fa27364 Use 'realpath' to resolve the absolute path to clang and ccc-analyzer.
Add "-analyze-headers" option to scan-build that passes the option -analyzer-opt-analyze-headers to clang.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57467 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-13 21:46:42 +00:00
Daniel Dunbar 6b1da0ea19 Lift out ABIInfo abstract base class.
- Currently still lives in CGCall.cpp but is intended to be the
   target specific place for hooking ABI information.
 - Select ABIInfo to use based on Target's prefix and pointer width.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57445 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-13 17:02:26 +00:00
Argyrios Kyrtzidis e2ed203b43 More const-ness goodness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57420 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 18:45:56 +00:00
Argyrios Kyrtzidis d2595ecce5 Improve the const-ness of a few methods.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57417 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 18:40:01 +00:00
Argyrios Kyrtzidis 42220c5432 Implement more efficient Decl <-> DeclContext conversions.
When the static type on the Decl side is a subclass of DeclContext the compiler will use a "inlinable" static_cast, instead of always using an out-of-line function call.

Note, though, that the isa<> check still uses an out-of-line function call.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 16:14:48 +00:00
Chris Lattner 99bd46c018 make the -rewrite-test a bit more interesting: it now
wraps comments in <i> tags.  Extend rewrite tokens to support
this minimal functionality.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 06:09:52 +00:00
Chris Lattner cff9cc95de start implementing a token rewriter. At this point, it just reads in a file
and lets a client iterate over it. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57407 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 05:44:03 +00:00
Chris Lattner b13c5eef36 Add a new -rewrite-test option, which is basically a
playground to experiment with some new rewriter approaches. For now
it is probably the most complex version of 'cat' ever invented.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 05:29:20 +00:00
Chris Lattner c106c106c6 Add a new -dump-raw-tokens option, which allows us to see raw tokens.
Rename -dumptokens to -dump-tokens.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57405 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 05:03:36 +00:00
Chris Lattner 9e6293d4df Change FormTokenWithChars to take the token kind to form, since all clients
were setting a kind and then forming it.  This is just a minor API cleanup, 
no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57404 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 04:51:35 +00:00
Chris Lattner 31f0ecae4b When in keep whitespace mode, make sure to return block comments that are
unterminated.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57403 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 04:19:49 +00:00
Chris Lattner 2d3818959d Change SkipBlockComment and SkipBCPLComment to return true when in
keep comment mode, instead of returning false.  This matches SkipWhitespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57402 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 04:15:42 +00:00
Chris Lattner d88dc48e33 Add a new mode to the lexer which enables it to return all characters,
even whitespace, as tokens from the file.  This is enabled with
L->SetKeepWhitespaceMode(true) on a raw lexer.  In this mode, you too
can use clang as a really complex version of 'cat' with code like this:

  Lexer RawLex(SourceLocation::getFileLoc(SM.getMainFileID(), 0),
               PP.getLangOptions(), File.first, File.second);
  
  RawLex.SetKeepWhitespaceMode(true);
  
  Token RawTok;
  RawLex.LexFromRawLexer(RawTok);
  while (RawTok.isNot(tok::eof)) {
    std::cout << PP.getSpelling(RawTok);
    RawLex.LexFromRawLexer(RawTok);
  }

This will emit exactly the input file, with no canonicalization or other
translation.  Realistic clients actually do something with the tokens of
course :)



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57401 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 04:05:48 +00:00
Chris Lattner aea3ad0737 Stop the preprocessor from poking the lexer's private parts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57399 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 03:31:33 +00:00
Chris Lattner f744d133e8 Fix a couple more places that poke KeepCommentMode unnecesarily.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57398 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 03:27:19 +00:00
Chris Lattner fa95a019da add a new inKeepCommentMode() accessor to abstract the KeepCommentMode
ivar.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57397 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 03:22:02 +00:00
Chris Lattner a2c7ad9c73 fix misleading comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 01:34:51 +00:00
Chris Lattner 0af574270d Simplify raw mode lexing by treating an unterminate /**/ comment the
same we we do an unterminated string or character literal.  This makes
it so we can guarantee that the lexer never calls into the 
preprocessor (which would be suicide for a raw lexer).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57395 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 01:31:51 +00:00
Chris Lattner 8527b71b19 add a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 01:23:27 +00:00
Chris Lattner 590f0cc643 Change how raw lexers are handled: instead of creating them and then
using LexRawToken, create one and use LexFromRawLexer.  This avoids
twiddling the RawLexer flag around and simplifies some code (even 
speeding raw lexing up a tiny bit).

This change also improves the token paster to use a Lexer on the stack
instead of new/deleting it. 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57393 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 01:15:46 +00:00
Chris Lattner 3304e55f61 silence release-assert warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57392 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 00:31:50 +00:00
Chris Lattner 33d34a6f7a silence some release-assert warnings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57391 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 00:28:42 +00:00
Chris Lattner f6e764fe72 silence a bunch of warnings in a release-assert build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 00:26:57 +00:00
Chris Lattner 7a4f004a77 improve a comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-12 00:23:07 +00:00
Steve Naroff a7996d43c7 Add DeclGroup.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57354 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 16:41:38 +00:00
Steve Naroff e0109a5427 Fix/simplify RewriteBlocks::RewriteBlockPointerFunctionArgs().
This completes the fix for <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57350 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 15:33:34 +00:00
Seo Sanghyeon 8f0fd62d82 Tests for return statement checks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57341 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 07:20:06 +00:00
Steve Naroff 090276f5e1 Final phase of converting BlockDecls over to DeclContext. This is unfortunately a largish/complex diff, however it was necessry to pass all the current block tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57337 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 01:28:17 +00:00
Daniel Dunbar f02e9ddf5e Lift EmitTargetBuiltinExpr out of EmitBuiltinExpr.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 00:24:54 +00:00
Daniel Dunbar 0b0ee502fc Disable blocks support in C++ mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 00:20:52 +00:00
Ted Kremenek 445fa776d2 Add missing newline.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57333 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-10 00:17:08 +00:00
Dale Johannesen ee5a700af3 Adjust calls to APFloat conversion for new interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57332 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 23:02:32 +00:00
Zhongxing Xu a90d56ea04 Check some cases for previous patch. Make the code more robust.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 03:19:06 +00:00
Argyrios Kyrtzidis de933f025e Fix a bug that crashed clang when parsing this:
class C {
  static const int number = 50;
  static int arr[number];
};

Here's how it worked:
-GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator and Sema::ActOnDeclarator.
-VariableArrayTypes are not uniqued so two VariableArrayTypes were created with the same DeclRefExpr.
-On exit they both tried to destroy that one DeclRefExpr.

The fix is not to use GetTypeForDeclarator from the Sema::ActOnCXXMemberDeclarator.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57313 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 22:20:31 +00:00
Steve Naroff 1c90bfcbd7 Instantiate the BlockDecl in ActOnBlockStart() so we can use it as a DeclContext.
This required changes to attach the compound statement later on (like we do for functions).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 18:44:00 +00:00
Ted Kremenek e0a798ef0f Update checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 18:32:06 +00:00
Steve Naroff 84a969fed7 Touchup the rewriter to handle the new BlockExpr->BlockDecl dance.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 17:31:13 +00:00
Steve Naroff 56ee6896f2 - Add BlockDecl AST node.
- Modify BlockExpr to reference the BlockDecl.

This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?).

Still some follow-up work to finish this (forthcoming).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 17:01:13 +00:00
Zhongxing Xu 178927517f This is the first step to implement a field-sensitive store model. Other things are simplified: no heap shape assumption, no parameter alias assumption, etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57285 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 02:50:44 +00:00
Ted Kremenek 8a213de1a8 A little more tweaking with StmtIterator and SizeOfAlignofExpr. A recent commit actually introduced a regression, not fixed a bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-07 23:35:42 +00:00
Ted Kremenek 8ffb159441 Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ScopedDecl*.
This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57275 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-07 23:09:49 +00:00