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

2543 Коммитов

Автор SHA1 Сообщение Дата
Sebastian Redl bcf293bb63 Add better comments to ::new parsing. Thanks to Doug for the review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 17:10:24 +00:00
Sebastian Redl 500386194c Make RegionStoreManager::InitializeArray safe against array sizes that don't have pointer width.
This may be the case on 64-bit systems. Whether that fact is a bug is a different question, but it's easy to cure the symptom.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60422 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:47:35 +00:00
Sebastian Redl fb4ccd7152 Make the parser handle ::new and ::delete correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60421 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:35:44 +00:00
Eli Friedman 09af4d9728 Update cmake build; patch by Csaba Hruska.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60418 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:23:30 +00:00
Eli Friedman 8de8d1d3f2 Fix for PR3150: obvious copy-paste bug in
ScalarExprEmitter::VisitBinLOr.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60415 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 16:02:46 +00:00
Sebastian Redl cee63fbf0e Handle new by passing the Declaration to the Action, not a processed type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 14:43:59 +00:00
Ted Kremenek 04f9d468f7 Add FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 01:26:07 +00:00
Eli Friedman a385b3c9c4 Disabling this code due to regression on test/CodeGen/bitfield.c. See
PR3152.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60389 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 01:17:45 +00:00
Douglas Gregor 26236e8b75 A little more scaffolding for parsing templates:
- Template parameter scope to hold the template parameters
  - Template parameter context for parsing declarators
  - Actions for template type parameters and non-type template
    parameters



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 00:41:28 +00:00
Fariborz Jahanian b85cce6498 This patch corrects problem in searching for a setter/getter method for
a property. Previous scheme of seaching in interface's list of methods
would not work because this list is not yet constructed. This is in preparation
for doing semantic check on viability of setter/getter method declarations.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60386 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02 00:19:12 +00:00
Douglas Gregor adcac8824a Basic support for parsing templates, from Andrew Sutton
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 23:54:00 +00:00
Douglas Gregor cb43d99952 Improve error recovery when parsing a function definition fails
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 23:03:32 +00:00
Douglas Gregor e89b02823a Initialize storage class even if we got an erroneous mutable
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60377 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 22:46:22 +00:00
Douglas Gregor bec1c9d6f3 Objective-C keywords are not always identifiers. Some are also C++ keywords
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 21:46:47 +00:00
Steve Naroff d40910b581 -Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
-Start adding support for rewriting @synthesize.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60368 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 20:33:01 +00:00
Douglas Gregor 19ac6ff24e Use EmitInt, not Emit, to emit unsigned values
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60364 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 19:45:16 +00:00
Daniel Dunbar c1571453de Add LangOptions marker for assembler-with-cpp mode and use to define
__ASSEMBLER__ properly. Patch from Roman Divacky (with minor
formatting changes). Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:55:22 +00:00
Douglas Gregor a4745616eb Parse the exception-specification throw(...), a Microsoft extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60359 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 18:00:20 +00:00
Douglas Gregor 28d6cba4c4 Define NULL to __null in C++, so that it's guaranteed to have the same size as a pointer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60355 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 17:20:57 +00:00
Anders Carlsson 4fdfb0965b Generate the correct results for the comma expression. Fixes PR3123.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60334 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 06:44:05 +00:00
Anders Carlsson d26527708b Revert change that made isNullPointerConstant start emitting warnings. We don't want that :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60333 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 06:28:23 +00:00
Anders Carlsson 64712f196b Change more code over to using the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60324 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:46:24 +00:00
Anders Carlsson 4b3f9c06d5 Change more code over to using the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60323 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:42:14 +00:00
Anders Carlsson f35d35a231 Use the new Expr::Evaluate
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60321 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:31:41 +00:00
Anders Carlsson 07b5cc0f40 Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:25:52 +00:00
Anders Carlsson 4000ea685a Add Sema::isNullPointerConstant which extwarns if necessary. Use it in Sema::CheckConditionalOperands.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60319 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:17:22 +00:00
Anders Carlsson efa9b3877e Add a new variant of isNullConstantExpr that returns an EvalResult.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:13:57 +00:00
Anders Carlsson d3a61d5ec5 Use VerifyIntegerConstantExpression for case values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:13:02 +00:00
Anders Carlsson 027f62ec18 Emit the correct diagnostic when a comma is in an ICE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01 02:07:06 +00:00
Anders Carlsson e21555e666 Add Sema::VerifyIntegerConstantExpression
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60305 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 19:50:32 +00:00
Anders Carlsson 0e8acbbba7 Change the diagnostics that the evaluator reports to be of type NOTE.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 18:37:00 +00:00
Anders Carlsson f0c1e4b679 Replace the isEvaluated bool with a ShortCircuit int, making it easier to handle recursion
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60300 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 18:26:25 +00:00
Anders Carlsson 82206e267c Pass the expression to the Error and Extension methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 18:14:57 +00:00
Anders Carlsson 5b45d4ef1e Add a new variant of Evaluate and reimplement the old Evaluate in terms of the new.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60298 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 16:58:53 +00:00
Anders Carlsson fcb4d09531 General cleanup, evaluate the RHS of a logical op even if the LHS will give us the result.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60297 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 16:51:17 +00:00
Anders Carlsson 54da049661 EvalInfo now holds a reference to an EvalResult struct.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60296 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 16:38:33 +00:00
Zhongxing Xu 6987c7b741 Add support for initializing array with string literal.
This fixes PR3127
http://llvm.org/bugs/show_bug.cgi?id=3127


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60280 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 05:49:49 +00:00
Eli Friedman 994ffef435 Fix for PR2969: generate a memcpy from a constant for constant
initializers.  llvm-gcc appears to be more aggressive, but incorrect, 
for constructs like "const int a[] = {1,2,3};"; that said, current 
optimizers will do the appropriate optimizations when safe.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60270 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 02:11:09 +00:00
Eli Friedman 4310ff6d8b Minor update to CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60269 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-30 01:46:21 +00:00
Zhongxing Xu 0395b5d498 To be consistent, make the index of the ElementRegion always signed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 12:05:04 +00:00
Douglas Gregor 2d8b273470 Implement the GNU __null extension
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60235 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-29 04:51:27 +00:00
Chris Lattner 5cf243a883 Switch QualType to use llvm::PointerIntPair internally to do the pointer
bitmangling.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 23:37:31 +00:00
Zhongxing Xu 96cb9fb620 Fix a serious bug.
When initialized, the index of the ElementRegion was unsigned. But the index
value of the ArraySubscriptExpr is signed. This inconsistency caused the value
of the array element retrieved to be UnknownVal despite it was initialized to
symbolic.

This is only a hack. Real fix of this problem is required.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60207 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 08:41:39 +00:00
Zhongxing Xu d5b499d43c Code cleanup. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60206 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 08:34:30 +00:00
Zhongxing Xu 353cbe134c Use std::make_pair instead of std::pair's ctor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60205 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 03:55:52 +00:00
Sebastian Redl e206532197 Fix order of evaluation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60160 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:28:14 +00:00
Zhongxing Xu f0bc50eaa3 Factory objects should not be temporary. It caches all objects in the set.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60151 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 06:08:40 +00:00
Zhongxing Xu d548479442 RegionViewMap factory is actually not used. All GDMs should use factories from
GDMContext.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60150 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 06:03:03 +00:00
Daniel Dunbar 4fe66aa202 Test commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60147 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 03:47:29 +00:00
Zhongxing Xu 8fd9b3508a Add comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 02:39:34 +00:00
Zhongxing Xu 5abf03bbb9 Add license comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60144 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 02:19:10 +00:00
Zhongxing Xu 22438a8dfe Add support for pluggable components of static analyzer.
- Creator function pointers are saved in ManagerRegistry.
 - The Register* class is used to notify ManagerRegistry new module is 
   available.
 - AnalysisManager queries ManagerRegistry for configurable module. Then it
   passes them to GRExprEngine, in turn to GRStateManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 01:55:08 +00:00
Douglas Gregor 7ca09760ee Add implicit conversions for Objective-C qualified ids, e.g.,
id<P0>

The intended overloading behavior of these entities isn't entirely
clear, and GCC seems to have some strange limitations (e.g., the
inability to overload on id<P0> vs. id<P1>). We'll want to revisit
these semantics and determine just how Objective-C++ overloading
should really work.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60142 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 01:19:21 +00:00
Douglas Gregor bf40818928 Cleanup formatting
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:52:49 +00:00
Douglas Gregor 63a9490b27 Don't complain about block pointer to void* conversions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60138 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:44:28 +00:00
Ted Kremenek 82a500b141 PTHLexer now owns the Token vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:38:24 +00:00
Douglas Gregor 071f2aec57 Support block pointer conversions in C++. I'm storing the test case locally until we can enable blocks in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60133 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 00:15:41 +00:00
Douglas Gregor cb7de523cc Implement implicit conversions for Objective-C specific types, e.g.,
converting a pointer to one Objective-C interface into a pointer to another
Objective-C interface, and conversions with 'id'. The semantics seems
to match GCC, although they seem somewhat ad hoc.

Fixed a few cases where we assumed the C++ definition of isObjectType,
but were getting the C definition, causing failures in trouble with
conversions to void pointers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 23:31:11 +00:00
Argyrios Kyrtzidis 314fe782fd Attempt to unravel the if/else mess in Parser::ParseDirectDeclarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60124 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:40:03 +00:00
Fariborz Jahanian 6010bca98a Code gen for aggregate-valued properties and a test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60122 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 22:36:09 +00:00
Argyrios Kyrtzidis 44802cc435 Add some comments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 21:51:07 +00:00
Argyrios Kyrtzidis 4bdd91c09f Implement some suggestions by Daniel:
-Change Parser::ParseCXXScopeSpecifier to MaybeParseCXXScopeSpecifier
-Remove Parser::isTokenCXXScopeSpecifier and fold it into MaybeParseCXXScopeSpecifier
-Rename Parser::TryAnnotateScopeToken to TryAnnotateCXXScopeToken and only allow it to be called when in C++

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60117 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 21:41:52 +00:00
Fariborz Jahanian b16308f1b3 Removed a FIXME. Added a test case for anonymous category.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60115 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 20:33:54 +00:00
Fariborz Jahanian 8cf0bb3c2a Set default property attributes on each property.
Implemented anonymous category (also know as continuation class)
used to override main class's property attribute. This is work in 
propgress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60114 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 20:01:34 +00:00
Anders Carlsson 4d6e8dd587 Convert incomplete array types before emitting debug info for them, fixes PR3134.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60109 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 17:40:42 +00:00
Douglas Gregor 7ffd0defb9 Fix a minor typo in the handling of the conditional operator for Objective-C interface pointers
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60096 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 06:43:45 +00:00
Douglas Gregor 0a39668d6a Tweak the new ResolveOverloadedCallFn to just return a FunctionDecl. It makes ActOnCallExpr simpler
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 06:01:48 +00:00
Douglas Gregor f6b89691d2 Move the overloading logic of Sema::ActOnCallExpr to a separate function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 05:54:23 +00:00
Nuno Lopes cfe257198c remove debug-only assertion in the complex float evaluator as it makes some real apps crash
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60069 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26 00:39:53 +00:00
Daniel Dunbar ab4c91c708 Only call TryAnnotateScopeToken when parsing C++.
- This improves -parse-noop of Carbon.h by +2%, and I believe
   compensates for the majority of the performance regression in r58913.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60063 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 23:05:24 +00:00
Anders Carlsson ad3d6917da Handle returning complex types that get coerced. Fixes PR3131
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60058 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 22:21:48 +00:00
Sebastian Redl a55e52c080 Use RAII objects to ensure proper destruction of expression and statement AST nodes in the parser in most cases, even on error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60057 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 22:21:31 +00:00
Daniel Dunbar 71fcec9abf Fix 80-col violations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60051 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:53:21 +00:00
Fariborz Jahanian 31afbf02a3 Refactored checking on readonly property into a method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 21:48:26 +00:00
Fariborz Jahanian 6669db9d80 Patch to allow over-riding of readonly property to
a writable property in one of its category.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60035 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:56:43 +00:00
Anders Carlsson c9ad94e12a Remove more #ifdeffed code
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:16:39 +00:00
Anders Carlsson 704e4907ee Remove the #ifdeffed out code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 17:10:10 +00:00
Nuno Lopes 43d0ffdace remove unused var
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60018 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 12:23:46 +00:00
Douglas Gregor 0fe7bea6fc Simple parsing of exception specifications, with no semantic analysis yet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60005 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 03:22:00 +00:00
Daniel Dunbar ddd3e8b90a Comment fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-25 00:20:22 +00:00
Fariborz Jahanian e793a6ec16 Patch to remove bogus waring when a property declaration
is imported from a protocol into the implementation.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59988 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 22:16:00 +00:00
Sebastian Redl 618e5c0470 Remove an empty if and add a reminder for when we implement C++ try-catch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59987 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 21:45:59 +00:00
Ted Kremenek d017243919 Fix CFG bug where the 'increment' block for a 'for' statement would not be
properly reversed once constructed.

This fixes PR 3125:

http://llvm.org/bugs/show_bug.cgi?id=3125


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59982 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 20:50:24 +00:00
Sebastian Redl d14094db33 Remove some bad characters from comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59979 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 20:06:50 +00:00
Sebastian Redl ddee68bf6b Fix the fix of revision 59974. Now array-struct.c passes too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59975 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:39:40 +00:00
Sebastian Redl e95db4f2cd Fix crash of array bounds checking under 64-bit.
There might be other, similar bugs lurking there.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:35:33 +00:00
Ted Kremenek a68c106ed2 Remove FIXME comment.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 19:27:06 +00:00
Zhongxing Xu baf03a7c0a Add support for AllocaRegion extent with GDM.
One design problem that is emerging is the signed-ness problem during static
analysis. Many unsigned value have to be converted into signed value because
it partipates in operations with signed values. 

On the other hand, we cannot blindly make all values occuring in static analysis
signed, because we do have cases where unsignedness is required, for example,
integer overflow detection.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 09:44:56 +00:00
Zhongxing Xu 8b86273806 Add utility methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59956 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 09:38:21 +00:00
Zhongxing Xu 1ed8d4ba8e Cleanup code with utility method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59951 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 07:02:06 +00:00
Chris Lattner d162584991 Change a whole lot of diagnostics to take QualType's directly
instead of converting them to strings first.  This also fixes a
bunch of minor inconsistencies in the diagnostics emitted by clang
and adds a bunch of FIXME's to DiagnosticKinds.def.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59948 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 06:25:27 +00:00
Chris Lattner d9d22dd9c9 Rename NamedDecl::getName() to getNameAsString(). Replace a bunch of
uses of getName() with uses of getDeclName().  This upgrades a bunch of
diags to take DeclNames instead of std::strings.

This also tweaks a couple of diagnostics to be cleaner and changes
CheckInitializerTypes/PerformInitializationByConstructor to pass
around DeclarationNames instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59947 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:29:24 +00:00
Anders Carlsson e8a32b855c Reimplement Expr::isConstantExpr in terms of Expr::Evaluate. This fixes PR2832.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:23:59 +00:00
Zhongxing Xu 4b89e034a7 Strings are NULL terminated. So the region size should plus one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:16:01 +00:00
Anders Carlsson 35873c49ad The address of a variable is only constant if the variable has global storage.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59939 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 04:41:22 +00:00
Anders Carlsson 4bbc0e05a7 Fix bug in the constant evaluator. Fixes PR3115.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59938 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 04:21:33 +00:00
Chris Lattner 39f34e97d6 Migrate some stuff from NamedDecl::getName() to
NamedDecl::getNameAsString() to make it more explicit.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 04:00:27 +00:00
Chris Lattner 8ec03f58c3 Rename NamedDecl::getIdentifierName() to ::getNameAsCString() and make it
assert if the name is not an identifier.  Update callers to do the right
thing and avoid this method in unsafe cases.  This also fixes an objc
warning that was missing a space, and migrates a couple more to taking
IdentifierInfo and QualTypes instead of std::strings.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:54:41 +00:00
Chris Lattner bb49c3ee5d simplify this code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59935 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:52:59 +00:00
Chris Lattner 077bf5e2f4 Rename Selector::getName() to Selector::getAsString(), and add
a new NamedDecl::getAsString() method.

Change uses of Selector::getName() to just pass in a Selector 
where possible (e.g. to diagnostics) instead of going through
an std::string.

This also adds new formatters for objcinstance and objcclass
as described in the dox.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59933 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:33:13 +00:00
Zhongxing Xu d0fd3b747c Add a comment about the signedness.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59932 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 02:30:48 +00:00
Zhongxing Xu 6613d08a19 Add getSize() support for StringRegion.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 02:18:56 +00:00
Chris Lattner 1326a3dcbb convert some more warnings to NOTEs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59923 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 23:26:13 +00:00
Chris Lattner 8b265bd5eb remove warn_previous_declaration
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 23:20:13 +00:00
Chris Lattner 28eb7e992b make the 'to match this' diagnostic a note.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59921 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 23:17:07 +00:00
Chris Lattner 5f4a6829dc Make all the 'redefinition' diagnostics more consistent, and make the
"previously defined here" diagnostics all notes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59920 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 23:12:31 +00:00
Chris Lattner b8b96aff63 make some objc redefinition warnings more consistent: call definitions
"definitions", not declarations.  Point out the location of the 
original definition.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59919 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 22:46:27 +00:00
Chris Lattner 6ff0fc341f Tweak duplicate category diagnostic to work like the duplicate protocol diagnostic.
Also, point out where the previous decl was.  This unxfails two tests.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59918 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 22:38:38 +00:00
Chris Lattner 08631c5fa0 Convert IdentifierInfo's to be printed the same as DeclarationNames
with implicit quotes around them.  This has a bunch of follow-on 
effects and requires tweaking to a whole lot of code.  This causes
a regression in two tests (xfailed) by causing it to emit things like:

  Line 10: duplicate interface declaration for category 'MyClass1' ('Category1')

instead of:

  Line 10: duplicate interface declaration for category 'MyClass1(Category1)'

I will fix this in a follow-up commit.

As part of this, I had to start switching stuff to use ->getDeclName() instead
of Decl::getName() for consistency.  This is good, but I was planning to do this
as an independent patch.  There will be several follow-on patches
to clean up some of the mess, but this patch is already too big.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59917 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 21:45:46 +00:00
Chris Lattner 011bb4edf7 add support for inserting a DeclarationName into a diagnostic directly
without calling getAsString().  This implicitly puts quotes around the
name, so diagnostics need to be tweaked to accommodate this.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59916 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 20:28:15 +00:00
Chris Lattner 3fdf4b071d Genericize the qualtype formating callback to support any diag argument.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 09:21:17 +00:00
Chris Lattner 22caddc91d Add support for sending QualType's directly into diags and convert two
diags over to use this.  QualTypes implicitly print single quotes around 
them for uniformity and future extension.

Doing this requires a little function pointer dance to prevent libbasic
from depending on libast.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 09:13:29 +00:00
Zhongxing Xu 1c0c233253 Add out-of-bound memory access warning report code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59903 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 05:52:28 +00:00
Zhongxing Xu 63123d8e48 Clean up code by using utility methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-23 04:30:35 +00:00
Anders Carlsson 9d4c157baa Return false if we encounter a type we can't handle.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:56:32 +00:00
Anders Carlsson ef5a66d817 An expression is not foldable if it can't be fully evaluated. Fixes PR3060
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:32:07 +00:00
Fariborz Jahanian 43f447098d Implemented ir-gen for 'implicit' properties using the new AST nodes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59886 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 22:30:21 +00:00
Anders Carlsson 6dde0d5dc0 Case values must be evaluated
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 21:50:49 +00:00
Anders Carlsson 51fe996231 Use Expr::Evaluate for case statements. Fixes PR2525
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59881 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 21:04:56 +00:00
Chris Lattner 32b939b51b remove a dead enum
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59879 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 20:47:38 +00:00
Fariborz Jahanian ba8d2d684e Support for implicit property assignment. Error assigning to
'implicit' property with no 'setter'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 20:25:50 +00:00
Fariborz Jahanian 5daf570d0c New AST node to access "implicit" setter/getter using property dor syntax.
Issuing diagnostics when assigning to read-only properties.
This is work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59874 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 18:39:36 +00:00
Sebastian Redl e4c452c4c7 Implement a %plural modifier for complex plural forms in diagnostics. Use it in the overload diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59871 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 13:44:36 +00:00
Zhongxing Xu 369f42971b Remove debug code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59870 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 13:23:00 +00:00
Zhongxing Xu e8a964bdb4 Initial support for checking out of bound memory access. Only support
ConcreteInt index for now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 13:21:46 +00:00
Chris Lattner 254be6ac14 remove some more old Diag methods, replace with a single static helper function
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 08:32:36 +00:00
Chris Lattner 3cfa928f9c move the Diag method for Sema to be inline. This shrinks the release-asserts
clang executable (when built with gcc 4.2 on the mac) from 14519740 to 
14495028 bytes.  This shrinks individual object files as well: SemaChecking
from 23580->22248, SemaDeclObjc from 61368->57376, SemaExpr from 
115628->110516, as well as several others.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59867 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 08:28:49 +00:00
Chris Lattner 4984212fce Fix a weird inconsistency with hex floats. Previously the lexer
would not eat the "-1" in "0x0p-1", but LiteralSupport would accept
it when extensions are on.  This caused strangeness and failures 
when hexfloats were properly treated as an extension (not error)
in LiteralSupport.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59865 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 07:39:03 +00:00
Chris Lattner ac92d82911 remove the NumericLiteralParser::Diag helper method, inlining it into
its call sites.  This makes it more explicit when the hasError flag is
getting set and removes a confusing difference in behavior between
PP.Diag and Diag in this code.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59863 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 07:23:31 +00:00
Chris Lattner adc4eeb080 Move the Preprocessor::Diag methods inline. This has the interesting
(and carefully calculated) effect of allowing the compiler to reason
about the aliasing properties of DiagnosticBuilder object better,
allowing the whole thing to be promoted to registers instead of
resulting in a ton of stack traffic.

While I'm not very concerned about the performance of the Diag() method
invocations, I *am* more concerned about their code size and impact on the
non-diagnostic code.  This patch shrinks the clang executable (in 
release-asserts mode with gcc-4.2) from 14523980 to 14519816 bytes.  This
isn't much, but it shrinks the lexer from 38192 to 37776, PPDirectives.o
from 31116 to 28868 bytes, etc.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59862 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 07:03:46 +00:00
Chris Lattner 9efe970928 inline a method into its only two call sites.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59860 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 06:42:31 +00:00
Chris Lattner 30c6476e8e actually, this version isn't really needed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59859 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 06:22:39 +00:00
Chris Lattner 306fda76b0 remove a sneaky version of Diag hiding in PreprocessorLexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 06:20:42 +00:00
Anders Carlsson bcf6225ad6 Use tryEvaluate for constant exprs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 02:34:39 +00:00
Chris Lattner 74d15dfd18 Change the Lexer::Diag method to not magically silence warnings,
force the caller to check instead.  This eliminates the need (and the
risk!) of weird null DiagnosticBuilder's floating around.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59856 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 02:02:22 +00:00
Chris Lattner a4f34eaab2 Teach tentative parsing to handle block pointers (rdar://6394309)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59853 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 01:15:33 +00:00
Chris Lattner 3cbfe2c415 Split the DiagnosticInfo class into two disjoint classes:
one for building up the diagnostic that is in flight (DiagnosticBuilder)
and one for pulling structured information out of the diagnostic when
formatting and presenting it.

There is no functionality change with this patch.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22 00:59:29 +00:00
Ted Kremenek d2bdeed072 In PTHLexer::DiscardToEndOfLine() use Lex() instead of AdvanceToken(). This handles transitions in the preprocessor state.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 23:28:56 +00:00
Ted Kremenek b93efa3d8f Reenable the default lexer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59843 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 20:51:59 +00:00
Ted Kremenek d5a8f0bde6 When creating the raw tokens for PTHLexer, make sure the token representing the file to include is checked for being an identifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59842 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 20:51:15 +00:00
Ted Kremenek c840f0cbd9 When creating raw tokens for the PTHLexer specially handle angled strings for #include directives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59840 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:41:29 +00:00
Fariborz Jahanian f2878e5dff Fixed bugzilla bug# 3095 related to code gen. for @synchronized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:21:53 +00:00
Sebastian Redl 4c5d320a75 Implementation of new and delete parsing and sema.
This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59835 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 19:14:01 +00:00
Chris Lattner 2c21a07352 merge some simple call diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59831 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 18:44:24 +00:00
Chris Lattner b1b4d337fa print a type in a diagnostic.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 18:27:34 +00:00
Fariborz Jahanian 2ab1968eb4 Fields of ivars of struct types are considered ivars
themselves for gc API generation purposes.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59828 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 18:14:01 +00:00
Chris Lattner 4e8a9e8640 reapply the (corrected) patch to use the new llvm intrinsics for memcpy/memmove etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59824 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:43:15 +00:00
Douglas Gregor bbe2743b02 Allow redeclaration of typedefs in C++
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59822 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:29:06 +00:00
Chris Lattner d67777662b temporarily revert Sangiv's patch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59821 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:26:37 +00:00
Douglas Gregor c19923dda3 Tiny fix to the parsing of linkage-specifications
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:10:08 +00:00