Commit Graph

46454 Commits

Author SHA1 Message Date
Daniel Dunbar 48595de697 Update for IRBuilder template change (update LLVM!)
llvm-svn: 54642
2008-08-11 16:50:21 +00:00
Duncan Sands 1d156f2560 Make it possible to use different constant
folding policies with IRBuilder.  The default,
provided by ConstantFolder, is to do minimal
folding like now: what ConstantExpr provides.
An alternative is to use TargetFolder, which
uses target information to fold constants more.

llvm-svn: 54640
2008-08-11 15:29:30 +00:00
Daniel Dunbar 56fdb6ae69 More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.

llvm-svn: 54632
2008-08-11 06:23:49 +00:00
Chris Lattner 7b7b67872f the stacker doc is way out of date.
llvm-svn: 54631
2008-08-11 06:13:31 +00:00
Chris Lattner 4d3a5f0817 remove obsolete files
llvm-svn: 54630
2008-08-11 06:12:45 +00:00
Daniel Dunbar 6e8aa537f8 More #include cleaning
- Drop {Decl.h,DeclObjC.h,IdentifierTable.h} from Expr.h
 - Moved Sema::getCurMethodDecl() out of line (dependent on
   ObjCMethodDecl via dyn_cast).

llvm-svn: 54629
2008-08-11 05:35:13 +00:00
Daniel Dunbar ad319a73f2 More #include cleaning
- Remove internal uses of AST.h

llvm-svn: 54628
2008-08-11 05:00:27 +00:00
Daniel Dunbar 221fa94e40 More #include cleaning
- Drop Expr.h,RecordLayout.h from ASTContext.h (for DeclBase.h and
   SourceLocation.h)
 - Move ASTContext constructor into implementation

llvm-svn: 54627
2008-08-11 04:54:23 +00:00
Daniel Dunbar c74b5cc2bc More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
   implementation .cpp

llvm-svn: 54626
2008-08-11 03:45:03 +00:00
Daniel Dunbar 34fb67272c Minor #include cleaning
- Drop TokenKinds.h from Action.h
 - Move DeclSpec.h from Sema.h into individual Sema .cpp files

llvm-svn: 54625
2008-08-11 03:27:53 +00:00
Daniel Dunbar 303e2c2f1f Add dummy Mac Objective-C runtime interface.
- Not currently accessible and completely non-functional.

llvm-svn: 54624
2008-08-11 02:45:11 +00:00
Nuno Lopes d83be33cc0 fix linking with .so files specified in cmd line (this fixes some libtool usages)
llvm-svn: 54623
2008-08-10 22:17:57 +00:00
Nuno Lopes c14bcffda6 pass -R arg to linker
llvm-svn: 54622
2008-08-10 21:58:01 +00:00
Daniel Dunbar 6dfdf8c97a 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!

llvm-svn: 54621
2008-08-10 20:25:57 +00:00
Nico Weber 4c3116437c * 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

llvm-svn: 54620
2008-08-10 19:59:06 +00:00
Steve Naroff cb1e06e8fd Forgot to modify LAST_EXPR (thanks Nuno).
llvm-svn: 54619
2008-08-10 19:28:37 +00:00
Nico Weber e4919cc2bf Do not crash with -serialize.
This happened because seralization was done in the constructor, and at that time the TranslationUnit is no longer valid.

llvm-svn: 54618
2008-08-10 19:20:05 +00:00
Steve Naroff 0d7c6dbae8 Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).
llvm-svn: 54617
2008-08-10 19:10:41 +00:00
Daniel Dunbar ea0b54e6cf Add svn:ignore properties for Release-Asserts dirs
llvm-svn: 54616
2008-08-10 18:21:41 +00:00
Anders Carlsson d361a7df78 Remove the old evaluator code.
llvm-svn: 54615
2008-08-10 17:03:01 +00:00
Steve Naroff eaf5853004 InitListChecker::CheckListElementTypes(): Check for function types and issue an appropriate diagnostic.
llvm-svn: 54614
2008-08-10 16:05:48 +00:00
Steve Naroff 63ebb3cd3e Cleanup from yesterday...make isTentativeDefinition() a static helper function (no need for it to be part of the Sema API).
llvm-svn: 54613
2008-08-10 15:28:06 +00:00
Steve Naroff 84e37356d6 Sema::CheckForFileScopedRedefinitions(): Make sure tentative decls of incomplete array types are completed (and diagnosed properly).
llvm-svn: 54612
2008-08-10 15:20:13 +00:00
Argyrios Kyrtzidis b3dd1e0889 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.

llvm-svn: 54611
2008-08-10 13:15:22 +00:00
Daniel Dunbar 07bb087ac1 Fix crash during initialization of a bitfield which followed a zero
length element.

Fix some 80-col violations.

llvm-svn: 54610
2008-08-10 07:00:24 +00:00
Daniel Dunbar 63fed4f35e Update ShuffeVectorExpr::getShuffleMaskIdx to use
getIntegerConstantExprValue.

Tweak getIntegerConstantExprValue to suppress warning in
  Release-Asserts mode.

llvm-svn: 54609
2008-08-10 06:58:01 +00:00
Daniel Dunbar 9a8d07321a Bug fix, inline string literals were getting an extra '\0'.
llvm-svn: 54608
2008-08-10 06:27:44 +00:00
Chris Lattner 7ab824e43d tighten up some code and some wording on diagnostics.
llvm-svn: 54607
2008-08-10 02:05:13 +00:00
Chris Lattner 28b4294ccf wrap some long diagnostics, make 'initializer is not a constant' diagnostic
a bit more clear (rdar://5646070)

llvm-svn: 54606
2008-08-10 01:58:45 +00:00
Chris Lattner 6307f19726 rename PreDefinedExpr -> PredefinedExpr
llvm-svn: 54605
2008-08-10 01:53:14 +00:00
Argyrios Kyrtzidis 8a23f55186 Add some C++ Decl statistics.
llvm-svn: 54604
2008-08-10 01:47:31 +00:00
Chris Lattner 113b336caa move some more stuff out of my email into readme.txt
llvm-svn: 54603
2008-08-10 01:14:08 +00:00
Chris Lattner 4afb010309 add a note
llvm-svn: 54602
2008-08-10 00:47:21 +00:00
Eli Friedman a3b2f6f2af 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.

llvm-svn: 54601
2008-08-09 23:45:45 +00:00
Eli Friedman 121ba0c4d3 Fix for PR2631; make va_arg work correctly on x86-64.
llvm-svn: 54600
2008-08-09 23:32:40 +00:00
Nico Weber 53c362e34e 80 cols
llvm-svn: 54599
2008-08-09 23:08:17 +00:00
Eli Friedman 5ce8cc7554 Remove the ICE pointer cast hack; the issue this was working around is
now fixed in an alternate way.

llvm-svn: 54598
2008-08-09 22:24:21 +00:00
Eli Friedman 5cf85cc977 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.

llvm-svn: 54597
2008-08-09 22:21:56 +00:00
Nico Weber 582be4db34 add assert, use make_pair() instead of pair constructor
llvm-svn: 54596
2008-08-09 22:13:42 +00:00
Argyrios Kyrtzidis 379d2edc29 Mention 'wchar_t' at the C++ status page.
llvm-svn: 54595
2008-08-09 22:12:36 +00:00
Nico Weber 6975aaf3c2 fix spello
llvm-svn: 54594
2008-08-09 22:12:22 +00:00
Argyrios Kyrtzidis dfaf82ac2d Handle BuiltinType::WChar inside CodeGenTypes::ConvertNewType().
llvm-svn: 54593
2008-08-09 22:01:55 +00:00
Chris Lattner 572100b648 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.

llvm-svn: 54592
2008-08-09 21:35:13 +00:00
Gordon Henriksen 04c50bd7e0 Expressive diagnostics-- worth their weight in gold?
(Fixing a spelling error.)

llvm-svn: 54591
2008-08-09 19:58:22 +00:00
Nico Weber 7094a5bfa8 do not serialize invalid asts. this fixes bug #2637
llvm-svn: 54590
2008-08-09 18:32:11 +00:00
Chris Lattner 09e3b65a99 "This patch adds a virtual call to AbstractLatticeFunction to derive a
type lattice value for an Argument*, giving clients the opportunity to
use something other than Top for it if they choose to."

Patch by John McCall!

llvm-svn: 54589
2008-08-09 17:23:35 +00:00
Argyrios Kyrtzidis cbad725bf4 Change 'Wchar' to 'WChar' casing, for consistency.
No functionality change.

llvm-svn: 54588
2008-08-09 17:20:01 +00:00
Argyrios Kyrtzidis d8f2f5f1b7 Handle WChar inside BuiltinType::getName().
llvm-svn: 54587
2008-08-09 17:11:33 +00:00
Argyrios Kyrtzidis 40e9e4828f Implement support for the 'wchar_t' C++ type.
llvm-svn: 54585
2008-08-09 16:51:54 +00:00
Steve Naroff 239255d2a6 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.

llvm-svn: 54583
2008-08-09 16:04:40 +00:00