]> granicus.if.org Git - clang/log
clang
15 years agointroduce the one true Diag method for Sema. Next up: kill all the others off.
Chris Lattner [Tue, 18 Nov 2008 21:53:24 +0000 (21:53 +0000)]
introduce the one true Diag method for Sema.  Next up: kill all the others off.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59556 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAllow diagnostics to be used in bool context, like:
Chris Lattner [Tue, 18 Nov 2008 21:53:02 +0000 (21:53 +0000)]
Allow diagnostics to be used in bool context, like:

return Diag(...);

when the function returns bool.  This always evaluates to true.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59555 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove the last of the old-style Preprocessor::Diag methods.
Chris Lattner [Tue, 18 Nov 2008 21:48:13 +0000 (21:48 +0000)]
Remove the last of the old-style Preprocessor::Diag methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59554 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGenerate objc_read_weak for __weak objc loads.
Fariborz Jahanian [Tue, 18 Nov 2008 21:45:40 +0000 (21:45 +0000)]
Generate objc_read_weak for __weak objc loads.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59553 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSome basic support toward objective-c's GC code gen.
Fariborz Jahanian [Tue, 18 Nov 2008 20:18:11 +0000 (20:18 +0000)]
Some basic support toward objective-c's GC code gen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59543 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6329769> [sema] crash on duplication definition of interface...
Steve Naroff [Tue, 18 Nov 2008 19:15:30 +0000 (19:15 +0000)]
Fix <rdar://problem/6329769> [sema] crash on duplication definition of interface with protocols.

As soon as we detect duplicate interfaces, discontinue further semantic checks (returning the original interface).

This is now consistent with how we handle protocols (and less error prone in general).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59541 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove this testcase, it fails with -verify still
Torok Edwin [Tue, 18 Nov 2008 18:48:14 +0000 (18:48 +0000)]
remove this testcase, it fails with -verify still

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59539 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix test. it now crashes, but thats another problem..
Nuno Lopes [Tue, 18 Nov 2008 17:57:01 +0000 (17:57 +0000)]
fix test. it now crashes, but thats another problem..

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59537 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd some quick notes on the clang tests and running the LLVM test
Daniel Dunbar [Tue, 18 Nov 2008 17:56:21 +0000 (17:56 +0000)]
Add some quick notes on the clang tests and running the LLVM test
suite with clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59536 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInput files should be before link options.
Daniel Dunbar [Tue, 18 Nov 2008 17:38:30 +0000 (17:38 +0000)]
Input files should be before link options.
 - PR3094.
 - No test case, ccc is not really a supported product (llvmc2 already
   got this right).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59535 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd testcase for PR3093
Torok Edwin [Tue, 18 Nov 2008 17:31:32 +0000 (17:31 +0000)]
add testcase for PR3093

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59534 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodon't dereference a null pointer
Chris Lattner [Tue, 18 Nov 2008 17:18:16 +0000 (17:18 +0000)]
don't dereference a null pointer

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59533 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAs threatened previously: consolidate name lookup and the creation of
Douglas Gregor [Tue, 18 Nov 2008 15:03:34 +0000 (15:03 +0000)]
As threatened previously: consolidate name lookup and the creation of
DeclRefExprs and BlockDeclRefExprs into a single function
Sema::ActOnDeclarationNameExpr, eliminating a bunch of duplicate
lookup-name-and-check-the-result code.

Note that we still have the three parser entry points for identifiers,
operator-function-ids, and conversion-function-ids, since the parser
doesn't (and shouldn't) know about DeclarationNames. This is a Good
Thing (TM), and there will be more entrypoints coming (e.g., for C++
pseudo-destructor expressions).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59527 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoExtend DeclarationName to support C++ overloaded operators, e.g.,
Douglas Gregor [Tue, 18 Nov 2008 14:39:36 +0000 (14:39 +0000)]
Extend DeclarationName to support C++ overloaded operators, e.g.,
operator+, directly, using the same mechanism as all other special
names.

Removed the "special" identifiers for the overloaded operators from
the identifier table and IdentifierInfo data structure. IdentifierInfo
is back to representing only real identifiers.

Added a new Action, ActOnOperatorFunctionIdExpr, that builds an
expression from an parsed operator-function-id (e.g., "operator
+"). ActOnIdentifierExpr used to do this job, but
operator-function-ids are no longer represented by IdentifierInfo's.

Extended Declarator to store overloaded operator names.
Sema::GetNameForDeclarator now knows how to turn the operator
name into a DeclarationName for the overloaded operator.

Except for (perhaps) consolidating the functionality of
ActOnIdentifier, ActOnOperatorFunctionIdExpr, and
ActOnConversionFunctionExpr into a common routine that builds an
appropriate DeclRefExpr by looking up a DeclarationName, all of the
work on normalizing declaration names should be complete with this
commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59526 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix 80-col violation.
Zhongxing Xu [Tue, 18 Nov 2008 13:35:51 +0000 (13:35 +0000)]
Fix 80-col violation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59523 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd test cast for struct array.
Zhongxing Xu [Tue, 18 Nov 2008 13:30:46 +0000 (13:30 +0000)]
Add test cast for struct array.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59522 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agohandle the case that the array element is of structure type when bind the whole array...
Zhongxing Xu [Tue, 18 Nov 2008 13:11:04 +0000 (13:11 +0000)]
handle the case that the array element is of structure type when bind the whole array to a single value (for example, UnknownVal, UndefinedVal).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59521 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove one more Preprocessor::Diag method.
Chris Lattner [Tue, 18 Nov 2008 08:02:48 +0000 (08:02 +0000)]
remove one more Preprocessor::Diag method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59512 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoConvert the lexer and start converting the PP over to using canonical Diag methods.
Chris Lattner [Tue, 18 Nov 2008 07:59:24 +0000 (07:59 +0000)]
Convert the lexer and start converting the PP over to using canonical Diag methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59511 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove the last couple obsolete forms of Parser::Diag.
Chris Lattner [Tue, 18 Nov 2008 07:50:21 +0000 (07:50 +0000)]
remove the last couple obsolete forms of Parser::Diag.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59510 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange a couple of the Parser::Diag methods to return DiagnosticInfo
Chris Lattner [Tue, 18 Nov 2008 07:48:38 +0000 (07:48 +0000)]
Change a couple of the Parser::Diag methods to return DiagnosticInfo
and let the clients push whatever they want into the DiagnosticInfo
instead of hard coding a few forms.  Also switch various clients to
use Diag(Tok, ...) instead of Diag(Tok.getLocation(), ...) as the
canonical form to simplify the code a bit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59509 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThe 'return Diag(...)' idiom should be treated as returning an
Chris Lattner [Tue, 18 Nov 2008 07:47:11 +0000 (07:47 +0000)]
The 'return Diag(...)' idiom should be treated as returning an
invalid expr/stmt, etc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59508 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoGive DiagnosticInfo a real copy constructor, even though it
Chris Lattner [Tue, 18 Nov 2008 07:46:42 +0000 (07:46 +0000)]
Give DiagnosticInfo a real copy constructor, even though it
is destructive.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59507 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoalphabeticalize.
Chris Lattner [Tue, 18 Nov 2008 07:46:14 +0000 (07:46 +0000)]
alphabeticalize.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59506 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Tue, 18 Nov 2008 07:27:02 +0000 (07:27 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59503 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoThis reworks some of the Diagnostic interfaces a bit to change how diagnostics
Chris Lattner [Tue, 18 Nov 2008 07:04:44 +0000 (07:04 +0000)]
This reworks some of the Diagnostic interfaces a bit to change how diagnostics
are formed.  In particular, a diagnostic with all its strings and ranges is now
packaged up and sent to DiagnosticClients as a DiagnosticInfo instead of as a
ton of random stuff.  This has the benefit of simplifying the interface, making
it more extensible, and allowing us to do more checking for things like access
past the end of the various arrays passed in.

In addition to introducing DiagnosticInfo, this also substantially changes how
Diagnostic::Report works.  Instead of being passed in all of the info required
to issue a diagnostic, Report now takes only the required info (a location and
ID) and returns a fresh DiagnosticInfo *by value*.  The caller is then free to
stuff strings and ranges into the DiagnosticInfo with the << operator.  When
the dtor runs on the DiagnosticInfo object (which should happen at the end of
the statement), the diagnostic is actually emitted with all of the accumulated
information.  This is a somewhat tricky dance, but it means that the
accumulated DiagnosticInfo is allowed to keep pointers to other expression
temporaries without those pointers getting invalidated.

This is just the minimal change to get this stuff working, but this will allow
us to eliminate the zillions of variant "Diag" methods scattered throughout
(e.g.) sema.  For example, instead of calling:

  Diag(BuiltinLoc, diag::err_overload_no_match, typeNames,
       SourceRange(BuiltinLoc, RParenLoc));

We will soon be able to just do:

  Diag(BuiltinLoc, diag::err_overload_no_match)
      << typeNames << SourceRange(BuiltinLoc, RParenLoc));

This scales better to support arbitrary types being passed in (not just
strings) in a type-safe way.  Go operator overloading?!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59502 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAttribute nonnull can be applied to block pointers.
Ted Kremenek [Tue, 18 Nov 2008 06:52:58 +0000 (06:52 +0000)]
Attribute nonnull can be applied to block pointers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59499 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSourceManager::getLineNumber is logically const except for caching.
Chris Lattner [Tue, 18 Nov 2008 06:51:15 +0000 (06:51 +0000)]
SourceManager::getLineNumber is logically const except for caching.
Use mutable to make it so.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59498 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoeliminate dependence of strange "Diagnostic::Report" method,
Chris Lattner [Tue, 18 Nov 2008 06:07:40 +0000 (06:07 +0000)]
eliminate dependence of strange "Diagnostic::Report" method,
delete huge trailing whitespace to fit in 80 cols.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59497 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoremove a helper method with only one call site.
Chris Lattner [Tue, 18 Nov 2008 05:05:28 +0000 (05:05 +0000)]
remove a helper method with only one call site.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59495 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange the diagnostics interface to take an array of pointers to
Chris Lattner [Tue, 18 Nov 2008 04:56:44 +0000 (04:56 +0000)]
Change the diagnostics interface to take an array of pointers to
strings instead of array of strings.  This reduces string copying
in some not-very-important cases, but paves the way for future
improvements.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59494 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agocleanups.
Chris Lattner [Tue, 18 Nov 2008 04:53:45 +0000 (04:53 +0000)]
cleanups.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59493 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosort files.
Chris Lattner [Tue, 18 Nov 2008 04:48:28 +0000 (04:48 +0000)]
sort files.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59492 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agocleanups and simplifications.
Chris Lattner [Tue, 18 Nov 2008 04:44:58 +0000 (04:44 +0000)]
cleanups and simplifications.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59491 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPreprocessor::PushIncludeMacroStack() should always zero out CurPPLexer.
Ted Kremenek [Tue, 18 Nov 2008 03:28:24 +0000 (03:28 +0000)]
Preprocessor::PushIncludeMacroStack() should always zero out CurPPLexer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59490 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Add Lexer::isPragma() accessor for clients of Lexer that aren't friends.
Ted Kremenek [Tue, 18 Nov 2008 01:33:13 +0000 (01:33 +0000)]
- Add Lexer::isPragma() accessor for clients of Lexer that aren't friends.
- Add static method to test if the current lexer is a non-macro/non-pragma
  lexer.
- Refactor some code in PPLexerChange to use this static method.
- No performance change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59486 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agominor cleanups and tidying, no functionality change.
Chris Lattner [Tue, 18 Nov 2008 01:30:42 +0000 (01:30 +0000)]
minor cleanups and tidying, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59485 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement a fixme by making warnings for ++/-- on non-modifiable-lvalues better.
Chris Lattner [Tue, 18 Nov 2008 01:26:17 +0000 (01:26 +0000)]
implement a fixme by making warnings for ++/-- on non-modifiable-lvalues better.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59484 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofactor some code out into a helper function
Chris Lattner [Tue, 18 Nov 2008 01:22:49 +0000 (01:22 +0000)]
factor some code out into a helper function

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59483 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReplace more uses of 'CurLexer->' with 'CurPPLexer->'. No performance change.
Ted Kremenek [Tue, 18 Nov 2008 01:12:54 +0000 (01:12 +0000)]
Replace more uses of 'CurLexer->' with 'CurPPLexer->'.  No performance change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59482 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd hooks to use PTHLexer::Lex instead of Lexer::Lex when CurLexer is null.
Ted Kremenek [Tue, 18 Nov 2008 01:04:47 +0000 (01:04 +0000)]
Add hooks to use PTHLexer::Lex instead of Lexer::Lex when CurLexer is null.
Performance tests on Cocoa.h (using the regular Lexer) shows no performance
difference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59479 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate Xcode project.
Ted Kremenek [Tue, 18 Nov 2008 00:57:33 +0000 (00:57 +0000)]
Update Xcode project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59478 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdded conditional guard 'if (CurLexer)' when using SetCommentRetentionState().
Ted Kremenek [Tue, 18 Nov 2008 00:43:07 +0000 (00:43 +0000)]
Added conditional guard 'if (CurLexer)' when using SetCommentRetentionState().
This is because the PTHLexer will not support this method. Performance testing
on preprocessing Cocoa.h shows that this results in a negligible performance
difference (less than 1%).

I tried making Lexer::SetCommentRetentionState() an out-of-line function (a
precursor to making it a virtual function in PreprocessorLexer) and noticed a 1%
decrease in speed (it is called in a hot part of the Preprocessor).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59477 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoChange a bunch of uses of 'CurLexer->' to 'CurPPLexer->', which should be the
Ted Kremenek [Tue, 18 Nov 2008 00:34:22 +0000 (00:34 +0000)]
Change a bunch of uses of 'CurLexer->' to 'CurPPLexer->', which should be the
alias for the current PreprocessorLexer. No functionality change. Performance
testing shows this results in no performance degradation when preprocessing
Cocoa.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59474 91177308-0d34-0410-b5e6-96231b3b80d8

15 years ago- Add 'CurPPLexer' to Preprocessor to keep track of the current
Ted Kremenek [Tue, 18 Nov 2008 00:12:49 +0000 (00:12 +0000)]
- Add 'CurPPLexer' to Preprocessor to keep track of the current
  PreprocessorLexer, which will either be a 'Lexer' or 'PTHLexer'.
- Added stub field 'CurPTHLexer' to keep track of the current PTHLexer.
- Modified IncludeStackInfo to track both the current PTHLexer and
  current PreprocessorLexer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59472 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement effects of 'mutable', and a few comments from Chris on its parsing.
Sebastian Redl [Mon, 17 Nov 2008 23:24:37 +0000 (23:24 +0000)]
Implement effects of 'mutable', and a few comments from Chris on its parsing.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59470 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate all of the placeholder identifiers used for constructors,
Douglas Gregor [Mon, 17 Nov 2008 22:58:34 +0000 (22:58 +0000)]
Eliminate all of the placeholder identifiers used for constructors,
destructors, and conversion functions. The placeholders were used to
work around the fact that the parser and some of Sema really wanted
declarators to have simple identifiers; now, the code that deals with
declarators will use DeclarationNames.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59469 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFold assertion into second valid else branch. This removes a compiler warning
Ted Kremenek [Mon, 17 Nov 2008 22:55:12 +0000 (22:55 +0000)]
Fold assertion into second valid else branch.  This removes a compiler warning
where the control reaches the end of a non-void function and also allows the
compiler to generate better code.  When this assertion is false we can easily
add more else cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59468 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6333904> [sema] message lookup on super is incorrect
Steve Naroff [Mon, 17 Nov 2008 22:29:32 +0000 (22:29 +0000)]
Fix <rdar://problem/6333904> [sema] message lookup on super is incorrect

Missing special lookup rule in Sema::ActOnInstanceMessage().

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59467 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoOnly test test/CodeGenObjC/synchronized.m as a i686-apple-darwin8 target
Douglas Gregor [Mon, 17 Nov 2008 20:45:14 +0000 (20:45 +0000)]
Only test test/CodeGenObjC/synchronized.m as a i686-apple-darwin8 target

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59463 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated IdentifierResolver to deal with DeclarationNames. The names of
Douglas Gregor [Mon, 17 Nov 2008 20:34:05 +0000 (20:34 +0000)]
Updated IdentifierResolver to deal with DeclarationNames. The names of
C++ constructors, destructors, and conversion functions now have a
FETokenInfo field that IdentifierResolver can access, so that these
special names are handled just like ordinary identifiers. A few other
Sema routines now use DeclarationNames instead of IdentifierInfo*'s.

To validate this design, this code also implements parsing and
semantic analysis for id-expressions that name conversion functions,
e.g.,

  return operator bool();

The new parser action ActOnConversionFunctionExpr takes the result of
parsing "operator type-id" and turning it into an expression, using
the IdentifierResolver with the DeclarationName of the conversion
function. ActOnDeclarator pushes those conversion function names into
scope so that the IdentifierResolver can find them, of course.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59462 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement rdar://6319320: give a good diagnostic for cases where people
Chris Lattner [Mon, 17 Nov 2008 19:51:54 +0000 (19:51 +0000)]
Implement rdar://6319320: give a good diagnostic for cases where people
are trying to use the old GCC "casts as lvalue" extension.  We don't and
will hopefully never support this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59460 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6316324> [sema] spurious warning on comparison of qualified id.
Steve Naroff [Mon, 17 Nov 2008 19:49:16 +0000 (19:49 +0000)]
Fix <rdar://problem/6316324> [sema] spurious warning on comparison of qualified id.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59459 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Mon, 17 Nov 2008 19:26:13 +0000 (19:26 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59457 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTest case for objective-c's @synchronized statement.
Fariborz Jahanian [Mon, 17 Nov 2008 18:03:28 +0000 (18:03 +0000)]
Test case for objective-c's @synchronized statement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59451 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd TODO item for adding more source-range information to declarators
Douglas Gregor [Mon, 17 Nov 2008 17:14:10 +0000 (17:14 +0000)]
Add TODO item for adding more source-range information to declarators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59446 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6320086> parser rejects block capturing ivar.
Steve Naroff [Mon, 17 Nov 2008 16:28:52 +0000 (16:28 +0000)]
Fix <rdar://problem/6320086> parser rejects block capturing ivar.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59444 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSome cleanups for C++ operator overloading
Douglas Gregor [Mon, 17 Nov 2008 16:14:12 +0000 (16:14 +0000)]
Some cleanups for C++ operator overloading

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59443 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSimplify error messages for two-parameter overloaded increment/decrement operators
Douglas Gregor [Mon, 17 Nov 2008 15:03:30 +0000 (15:03 +0000)]
Simplify error messages for two-parameter overloaded increment/decrement operators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59442 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoIntroduction the DeclarationName class, as a single, general method of
Douglas Gregor [Mon, 17 Nov 2008 14:58:09 +0000 (14:58 +0000)]
Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agopad header out to 80 cols
Chris Lattner [Mon, 17 Nov 2008 04:06:37 +0000 (04:06 +0000)]
pad header out to 80 cols

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59438 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd OperatorKinds.* to the project.
Chris Lattner [Mon, 17 Nov 2008 04:05:52 +0000 (04:05 +0000)]
add OperatorKinds.* to the project.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59437 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoline up some columns, no functionality change.
Chris Lattner [Mon, 17 Nov 2008 04:03:07 +0000 (04:03 +0000)]
line up some columns, no functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59436 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoA few corrections to the expr constant work. Not enabled at the
Eli Friedman [Mon, 17 Nov 2008 03:57:28 +0000 (03:57 +0000)]
A few corrections to the expr constant work. Not enabled at the
moment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59435 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore expr constant work. (Off by default).
Anders Carlsson [Mon, 17 Nov 2008 01:58:55 +0000 (01:58 +0000)]
More expr constant work. (Off by default).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59433 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAddress some comments Eli had.
Anders Carlsson [Sun, 16 Nov 2008 22:46:56 +0000 (22:46 +0000)]
Address some comments Eli had.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59430 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)
Nuno Lopes [Sun, 16 Nov 2008 22:06:39 +0000 (22:06 +0000)]
use HandleConversionToBool() to check if a given cond is foldable (per Eli's comment)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59429 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore complex float evaluator support.
Anders Carlsson [Sun, 16 Nov 2008 21:51:21 +0000 (21:51 +0000)]
More complex float evaluator support.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59428 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDescribe how constant folding and i-c-e diagnosing should work.
Chris Lattner [Sun, 16 Nov 2008 21:48:07 +0000 (21:48 +0000)]
Describe how constant folding and i-c-e diagnosing should work.
Unfortunately, we're not here yet, but eventually Expr::isConstantExpr
and friends should go away.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59427 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agorename Expr::tryEvaluate to Expr::Evaluate.
Chris Lattner [Sun, 16 Nov 2008 21:24:15 +0000 (21:24 +0000)]
rename Expr::tryEvaluate to Expr::Evaluate.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59426 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd very limited support for evaluating complex floats.
Anders Carlsson [Sun, 16 Nov 2008 20:27:53 +0000 (20:27 +0000)]
Add very limited support for evaluating complex floats.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59425 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoTrivial tidying
Chris Lattner [Sun, 16 Nov 2008 20:22:05 +0000 (20:22 +0000)]
Trivial tidying

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59424 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd PTHLexer.h to project
Chris Lattner [Sun, 16 Nov 2008 20:18:49 +0000 (20:18 +0000)]
add PTHLexer.h to project

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59423 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix folding of comma if given a non-constant operand.
Nuno Lopes [Sun, 16 Nov 2008 20:09:07 +0000 (20:09 +0000)]
fix folding of comma if given a non-constant operand.
Eli please take a look, as I'm not sure if this gets the extension warning in the right place

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59422 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake IntExprEvaluator fold the ?: operator
Nuno Lopes [Sun, 16 Nov 2008 19:28:31 +0000 (19:28 +0000)]
make IntExprEvaluator fold the ?: operator

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59421 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore work on the constant evaluator. Eli, it would be great if you could have a look...
Anders Carlsson [Sun, 16 Nov 2008 19:01:22 +0000 (19:01 +0000)]
More work on the constant evaluator. Eli, it would be great if you could have a look at this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59420 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.
Chris Lattner [Sun, 16 Nov 2008 18:43:46 +0000 (18:43 +0000)]
Fix PR3075, __builtin_stdarg_start being misprototyped. This affects netbsd headers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59419 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR3077: tokens that come from macro expansions whose macro was
Chris Lattner [Sun, 16 Nov 2008 18:36:34 +0000 (18:36 +0000)]
Fix PR3077: tokens that come from macro expansions whose macro was
defined in a system header should be treated as system header tokens
even if they are instantiated in a different place.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59418 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd targe triple commandline option to fix test failure on Linux.
Zhongxing Xu [Sun, 16 Nov 2008 09:17:52 +0000 (09:17 +0000)]
add targe triple commandline option to fix test failure on Linux.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59412 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd dump and print methods, add operator<< for APValue.
Chris Lattner [Sun, 16 Nov 2008 07:46:48 +0000 (07:46 +0000)]
add dump and print methods, add operator<< for APValue.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59411 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomove some APValue methods out of line.
Chris Lattner [Sun, 16 Nov 2008 07:35:53 +0000 (07:35 +0000)]
move some APValue methods out of line.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59410 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd the ability to evaluate comparison operators with floating point numbers as operands.
Anders Carlsson [Sun, 16 Nov 2008 07:17:21 +0000 (07:17 +0000)]
Add the ability to evaluate comparison operators with floating point numbers as operands.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59408 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhance modularization: return a <state,loc> pair to let GRExprEngine modify the
Zhongxing Xu [Sun, 16 Nov 2008 07:06:26 +0000 (07:06 +0000)]
Enhance modularization: return a <state,loc> pair to let GRExprEngine modify the
environment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59407 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore constant expr work.
Anders Carlsson [Sun, 16 Nov 2008 06:23:45 +0000 (06:23 +0000)]
More constant expr work.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59405 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agodaniel prefers completed thoughts.
Chris Lattner [Sun, 16 Nov 2008 06:16:27 +0000 (06:16 +0000)]
daniel prefers completed thoughts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59404 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRe-enable array-struct test.
Zhongxing Xu [Sun, 16 Nov 2008 04:47:39 +0000 (04:47 +0000)]
Re-enable array-struct test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59396 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEnhances SCA to process untyped region to typed region conversion.
Zhongxing Xu [Sun, 16 Nov 2008 04:07:26 +0000 (04:07 +0000)]
Enhances SCA to process untyped region to typed region conversion.
 - RegionView and RegionViewMap is introduced to assist back-mapping from
   super region to subregions.
 - GDM is used to carry RegionView information.
 - AnonTypedRegion is added to represent a typed region introduced by pointer
   casting. Later AnonTypedRegion can be used in other similar cases, e.g.,
   malloc()'ed region.
 - The specific conversion is delegated to store manager.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59382 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStart implementing support for @synchonized with the darwin ObjC API.
Chris Lattner [Sat, 15 Nov 2008 21:26:17 +0000 (21:26 +0000)]
Start implementing support for @synchonized with the darwin ObjC API.

Patch by Fariborz!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59377 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoCheck in code that uses tryEvaluate for emitting constant exprs (not used yet).
Anders Carlsson [Sat, 15 Nov 2008 20:45:50 +0000 (20:45 +0000)]
Check in code that uses tryEvaluate for emitting constant exprs (not used yet).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59375 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoHandle padding in the constant CFString struct. Fixes PR3046.
Anders Carlsson [Sat, 15 Nov 2008 18:54:24 +0000 (18:54 +0000)]
Handle padding in the constant CFString struct. Fixes PR3046.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59372 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse IgnoreParenCasts. No functionality change.
Anders Carlsson [Sat, 15 Nov 2008 18:52:06 +0000 (18:52 +0000)]
Use IgnoreParenCasts. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59371 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse the allocator of ExplodedGraph. The whole static analysis module uses it.
Zhongxing Xu [Sat, 15 Nov 2008 08:19:58 +0000 (08:19 +0000)]
Use the allocator of ExplodedGraph. The whole static analysis module uses it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59359 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix silly bug spotted by Daniel Dunbar
Anders Carlsson [Sat, 15 Nov 2008 06:35:36 +0000 (06:35 +0000)]
Fix silly bug spotted by Daniel Dunbar

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59358 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove zero value generation.
Zhongxing Xu [Sat, 15 Nov 2008 05:18:50 +0000 (05:18 +0000)]
Improve zero value generation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59356 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd isUnsigned option.
Zhongxing Xu [Sat, 15 Nov 2008 05:17:04 +0000 (05:17 +0000)]
Add isUnsigned option.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59355 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReduce permissiveness of assertion.
Ted Kremenek [Sat, 15 Nov 2008 05:00:27 +0000 (05:00 +0000)]
Reduce permissiveness of assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59354 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated checker build.
Ted Kremenek [Sat, 15 Nov 2008 04:57:19 +0000 (04:57 +0000)]
Updated checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59353 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a test case for compound assignments that lazily symbolicate the value of the...
Ted Kremenek [Sat, 15 Nov 2008 04:44:13 +0000 (04:44 +0000)]
Add a test case for compound assignments that lazily symbolicate the value of the LHS when the computation type is an integer of more bits.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59352 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReverted part of r59335: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon...
Ted Kremenek [Sat, 15 Nov 2008 04:01:56 +0000 (04:01 +0000)]
Reverted part of r59335: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20081110/009243.html
In that patch I added a bogus type promotion for unary '!'.

The real bug was more fallout from edges cases with compound assignments and conjured symbolic values.  Now the conjured value has the type of the LHS expression, and we do a promotion to the computation type.  We also now correctly do a conversion from the computation type back to the LHS type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59349 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRe-enable an assertion that I mistakenly removed.
Ted Kremenek [Sat, 15 Nov 2008 02:35:08 +0000 (02:35 +0000)]
Re-enable an assertion that I mistakenly removed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59348 91177308-0d34-0410-b5e6-96231b3b80d8