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

4696 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar de7fb8413b More #include cleaning
- Remove internal uses of AST.h


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 05:00:27 +00:00
Daniel Dunbar e91593ef08 More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 04:54:23 +00:00
Daniel Dunbar e4858a65a9 More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
   implementation .cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 03:45:03 +00:00
Daniel Dunbar 12bc692a78 Minor #include cleaning
- Drop TokenKinds.h from Action.h
 - Move DeclSpec.h from Sema.h into individual Sema .cpp files


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 03:27:53 +00:00
Daniel Dunbar c17a4d3b16 Add dummy Mac Objective-C runtime interface.
- Not currently accessible and completely non-functional.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54624 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 02:45:11 +00:00
Nuno Lopes c46cf49229 fix linking with .so files specified in cmd line (this fixes some libtool usages)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 22:17:57 +00:00
Nuno Lopes 9a1844866b pass -R arg to linker
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 21:58:01 +00:00
Daniel Dunbar 1e04976fc2 Back out r54608 (inline string literals were getting an extra '\0')
temporarily, I assumed GetAddrForConstantString literal was being
  used consistently but it doesn't look like it is.

Factored out a CodeGenModule::getStringForStringLiteral which handles
  extracting a std::string for the bytes of a StringLiteral, padded to
  match the type.

Update EmitLValue to use getStringForStringLiteral, this was
  previously not padding strings correctly. Good thing we only emit
  strings in 4 different places!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54621 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 20:25:57 +00:00
Nico Weber 7bfaaaecb3 * Remove isInSystemHeader() from DiagClient, move it to SourceManager
* Move FormatError() from TextDiagnostic up to DiagClient, remove now  
  empty class TextDiagnostic
* Make DiagClient optional for Diagnostic

This fixes the following problems:

* -html-diags (and probably others) does now output the same set of  
  warnings as console clang does
* nothing crashes if one forgets to call setHeaderSearch() on  
  TextDiagnostic
* some code duplication is removed




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 19:59:06 +00:00
Steve Naroff 3ac5e9fc38 Forgot to modify LAST_EXPR (thanks Nuno).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54619 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 19:28:37 +00:00
Nico Weber be1eb5c919 Do not crash with -serialize.
This happened because seralization was done in the constructor, and at that time the TranslationUnit is no longer valid.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54618 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 19:20:05 +00:00
Steve Naroff 76de9d7a32 Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54617 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 19:10:41 +00:00
Daniel Dunbar 425fa391dd Add svn:ignore properties for Release-Asserts dirs
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54616 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 18:21:41 +00:00
Anders Carlsson 165a70fd0b Remove the old evaluator code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54615 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 17:03:01 +00:00
Steve Naroff 613535273b InitListChecker::CheckListElementTypes(): Check for function types and issue an appropriate diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 16:05:48 +00:00
Steve Naroff d4d46cd616 Cleanup from yesterday...make isTentativeDefinition() a static helper function (no need for it to be part of the Sema API).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54613 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 15:28:06 +00:00
Steve Naroff f855e6fbeb Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54612 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 15:20:13 +00:00
Argyrios Kyrtzidis 03db1b31dd Allow the preprocessor to cache the lexed tokens, so that we can do efficient lookahead and backtracking.
1) New public methods added:
  -EnableBacktrackAtThisPos
  -DisableBacktrack
  -Backtrack
  -isBacktrackEnabled

2) LookAhead() implementation is replaced with a more efficient one.
3) LookNext() is removed.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 13:15:22 +00:00
Daniel Dunbar 9ca8bb0996 Fix crash during initialization of a bitfield which followed a zero
length element.

Fix some 80-col violations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54610 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 07:00:24 +00:00
Daniel Dunbar a5d1cb7ef3 Update ShuffeVectorExpr::getShuffleMaskIdx to use
getIntegerConstantExprValue.

Tweak getIntegerConstantExprValue to suppress warning in
  Release-Asserts mode.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54609 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 06:58:01 +00:00
Daniel Dunbar ec5c2a7646 Bug fix, inline string literals were getting an extra '\0'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54608 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 06:27:44 +00:00
Chris Lattner d1a0b6d3df tighten up some code and some wording on diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 02:05:13 +00:00
Chris Lattner d8803632d2 wrap some long diagnostics, make 'initializer is not a constant' diagnostic
a bit more clear (rdar://5646070)


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54606 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 01:58:45 +00:00
Chris Lattner d9f6910f4e rename PreDefinedExpr -> PredefinedExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 01:53:14 +00:00
Argyrios Kyrtzidis 55d71f9f4c Add some C++ Decl statistics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 01:47:31 +00:00
Eli Friedman 1bb516c861 Make sure to count the struct elements correctly; here, we want the
member count.  The count returned by numStructUnionElements is the 
number of initializers that will be consumed, not the number of members 
to iterate through.  Fixes PR2534.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54601 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 23:45:45 +00:00
Eli Friedman c34bcde8d2 Fix for PR2631; make va_arg work correctly on x86-64.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54600 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 23:32:40 +00:00
Nico Weber d7549e7c05 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54599 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 23:08:17 +00:00
Eli Friedman 355aba8d7c Remove the ICE pointer cast hack; the issue this was working around is
now fixed in an alternate way.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54598 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 22:24:21 +00:00
Eli Friedman 2eb0ddc1ba Turn on the new constant expression evaluator; it isn't
anywhere near complete, but I don't know of any issues, and it can 
handle enough to allow removing the I-C-E pointer cast hack.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54597 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 22:21:56 +00:00
Nico Weber b243fe5a81 add assert, use make_pair() instead of pair constructor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54596 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 22:13:42 +00:00
Argyrios Kyrtzidis cd33b85285 Mention 'wchar_t' at the C++ status page.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54595 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 22:12:36 +00:00
Nico Weber dee8ecc938 fix spello
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54594 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 22:12:22 +00:00
Argyrios Kyrtzidis afef76e43a Handle BuiltinType::WChar inside CodeGenTypes::ConvertNewType().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54593 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 22:01:55 +00:00
Chris Lattner 8389eab190 Fix PR2400 by more graceful handling of invalid decls. Don't try to layout
an invalid struct decl.  Thanks to Martin Doucha for the 
isIncompleteArrayType part of this patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54592 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 21:35:13 +00:00
Gordon Henriksen aad6953ca1 Expressive diagnostics-- worth their weight in gold?
(Fixing a spelling error.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54591 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 19:58:22 +00:00
Nico Weber dae86966bb do not serialize invalid asts. this fixes bug #2637
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 18:32:11 +00:00
Argyrios Kyrtzidis 55f4b02bc7 Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54588 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 17:20:01 +00:00
Argyrios Kyrtzidis 46713efe13 Handle WChar inside BuiltinType::getName().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 17:11:33 +00:00
Argyrios Kyrtzidis 64c438a4be Implement support for the 'wchar_t' C++ type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 16:51:54 +00:00
Steve Naroff 907747b3a6 Fix Sema::MergeVarDecl() to better handle type compatibility. The previous code was trying to handle arrays specially (which didn't work for pointers to array). Removed local helper function areEquivalentArrayTypes(), replacing it's use with the more general ASTContext::typesAreCompatible() predicate.
Even though the test case this fixes is in "tentative-decls.c", this bug didn't have anything to do with our handling of tentative definitions (which is what I first expected). In any event, this is a tricky area of the spec.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 16:04:40 +00:00
Argyrios Kyrtzidis a4755c6ffa When in C++, invoke ASTConsumer::HandleTagDeclDefinition in Sema::ActOnFinishCXXClassDef,
at which point the C++ struct/class/union is fully parsed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54569 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:58:37 +00:00
Ted Kremenek 23f7823b3c Added FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:41:45 +00:00
Argyrios Kyrtzidis 5b7f0c8f47 Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:39:29 +00:00
Ted Kremenek ca10562c31 Updated checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54566 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:22:35 +00:00
Ted Kremenek e12691c2a2 Don't use Expr::isIntegerConstantExpr just to check if a pointer value is initialize to NULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:05:14 +00:00
Ted Kremenek 9a993d9c30 Updated checker build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54562 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 22:25:17 +00:00
Argyrios Kyrtzidis 243e4b2fd5 Make RecordDecl::Destroy() public.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 22:25:06 +00:00
Ted Kremenek 991c54b9b7 Have scan-build/ccc-analyzer generate preprocessed .i/.mi files for sources that clang crashes on.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54552 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 20:46:42 +00:00
Chris Lattner 85e356825b update to make IRBuilder API change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54548 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 19:57:58 +00:00