Граф коммитов

84 Коммитов

Автор SHA1 Сообщение Дата
Chris Lattner 49581f4dc3 fix the second half of PR2041: __restrict is ok in c90 mode, even if
restrict isn't.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:46:10 +00:00
Anders Carlsson b41edf90f4 Add more supported constraints.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47270 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:00:25 +00:00
Anders Carlsson a9b20e57d4 Change alignment for doubles to 32 bits which is what X86 has.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47234 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 03:40:02 +00:00
Anders Carlsson ea041758d4 Even more inline asm codegen fixes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-06 00:11:32 +00:00
Anders Carlsson ef3577dc1e Handle the memory clobber.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46780 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-05 23:30:20 +00:00
Chris Lattner 7097d9167d Fix PR1966 by ignoring non-error diagnostics from system headers even if they are
*mapped* onto errors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 09:00:04 +00:00
Chris Lattner f8484542bb the macro start and macro end bits in source location are dead, remove them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-03 08:24:13 +00:00
Chris Lattner 13099923a2 Don't add an extra line to the end of the buffer, it doesn't really exist.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46330 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 23:25:53 +00:00
Lauro Ramos Venancio e0e3abcf9f Fix the __SIZE_TYPE__ definition on x86_32. This fixes the alloca.c (wget 1.10.2) compilation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46196 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-20 04:02:16 +00:00
Ted Kremenek 3d2da3d765 Fix misspelling of "existent".
Do not use std::cerr; use llvm::cerr instead.

Patch provided by Sam Bishop!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45880 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 20:42:05 +00:00
Ted Kremenek 80aeaa2083 Fixed 80-col violation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45845 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 00:18:40 +00:00
Chris Lattner 6298b8c021 remove attribution from makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:02:25 +00:00
Chris Lattner 0bc735ffcf Don't attribute in file headers anymore. See llvmdev for the
discussion of this change.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 19:59:25 +00:00
Ted Kremenek 76edd0e4ae Added storage of the FileID of the the main source file of a translation unit
in SourceManager.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 22:29:55 +00:00
Ted Kremenek bca6d125c7 Refactored inode and device number into FileEntry, and changed the
ADT storing FileEntry's in FileManager from a map to a set.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45184 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 22:29:39 +00:00
Ted Kremenek 82dfaf7c0c When serializing SourceManager, we now serialize out absolute paths
to serialized source files.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45183 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 22:12:19 +00:00
Ted Kremenek da9954400a Added to FileEntry a pointer to the <dev_t,ino_t> pair for the file, and
accessors to FileEntry to query these values.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45171 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 20:45:25 +00:00
Ted Kremenek db9c22917e 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45007 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 18:12:10 +00:00
Chris Lattner f62aea30e2 Fix file header.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44983 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 05:02:35 +00:00
Ted Kremenek 9c728dc4d8 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44957 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 22:39:36 +00:00
Ted Kremenek bbced580c9 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44940 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 18:05:32 +00:00
Ted Kremenek 2eefd8657c 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-".


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44887 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 22:57:35 +00:00
Ted Kremenek 7a9d49fd2b 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44878 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 21:27:55 +00:00
Ted Kremenek 1f2c7d110d Added newline to end of file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-10 18:01:25 +00:00
Anders Carlsson 44fe49c9cc Add getTargetPrefix to TargetInfo, to be used with target specific intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44712 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-08 19:32:57 +00:00
Ted Kremenek 665dd4a40e Removed dependence on including iostream (use llvm/Support/Streams.h instead).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44635 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 22:21:13 +00:00
Ted Kremenek 491420984f Implemented serialization of LangOptions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44624 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 19:06:15 +00:00
Ted Kremenek 1f94100e53 Renamed SourceManager::Read to SourceManager::CreateAndRegister.
Now sourcemanager deserializer automatically self-registers itself with
the deserializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44591 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 00:19:51 +00:00
Ted Kremenek 099b474704 Implemented initial serialization support for SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44590 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05 00:14:18 +00:00
Ted Kremenek 8fbc88e5fa Removed serialization of FileEntry and DirectoryEntry. This objects will
now be lazily recreated upon deserialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44585 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04 22:42:20 +00:00
Ted Kremenek e21272fbdb Implemented serialization of SrcMgr::ContentCache.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44578 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04 19:39:02 +00:00
Ted Kremenek 9551a2cbe5 Implemented serialization of FileEntry and DirectoryEntry.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44573 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-04 18:21:35 +00:00
Ted Kremenek ae3607684c 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44551 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 22:06:55 +00:00
Chris Lattner 182745ae78 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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-02 01:09:57 +00:00
Ted Kremenek 68072a7f22 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44483 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 04:43:17 +00:00
Chris Lattner 0750618b0b 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44473 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 22:53:43 +00:00
Ted Kremenek bdbb285aed Implemented serialization of SelectorTable and Selectors.
Modified serialization of IdentifierTable to self-register itself with
the Deserializer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44471 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 22:46:56 +00:00
Anders Carlsson d04c6e23f2 Add more semantic analysis for inline asm statements.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 04:11:28 +00:00
Anders Carlsson 6fa9086043 Check that the clobber registers are valid.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 00:25:21 +00:00
Anders Carlsson 3346ae6bba Add tables for GCC register names and aliases. This will be used for inline asm
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44308 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 23:38:12 +00:00
Nate Begeman 8aebcb739a Break out bool/true/false support into a LangOption
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 07:30:50 +00:00
Ted Kremenek 0f84c0059c Renamed all serialization "Materialize" methods to "Create" to conform with
the new serialization API.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44035 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 00:25:37 +00:00
Ted Kremenek eae5cd010e Changed the serialization of IdentifierTable to only serialize out entries
that are referenced in the ASTs. This assumes that we serialize out the
decls/stmts first, and use the pointer-tracking logic in the Serializer to
determine if an IdentifierInfo (or its string key) is ever referenced.

This is a significant space optimization for serialized ASTs.

Consider the following program:

void foo(int x,int y) {
  return x > y ? x : y+1;
}

Here are the sizes of the files for the serialized ASTs:

        Full IdentifierTable: 23676 bytes
 Only-referenced Identifiers:   304 bytes.

For this simple program, this is a 77% reduction in the file size of the
serialized ASTs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43975 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-10 02:11:55 +00:00
Chris Lattner 18807d2bfb rename getInstantiationLoc to match the scheme of isPhysicalLoc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43969 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 23:59:17 +00:00
Chris Lattner b7489d8129 change source location to have two bits for macros, tracking
whether the location is the start and/or end of an expansion.
These are currently not set or used by anything.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43968 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 23:52:16 +00:00
Ted Kremenek 3b0eff8a12 Changed method call to reflect updated serialization API.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43917 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-09 00:43:55 +00:00
Ted Kremenek 93a9ab4bdc Rewrote serialization of IdentifierInfo and IdentifierTable to use methods Emit
and Materialize/Read instead of using specializations of SerializeTrait<>. The
resulting code is much cleaner. We are also setting the stage so that only the
parts of the IdentifierTable that are ever referenced within the ASTs are
serialized, and not the whole table.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-08 19:52:41 +00:00
Ted Kremenek c19b998b8b Added registration to deserialization engine of IdentifierInfo* as
IdentifierInfos are deserialized.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43741 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-05 22:42:32 +00:00
Ted Kremenek beb7713c61 Simplified Serialization code for SourceLocation and SourceRange, and
updated it to the recently updated Serialization API.

Changed clients of SourceLocation serialization to call the
appropriate new methods.

Updated Decl serialization code to put new skeleton serialization code
in place that is much better than the older trait-specialization
approach.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 22:25:41 +00:00
Ted Kremenek d1c0eee9aa Updated a comment to hopefully silence a Lattner warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43562 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31 17:53:38 +00:00