Commit Graph

46629 Commits

Author SHA1 Message Date
Devang Patel 0d29ae085b Use SmallVector instead of std::vector
llvm-svn: 54685
2008-08-12 15:44:31 +00:00
Duncan Sands a21e4d6fe6 Point people to ConstantExpr and ConstantFolding,
in case they get the wrong idea.  Fit in 80 columns.

llvm-svn: 54676
2008-08-12 09:43:15 +00:00
Daniel Dunbar 7bd00bda05 Emit OBJC_MODULE_INFO and OBJC_SYMBOLS metadata
- Matches llvm-gcc and seem to be expected by otool.

llvm-svn: 54669
2008-08-12 06:48:42 +00:00
Daniel Dunbar d627c85f43 Drop Sender from GenerateMessageSend*
- Was unused and generated a unnecessary load of self
(missed file)

llvm-svn: 54668
2008-08-12 05:40:10 +00:00
Daniel Dunbar 5d71559c01 Drop Sender from GenerateMessageSend*
- Was unused and generated a unnecessary load of self

Update NeXT runtime to get proper object & selector types from
       ASTContext.

llvm-svn: 54667
2008-08-12 05:28:47 +00:00
Daniel Dunbar 6630e10ccc Protocol related tweaks
- Implement type conversion of ObjCQualifiedIdType
 - Wire @protocol(...) to GenerateProtocolRef in ScalarExprEmitter

llvm-svn: 54666
2008-08-12 05:08:18 +00:00
Daniel Dunbar bceb904f91 Add @selector(...) codegen support.
llvm-svn: 54665
2008-08-12 03:55:34 +00:00
Daniel Dunbar cb515c8b0a Add NeXT support for (simple) message sends.
llvm-svn: 54664
2008-08-12 03:39:23 +00:00
Mike Stump b9d50b23a8 Unbreak clang install.
llvm-svn: 54663
2008-08-12 00:32:59 +00:00
Devang Patel c68a0b6244 Use DenseMap to keep track of last users.
Use inversed map for faster queries.

llvm-svn: 54662
2008-08-12 00:26:16 +00:00
Daniel Dunbar 2258aa0f27 Move some ObjC preprocessor definitions into
InitializePredefinedMacros().
 - Also now properly wired to -fobjc-gc, -fnext-runtime.

llvm-svn: 54661
2008-08-12 00:21:46 +00:00
Daniel Dunbar 8b8683f9f6 Add ObjC constant string support for NeXT.
Changed CGObjCRuntime::GenerateConstantString interface to take
       std::string instead of char* and size.

Change ObjC functions which call on GenerateConstantString to bitcast
       result to appropriate type.

llvm-svn: 54659
2008-08-12 00:12:39 +00:00
Dale Johannesen dafdbf77b3 Some fixes for x86-64 JIT. Make it use small code
model, except for external calls; this makes
addressing modes PC-relative.  Incomplete.

The assertion at the top of Emitter::runOnMachineFunction
was obviously bogus (always true) so I removed it.
If someone knows what the correct test should be to cover
all the various targets, please fix.

llvm-svn: 54656
2008-08-11 23:46:25 +00:00
Chris Lattner b56e07e736 add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam!

llvm-svn: 54655
2008-08-11 23:39:47 +00:00
Mike Stump 52f0260582 Fix compilation warning with help from David Chisnall.
llvm-svn: 54654
2008-08-11 23:16:18 +00:00
Chris Lattner 2aa0ff27aa Implement support for simplifying vector comparisons by 0.0 and 1.0 like we
do for scalars.  Patch contributed by Nicolas Capens

This also generalizes the previous xforms to work on long double, now that 
isExactlyValue works for long double.

llvm-svn: 54653
2008-08-11 22:06:05 +00:00
Chris Lattner 7b18e35113 remove obsolete comment.
llvm-svn: 54652
2008-08-11 22:03:07 +00:00
Daniel Dunbar 3ad53483fb Add LangOptions::NeXTRuntime.
- Wired to -fnext-runtime and -fgnu-runtime options.
 - Defaults to GNU, no autoselection for NeXT.

Emit NeXT OBJC_IMAGE_INFO marker.

llvm-svn: 54651
2008-08-11 21:35:06 +00:00
Devang Patel ec9e1a60ad Keep track of analysis usage information for passes. Avoid invoking
getAnalysisUsage() repeatedly.

llvm-svn: 54650
2008-08-11 21:13:39 +00:00
Dan Gohman c82ad79c64 Improve the grep commands for this test to be tolerant of ABI
differences, and to be more specific.

llvm-svn: 54648
2008-08-11 20:10:41 +00:00
Daniel Dunbar 2de4b5e2fc Add test case for -fexceptions
llvm-svn: 54647
2008-08-11 18:40:47 +00:00
Dan Gohman 127bb03b8c Take the FrameOffset into account when computing the alignment
of stack objects. This fixes PR2656.

llvm-svn: 54646
2008-08-11 18:27:03 +00:00
Daniel Dunbar 8d480594cf Change CodeGenModule to only create ObjC runtime for ObjC files
- Changed CodeGenModule::getObjCRuntime to return reference.
 - Added CodeGenModule::hasObjCRuntime predicate.

llvm-svn: 54645
2008-08-11 18:12:00 +00:00
Nate Begeman f69d13b60a Implement ISD::TRAP support on PPC
llvm-svn: 54644
2008-08-11 17:36:31 +00:00
Daniel Dunbar fb3043d627 Add -fexceptions to Driver
- Maps to LangOptions.Exceptions
 - Currently always off, should autoselect based on language.

Update CodeGen to set unwind attribute on functions definitions based
       on LangOptions.Exceptions.
 - Still need to set attributes appropriately on calls.

llvm-svn: 54643
2008-08-11 17:36:14 +00:00
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