Commit Graph

2245 Commits

Author SHA1 Message Date
Eli Friedman 873f65afe8 First cut at OS detection, taking advantage of the new generic targets.
This approach allows adding OS-specific targets/defines/etc. without 
completely breaking unknown subtargets.  No new subtargets yet, although 
I plan to add x86-Linux soon.  Others can add targets that they use as 
needed; adding a new subtarget takes very little code.

Also does some fixups for description strings; a lot of them were 
unspecified.  I think all the ones I added are correct, but 
they're unverified; corrections are welcome.

llvm-svn: 55091
2008-08-21 00:13:15 +00:00
Eli Friedman b9e5bed4dd Class reorg for PPC; shouldn't be any visible changes unless I messed
up somehow.

This concludes the series of reorg patches for the target 
implementations.

llvm-svn: 55086
2008-08-20 23:11:40 +00:00
Eli Friedman f05b7728b3 Class reorg for ARM. Shouldn't be any visible changes.
llvm-svn: 55042
2008-08-20 07:44:10 +00:00
Eli Friedman da8f5a9bd8 Class hierarchy reorg for Sparc architecture. While I was there, I
cleaned it up a bit, including fixing the definition of va_list; this
shouldn't break anything, but anyone using Sparc should watch for 
regressions.

llvm-svn: 55041
2008-08-20 07:28:14 +00:00
Eli Friedman 3fd920afce Reorganize the class hierarchy for x86 targets; shouldn't have any
visible effects, but this will significantly reduce the amount of 
boilerplate code necessary to add subtargets.

If this looks okay, I'll do the rest of the processors (PPC, Sparc, ARM) 
soon.

llvm-svn: 55036
2008-08-20 02:34:37 +00:00
Chris Lattner 22361bf422 Fix PR2627, support for Q constraint.
llvm-svn: 54943
2008-08-18 20:05:00 +00:00
Sanjiv Gupta 14f18f3f91 Allow targets to override description string.
llvm-svn: 54914
2008-08-18 10:05:22 +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 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
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
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
Ted Kremenek 31691ae862 Fix --html-diags in driver by delaying the construction of an HTMLDiagnosticClient until after we have created the Preprocessor object.
llvm-svn: 54472
2008-08-07 17:49:57 +00:00
Daniel Dunbar 81f7f2904c Add EXTWARN Diagnostic class.
- Like EXTENSION but always generates a warning (even without
   -pedantic).
 - Updated ptr -> int, int -> ptr, and incompatible cast warnings to
   be EXTWARN.
 - Other EXTENSION level diagnostics should be audited for upgrade.
 - Updated several test cases to fix code which produced unanticipated
   warnings.

llvm-svn: 54335
2008-08-05 00:07:51 +00:00
Anders Carlsson 35a56368be Always define __SIZE_TYPE__ as long unsigned int.
llvm-svn: 53922
2008-07-22 17:16:13 +00:00
Nuno Lopes d28ccad6fc add x86 EDI register alias
llvm-svn: 53170
2008-07-07 12:18:07 +00:00
Nuno Lopes 3da38fd145 move the linux predefined macro definition to the TargetInfo, where it really belongs
llvm-svn: 53149
2008-07-05 19:32:25 +00:00
Eli Friedman 67b827900e Make the width and alignment for long double consistent with the
hardcoded data layout in getTargetDescription.  Hopefully fixes a test 
failure.

Of course, this should be fixed properly, but that's a bigger fix.

llvm-svn: 51948
2008-06-04 17:01:45 +00:00
Chris Lattner 8c80070de2 Implement support for -w, which silences all warnings. PR2384.
llvm-svn: 51683
2008-05-29 15:36:45 +00:00
Eli Friedman b2bef7c1c2 Make sure to define __sparc__ on Solaris; this should "fix"
test/Codegen/mandel.c on Solaris. :-)

llvm-svn: 51554
2008-05-25 05:26:09 +00:00
Eli Friedman 7cef49e2d8 Missed an include.
llvm-svn: 51321
2008-05-20 14:27:34 +00:00
Eli Friedman 1ca6476ac5 Minor correction for PPC targets.
llvm-svn: 51320
2008-05-20 14:25:01 +00:00
Eli Friedman b53660698a Some small changes to make the target info a bit more accurate.
llvm-svn: 51319
2008-05-20 14:21:01 +00:00
Chris Lattner ba7a6c14ed set long/pointers to 64-bits on ppc64/x86-64
llvm-svn: 50891
2008-05-09 06:17:04 +00:00
Chris Lattner 5e2ef0c18a parameterize pointer size/align better without doing virtual method calls in normal case.
llvm-svn: 50890
2008-05-09 06:08:39 +00:00
Chris Lattner 5a9aaaf687 parameterize long long.
llvm-svn: 50887
2008-05-09 05:50:02 +00:00
Chris Lattner 5dc7ff1cf3 correctly parameterize long, patch by Nate.
llvm-svn: 50886
2008-05-09 05:47:41 +00:00
Chris Lattner b781dc79aa Add basic support for the pic-* target triples and add support for
targets that do not support recursion (and thus codegen stack variables
as globals).

Patch contributed by Alireza Moshtaghi!

llvm-svn: 50844
2008-05-08 05:58:21 +00:00
Ted Kremenek d796c18d7b Add -fobjc-gc and -fobjc-gc-only options to the driver.
Add corresponding enum in LangOptions.

llvm-svn: 50387
2008-04-29 04:37:03 +00:00
Ted Kremenek b44485b835 Have ValidateOutputConstraint return false instead of firing an assertion
when processing a constraint we don't understand.  This allows the frontend
to gracefully fail.

llvm-svn: 50213
2008-04-24 16:36:38 +00:00
Nate Begeman 2908fa0715 Add some basic ARM asm constraints
llvm-svn: 50085
2008-04-22 05:03:19 +00:00
Chris Lattner 0dcd9aa8fd Fix pasto, thanks to Anders for pointing this out.
llvm-svn: 50055
2008-04-21 20:19:54 +00:00
Chris Lattner 17df24e736 add arm support
llvm-svn: 50049
2008-04-21 18:56:49 +00:00
Nate Begeman 65bea23674 Tabs -> spaces
llvm-svn: 49909
2008-04-18 17:17:24 +00:00
Nate Begeman c00bed3871 Initialize default double width and alignment
llvm-svn: 49899
2008-04-18 05:49:49 +00:00
Ted Kremenek f6aad13242 Fix regression in Diagnostic that caused it to not register the number
of errors.

llvm-svn: 49686
2008-04-14 21:21:38 +00:00
Ted Kremenek 17acadebb4 Added "getCanonicalID()", "isFromSameFile", and "isFromMainFile" to compare
the files of different SourceLocations.  These methods correctly handle the
case where a file may have multiple FileIDs due to it being large enough
to be spread across several chunks.

llvm-svn: 49682
2008-04-14 21:04:18 +00:00
Ted Kremenek 193f185902 Only increment the number of diagnostics when the DiagnosticClient used
is the one attached to the Diagnostic object.

llvm-svn: 49677
2008-04-14 19:56:12 +00:00
Chris Lattner c4f02b6bed add a missing #include
llvm-svn: 49256
2008-04-06 04:02:29 +00:00
Ted Kremenek 406192d163 Added "getLogicalLineNumber" and "getLogicalColumnNumber" to FullSourceLoc.
llvm-svn: 49177
2008-04-03 17:55:15 +00:00
Chris Lattner 595cf9ff81 Update to match simplified llvm MemoryBuffer interfaces for files.
llvm-svn: 49042
2008-04-01 18:04:30 +00:00
Chris Lattner 4f6002c79a prune dead #includes
llvm-svn: 49033
2008-04-01 06:08:11 +00:00
Chris Lattner 47448288ee MemoryBuffer::getFile got smarter, obviating the need for readfilefast.
The new MemoryBuffer doesn't "leak" file descriptors and handles the
small file case efficiently.

llvm-svn: 49032
2008-04-01 06:06:37 +00:00
Steve Naroff 93eea6e1a0 Hack ReadFileFast() to raise the threshold of memory mapped files (from 4->12 pages).
This is a temporary solution to avoid running out of file descriptors (which defaults to 256).

Need to benchmark to understand the speed benefit. If the benefit is small, the simple solution is to avoid memory mapping files. If the benefit is significant, more thought is necessary.

llvm-svn: 48991
2008-03-31 18:44:59 +00:00
Ted Kremenek 491dc9f4a0 Added variation of the "Report" method in the class Diagnostic that takes
an optional DiagnosticClient argument that differs from the client stored
internally in the Diagnostic object.

llvm-svn: 48986
2008-03-31 18:23:15 +00:00
Chris Lattner 7a51313d8a Make a major restructuring of the clang tree: introduce a top-level
lib dir and move all the libraries into it.  This follows the main
llvm tree, and allows the libraries to be built in parallel.  The
top level now enforces that all the libs are built before Driver,
but we don't care what order the libs are built in.  This speeds
up parallel builds, particularly incremental ones.

llvm-svn: 48402
2008-03-15 23:59:48 +00:00