Sebastian Redl
9c33e96813
Fix typo in index operator overloading.
...
llvm-svn: 60483
2008-12-03 16:32:40 +00:00
Anders Carlsson
6a113d9ddb
If a global var decl has an initializer, make sure to always set its linkage to external.
...
llvm-svn: 60462
2008-12-03 05:51:23 +00:00
Ted Kremenek
73a4d28758
PTH:
...
Use an array instead of a DenseMap to cache persistent IDs -> IdentifierInfo*. This leads to a 4% speedup at -fsyntax-only using PTH.
llvm-svn: 60452
2008-12-03 01:16:39 +00:00
Ted Kremenek
33eeabda61
- Remove PTHManager.cpp. Move all of its functions to PTHLexer.cpp since some of the internal methods are used by PTHLexer (their implementations are intertwined.) This enables some important inlining opportunities at -O3.
...
- Don't construct an std::vector<Token> prior to feeding PTH tokens to the Preprocessor. Stream them off the PTH file directly.
llvm-svn: 60447
2008-12-03 00:38:03 +00:00
Sebastian Redl
d6d55eeef5
Correct pretty printing of array new expressions.
...
llvm-svn: 60444
2008-12-02 22:08:59 +00:00
Ted Kremenek
af058b5696
Preprocessor:
...
- Added method "setPTHManager" that will be called by the driver to install
a PTHManager for the Preprocessor.
- Fixed some comments.
- Added EnterSourceFileWithPTH to mirror EnterSourceFileWithLexer.
llvm-svn: 60437
2008-12-02 19:46:31 +00:00
Ted Kremenek
498b6210fc
Added PTHManager, a utility class that will be used by Preprocessor to lazily create PTHLexer objects for pre-tokenized files.
...
llvm-svn: 60436
2008-12-02 19:45:05 +00:00
Fariborz Jahanian
eae373ea32
More type-checking of setter/getter methods. This is still
...
work in prgress.
llvm-svn: 60430
2008-12-02 18:39:49 +00:00
Sebastian Redl
538787f571
Add better comments to ::new parsing. Thanks to Doug for the review.
...
llvm-svn: 60423
2008-12-02 17:10:24 +00:00
Sebastian Redl
6ef75e9ee8
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.
llvm-svn: 60422
2008-12-02 16:47:35 +00:00
Sebastian Redl
db36b9b962
Make the parser handle ::new and ::delete correctly.
...
llvm-svn: 60421
2008-12-02 16:35:44 +00:00
Eli Friedman
39bc53593d
Update cmake build; patch by Csaba Hruska.
...
llvm-svn: 60418
2008-12-02 16:23:30 +00:00
Eli Friedman
e918435f94
Fix for PR3150: obvious copy-paste bug in
...
ScalarExprEmitter::VisitBinLOr.
llvm-svn: 60415
2008-12-02 16:02:46 +00:00
Sebastian Redl
351bb78a10
Handle new by passing the Declaration to the Action, not a processed type.
...
llvm-svn: 60413
2008-12-02 14:43:59 +00:00
Ted Kremenek
817737a002
Add FIXME.
...
llvm-svn: 60390
2008-12-02 01:26:07 +00:00
Eli Friedman
f5d08c9ee4
Disabling this code due to regression on test/CodeGen/bitfield.c. See
...
PR3152.
llvm-svn: 60389
2008-12-02 01:17:45 +00:00
Douglas Gregor
f558618fa4
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
llvm-svn: 60387
2008-12-02 00:41:28 +00:00
Fariborz Jahanian
015a48d1db
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.
llvm-svn: 60386
2008-12-02 00:19:12 +00:00
Douglas Gregor
eb31f39558
Basic support for parsing templates, from Andrew Sutton
...
llvm-svn: 60384
2008-12-01 23:54:00 +00:00
Douglas Gregor
da747baa3c
Improve error recovery when parsing a function definition fails
...
llvm-svn: 60380
2008-12-01 23:03:32 +00:00
Douglas Gregor
b690cbb928
Initialize storage class even if we got an erroneous mutable
...
llvm-svn: 60377
2008-12-01 22:46:22 +00:00
Douglas Gregor
90abb6dead
Objective-C keywords are not always identifiers. Some are also C++ keywords
...
llvm-svn: 60373
2008-12-01 21:46:47 +00:00
Steve Naroff
e1908e393e
-Add several ObjC types to Decl::getDeclKindName(), a useful debug hook.
...
-Start adding support for rewriting @synthesize.
llvm-svn: 60368
2008-12-01 20:33:01 +00:00
Douglas Gregor
95c326d14a
Use EmitInt, not Emit, to emit unsigned values
...
llvm-svn: 60364
2008-12-01 19:45:16 +00:00
Daniel Dunbar
1f3d7849a8
Add LangOptions marker for assembler-with-cpp mode and use to define
...
__ASSEMBLER__ properly. Patch from Roman Divacky (with minor
formatting changes). Thanks!
llvm-svn: 60362
2008-12-01 18:55:22 +00:00
Douglas Gregor
356513d7d0
Parse the exception-specification throw(...), a Microsoft extension
...
llvm-svn: 60359
2008-12-01 18:00:20 +00:00
Douglas Gregor
f7ab50df29
Define NULL to __null in C++, so that it's guaranteed to have the same size as a pointer
...
llvm-svn: 60355
2008-12-01 17:20:57 +00:00
Anders Carlsson
5b3638b6e7
Generate the correct results for the comma expression. Fixes PR3123.
...
llvm-svn: 60334
2008-12-01 06:44:05 +00:00
Anders Carlsson
eade3ad1f1
Revert change that made isNullPointerConstant start emitting warnings. We don't want that :)
...
llvm-svn: 60333
2008-12-01 06:28:23 +00:00
Anders Carlsson
8628645e94
Change more code over to using the new Expr::Evaluate
...
llvm-svn: 60324
2008-12-01 02:46:24 +00:00
Anders Carlsson
38eef1de6c
Change more code over to using the new Expr::Evaluate
...
llvm-svn: 60323
2008-12-01 02:42:14 +00:00
Anders Carlsson
c9687907c5
Use the new Expr::Evaluate
...
llvm-svn: 60321
2008-12-01 02:31:41 +00:00
Anders Carlsson
e7c2ac4b54
Remove dead code.
...
llvm-svn: 60320
2008-12-01 02:25:52 +00:00
Anders Carlsson
1dbffc6e36
Add Sema::isNullPointerConstant which extwarns if necessary. Use it in Sema::CheckConditionalOperands.
...
llvm-svn: 60319
2008-12-01 02:17:22 +00:00
Anders Carlsson
4bb9113da4
Add a new variant of isNullConstantExpr that returns an EvalResult.
...
llvm-svn: 60318
2008-12-01 02:13:57 +00:00
Anders Carlsson
f7fba46331
Use VerifyIntegerConstantExpression for case values.
...
llvm-svn: 60317
2008-12-01 02:13:02 +00:00
Anders Carlsson
564730a857
Emit the correct diagnostic when a comma is in an ICE.
...
llvm-svn: 60316
2008-12-01 02:07:06 +00:00
Anders Carlsson
e54e8a1182
Add Sema::VerifyIntegerConstantExpression
...
llvm-svn: 60305
2008-11-30 19:50:32 +00:00
Anders Carlsson
b33d6c8611
Change the diagnostics that the evaluator reports to be of type NOTE.
...
llvm-svn: 60301
2008-11-30 18:37:00 +00:00
Anders Carlsson
5862001157
Replace the isEvaluated bool with a ShortCircuit int, making it easier to handle recursion
...
llvm-svn: 60300
2008-11-30 18:26:25 +00:00
Anders Carlsson
27b8c5c464
Pass the expression to the Error and Extension methods.
...
llvm-svn: 60299
2008-11-30 18:14:57 +00:00
Anders Carlsson
7b6f0af83f
Add a new variant of Evaluate and reimplement the old Evaluate in terms of the new.
...
llvm-svn: 60298
2008-11-30 16:58:53 +00:00
Anders Carlsson
f50de0c590
General cleanup, evaluate the RHS of a logical op even if the LHS will give us the result.
...
llvm-svn: 60297
2008-11-30 16:51:17 +00:00
Anders Carlsson
bd1df8e866
EvalInfo now holds a reference to an EvalResult struct.
...
llvm-svn: 60296
2008-11-30 16:38:33 +00:00
Zhongxing Xu
d2fa1e0999
Add support for initializing array with string literal.
...
This fixes PR3127
http://llvm.org/bugs/show_bug.cgi?id=3127
llvm-svn: 60280
2008-11-30 05:49:49 +00:00
Eli Friedman
c59bb48e80
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.
llvm-svn: 60270
2008-11-30 02:11:09 +00:00
Eli Friedman
79ceb0947b
Minor update to CMake build system.
...
llvm-svn: 60269
2008-11-30 01:46:21 +00:00
Zhongxing Xu
452273d9c6
To be consistent, make the index of the ElementRegion always signed.
...
llvm-svn: 60248
2008-11-29 12:05:04 +00:00
Douglas Gregor
3be4b122d3
Implement the GNU __null extension
...
llvm-svn: 60235
2008-11-29 04:51:27 +00:00
Chris Lattner
9d72ff710e
Switch QualType to use llvm::PointerIntPair internally to do the pointer
...
bitmangling.
llvm-svn: 60226
2008-11-28 23:37:31 +00:00