Commit Graph

150 Commits

Author SHA1 Message Date
Chris Lattner 1df278669d make float format handling more regular.
llvm-svn: 48052
2008-03-08 08:59:43 +00:00
Chris Lattner 7570e9c518 simplify all the type info accessors in TargeTInfo to return scalars,
which is simpler to use and provide.

llvm-svn: 48051
2008-03-08 08:52:55 +00:00
Chris Lattner c3a669ba63 eliminate the TargetInfoImpl stuff, simplifying the target implementations.
llvm-svn: 48049
2008-03-08 08:24:01 +00:00
Chris Lattner a0c0c35190 eliminate ComputeWCharInfo.
llvm-svn: 48048
2008-03-08 08:07:34 +00:00
Chris Lattner 37e0587839 remove the source location arguments to various target query methods.
llvm-svn: 47954
2008-03-05 18:54:05 +00:00
Chris Lattner 855d024a83 Remove the first layer of support for "portability" warnings. This is
theoretically useful, but not useful in practice.  It adds a bunch of 
complexity, and not much value.  It's best to nuke it.  One big advantage
is that it means the target interfaces will soon lose their SLoc arguments
and target queries can never emit diagnostics anymore (yay).  Removing this
also simplifies some of the core preprocessor which should make it slightly
faster.

Ted, I didn't simplify TripleProcessor, which can now have at most one
triple, and can probably just be removed.  Please poke at it when you have
time.

llvm-svn: 47930
2008-03-05 01:18:20 +00:00
Chris Lattner 43c103ab1b move this into the right file.
llvm-svn: 47925
2008-03-05 00:53:34 +00:00
Ted Kremenek c490bdbdb1 TargetInfo objects now own the TargetInfoImpl objects they refer to.
TargetInfo::AddSecondaryTarget is now private, as it is only used during
object construction.

llvm-svn: 47891
2008-03-04 17:47:18 +00:00
Lauro Ramos Venancio 7143697def A, q and Z are valid LLVM inline asm constraints.
Fix regression in Applications/ClamAV/clamscan.

llvm-svn: 47673
2008-02-27 16:53:36 +00:00
Lauro Ramos Venancio c9fbd7301a Convert x86 target specific inline asm constraints to LLVM.
llvm-svn: 47609
2008-02-26 18:33:46 +00:00
Ted Kremenek d87eef89c8 In FileManager: use full paths to unique files and directories on Windows,
since inodes are bogus abstraction on that platform.

Patch by Argiris Kirtzidis!

llvm-svn: 47535
2008-02-24 03:15:25 +00:00
Gabor Greif 4999168309 Added classes SolarisTargetInfo and
SolarisSparcV8TargetInfo to be able
to handle "sparc-" triple prefixes.

Please be aware that this is a minimal
kludge, that pretty much duplicates
the features of DarwinPowerPCTargetInfo,
and also incorrectly uses stuff from
the PPC namespace.

But in result "make test" now passes
a lot of tests, the notable exceptions
being the objc rewrite tests and
mandel.c.

llvm-svn: 47436
2008-02-21 16:29:08 +00:00
Chris Lattner d2a02fe840 fix the second half of PR2041: __restrict is ok in c90 mode, even if
restrict isn't.

llvm-svn: 47316
2008-02-19 06:46:10 +00:00
Anders Carlsson 196aa53300 Add more supported constraints.
llvm-svn: 47270
2008-02-18 17:00:25 +00:00
Anders Carlsson ffd0992247 Change alignment for doubles to 32 bits which is what X86 has.
llvm-svn: 47234
2008-02-17 03:40:02 +00:00
Anders Carlsson 3ed4aea198 Even more inline asm codegen fixes.
llvm-svn: 46784
2008-02-06 00:11:32 +00:00
Anders Carlsson 487e527fcf Handle the memory clobber.
llvm-svn: 46780
2008-02-05 23:30:20 +00:00
Chris Lattner 3ac9699c44 Fix PR1966 by ignoring non-error diagnostics from system headers even if they are
*mapped* onto errors.

llvm-svn: 46686
2008-02-03 09:00:04 +00:00
Chris Lattner 15e4ad81c3 the macro start and macro end bits in source location are dead, remove them.
llvm-svn: 46685
2008-02-03 08:24:13 +00:00
Chris Lattner 01b322cb02 Don't add an extra line to the end of the buffer, it doesn't really exist.
llvm-svn: 46330
2008-01-24 23:25:53 +00:00
Lauro Ramos Venancio 71a9bb2b48 Fix the __SIZE_TYPE__ definition on x86_32. This fixes the alloca.c (wget 1.10.2) compilation.
llvm-svn: 46196
2008-01-20 04:02:16 +00:00
Ted Kremenek 8d71e25590 Fix misspelling of "existent".
Do not use std::cerr; use llvm::cerr instead.

Patch provided by Sam Bishop!

llvm-svn: 45880
2008-01-11 20:42:05 +00:00
Ted Kremenek d7a7abed62 Fixed 80-col violation.
llvm-svn: 45845
2008-01-11 00:18:40 +00:00
Chris Lattner 5926c0ebfb remove attribution from makefiles.
llvm-svn: 45412
2007-12-29 20:02:25 +00:00
Chris Lattner 5b12ab8c93 Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.

llvm-svn: 45410
2007-12-29 19:59:25 +00:00
Ted Kremenek 9a53275918 Added storage of the FileID of the the main source file of a translation unit
in SourceManager.

llvm-svn: 45225
2007-12-19 22:29:55 +00:00
Ted Kremenek f4c38c9289 Refactored inode and device number into FileEntry, and changed the
ADT storing FileEntry's in FileManager from a map to a set.

llvm-svn: 45184
2007-12-18 22:29:39 +00:00
Ted Kremenek 8c8947fb92 When serializing SourceManager, we now serialize out absolute paths
to serialized source files.

llvm-svn: 45183
2007-12-18 22:12:19 +00:00
Ted Kremenek a51c88ccd8 Added to FileEntry a pointer to the <dev_t,ino_t> pair for the file, and
accessors to FileEntry to query these values.

llvm-svn: 45171
2007-12-18 20:45:25 +00:00
Ted Kremenek 2f4ab7148c Add hack to SourceManager to support missing source files during
deserialization.  Eventually this should be replaced with a lazy-reading
mechanism that only reads source files when they are needed by clients.

llvm-svn: 45007
2007-12-13 18:12:10 +00:00
Chris Lattner 2fe0dd09b3 Fix file header.
llvm-svn: 44983
2007-12-13 05:02:35 +00:00
Ted Kremenek 1daa3cfbae TargetInfo no longer includes a reference to SourceManager.
Moved all clients of Diagnostics to use FullSourceLoc instead of SourceLocation.
Added many utility methods to FullSourceLoc to provide shorthand for:

    FullLoc.getManager().someMethod(FullLoc.getLocation());
    
instead we have:

    FullLoc.someMethod();
    
Modified TextDiagnostics (and related classes) to use this short-hand.

llvm-svn: 44957
2007-12-12 22:39:36 +00:00
Ted Kremenek 6f6ff37b04 Moved construction of TargetInfo objects out of the Driver
and into the "Basic" library. TargetInfo objects are now
constructed from triples by calling the static method
TargetInfo::CreateTargetInfo.

llvm-svn: 44940
2007-12-12 18:05:32 +00:00
Ted Kremenek 89fbadd3be Modified the internals of Diagnostic and DiagnosticClient to use
SourceManager*'s instead of SourceManager&'s. This allows the client specify a
NULL SourceManager when using a default constructed SourceLocation. Thus the
SourceManager can be NULL when the SourceLocation's isValid() == false.

The interface to most clients of Diagnostic remains the same.
Diagnostic::Report() is overload to either accept a SourceLocation and a
SourceManager&, or neither. Thus clients that do not have a SourceManager
cannot specify a SourceLocation.

Modified TextDiagnostics* to use this new interface.
Modified the driver to not passed in SourceManager when warning about "-I-".

llvm-svn: 44887
2007-12-11 22:57:35 +00:00
Ted Kremenek d4e5fbacab Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. Now
SourceManager is passed by reference, allowing the SourceManager to be
associated with a specific translation unit, and not the entire execution
of the driver.

Modified all users of Diagnostics to comply with this new interface.

Integrated SourceManager as a member variable of TargetInfo. TargetInfo will
eventually be associated with a single translation unit (just like
SourceManager).

Made the SourceManager reference in ASTContext private. Provided accessor
getSourceManager() for clients to use instead. Modified clients to comply with
new interface.

llvm-svn: 44878
2007-12-11 21:27:55 +00:00
Ted Kremenek 256a15d532 Added newline to end of file.
llvm-svn: 44797
2007-12-10 18:01:25 +00:00
Anders Carlsson 050f494f66 Add getTargetPrefix to TargetInfo, to be used with target specific intrinsics.
llvm-svn: 44712
2007-12-08 19:32:57 +00:00
Ted Kremenek cdcf6dcbcb Removed dependence on including iostream (use llvm/Support/Streams.h instead).
llvm-svn: 44635
2007-12-05 22:21:13 +00:00
Ted Kremenek ae492c4f0c Implemented serialization of LangOptions.
llvm-svn: 44624
2007-12-05 19:06:15 +00:00
Ted Kremenek e634142388 Renamed SourceManager::Read to SourceManager::CreateAndRegister.
Now sourcemanager deserializer automatically self-registers itself with
the deserializer.

llvm-svn: 44591
2007-12-05 00:19:51 +00:00
Ted Kremenek 57f4c00241 Implemented initial serialization support for SourceManager.
llvm-svn: 44590
2007-12-05 00:14:18 +00:00
Ted Kremenek 6ca076cb7a Removed serialization of FileEntry and DirectoryEntry. This objects will
now be lazily recreated upon deserialization.

llvm-svn: 44585
2007-12-04 22:42:20 +00:00
Ted Kremenek c638952f59 Implemented serialization of SrcMgr::ContentCache.
llvm-svn: 44578
2007-12-04 19:39:02 +00:00
Ted Kremenek f7260b191c Implemented serialization of FileEntry and DirectoryEntry.
llvm-svn: 44573
2007-12-04 18:21:35 +00:00
Ted Kremenek b061554caa Implemented initial support for "-triple" option to the clang driver. This
replaces the functionality previously provided by just "-arch" (which is still
supported but has different semantics).

The new behavior is as follows:

(1) If the user does not specify -triple:

   (a) If no -arch options are specified, the target triple used is the host
   triple (in llvm/Config/config.h).
   
   (b) If one or more -arch's are specified (and no -triple), then there is
       one triple for each -arch, where the specified arch is substituted
       for the arch in the host triple.  Example:
          host triple = i686-apple-darwin9
          command: clang  -arch ppc -arch ppc64 ...
          triples used: ppc-apple-darwin9  ppc64-apple-darwin9
          
(2) The user does specify a -triple (only one allowed):

  (a) If no -arch options are specified, the triple specified by -triple
      is used.  E.g clang -triple i686-apple-darwin9
      
  (b) If one or more -arch options are specified, then the triple specified
      by -triple is used as the primary target, and the arch's specified
      by -arch are used to create secondary targets.  For example:
      
      clang -triple i686-apple-darwin9 -arch ppc -arch ppc64
      
      has the following targets:
         i686-apple-darwin9  (primary target)
         ppc-apple-darwin9
         ppc64-apple-darwin9


Other changes related to the changes to the driver:

- TargetInfoImpl now includes the triple string.

- TargetInfo::getTargetTriple returns the triple for its primary target.

- test case test/Parser/portability.c has been updated because "-arch linux" is
  no longer valid ("linux" is an OS, not an arch); instead we use a bogus
  architecture "bogusW16W16" where WCharWidth=16 and WCharAlign=16.

llvm-svn: 44551
2007-12-03 22:06:55 +00:00
Chris Lattner e6535cfdd2 add support for custom client-specific diagnostics. As a testcase, make the
rewriter emit this error if it fails to rewrite an @encode:

t.m:17:9: error: rewriter could not replace sub-expression due to macros
    c = ENC(char *)[2] + 4;
        ^~~~~~~~~~~

... where ENC is: #define ENC @encode

llvm-svn: 44498
2007-12-02 01:09:57 +00:00
Ted Kremenek 3e14c152c6 Fixed bug in the serialization of SelectorTable where we did not register the
pointer of MultiKeywordSelectors.

Added optimization to the serialization of SelectorTable where we only serialize
out MultiKeywordSelectors that are ever referenced by an object other than the
SelectorTable.

llvm-svn: 44483
2007-12-01 04:43:17 +00:00
Chris Lattner 4431a1b19b start partitioning the diagnostics into two classes: those
that are builtin and those that are aren't.  This is a bunch
of API refactoring that will make this possible, but there is
no functionality change yet.

llvm-svn: 44473
2007-11-30 22:53:43 +00:00
Ted Kremenek c9bcda94ae Implemented serialization of SelectorTable and Selectors.
Modified serialization of IdentifierTable to self-register itself with
the Deserializer.

llvm-svn: 44471
2007-11-30 22:46:56 +00:00
Anders Carlsson f511f646a4 Add more semantic analysis for inline asm statements.
llvm-svn: 44349
2007-11-27 04:11:28 +00:00