Commit Graph

132 Commits

Author SHA1 Message Date
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
Anders Carlsson 290aa8560b Check that the clobber registers are valid.
llvm-svn: 44311
2007-11-25 00:25:21 +00:00
Anders Carlsson 5fa3f348f7 Add tables for GCC register names and aliases. This will be used for inline asm
llvm-svn: 44308
2007-11-24 23:38:12 +00:00
Nate Begeman 847bfbcaf0 Break out bool/true/false support into a LangOption
llvm-svn: 44164
2007-11-15 07:30:50 +00:00
Ted Kremenek e9b83bbd68 Renamed all serialization "Materialize" methods to "Create" to conform with
the new serialization API.

llvm-svn: 44035
2007-11-13 00:25:37 +00:00
Ted Kremenek 739156ab7c 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.

llvm-svn: 43975
2007-11-10 02:11:55 +00:00
Chris Lattner ef067a2828 rename getInstantiationLoc to match the scheme of isPhysicalLoc.
llvm-svn: 43969
2007-11-09 23:59:17 +00:00
Chris Lattner 198b3e085d 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.

llvm-svn: 43968
2007-11-09 23:52:16 +00:00
Ted Kremenek 908f96a2cf Changed method call to reflect updated serialization API.
llvm-svn: 43917
2007-11-09 00:43:55 +00:00
Ted Kremenek da4c6c183d 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.

llvm-svn: 43904
2007-11-08 19:52:41 +00:00
Ted Kremenek f7f7ddfd7e Added registration to deserialization engine of IdentifierInfo* as
IdentifierInfos are deserialized.

llvm-svn: 43741
2007-11-05 22:42:32 +00:00
Ted Kremenek 5e2eb261af 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.

llvm-svn: 43625
2007-11-01 22:25:41 +00:00
Ted Kremenek 08bed095eb Updated a comment to hopefully silence a Lattner warning.
llvm-svn: 43562
2007-10-31 17:53:38 +00:00
Ted Kremenek e26f3c50c5 Updated some comments.
Disabled assignments for ContentCache.
Copy-ctor for ContentCache now has an assertion preventing it to
be copied from an object that already has an allocated buffer.

llvm-svn: 43526
2007-10-30 22:57:35 +00:00
Ted Kremenek c08bca6ae8 Removed SrcMgr::FileInfo and SrcMgr::InfoRec and replaced them with a
single class: ContentCache.  This simplifies the logic in
SourceManager and makes the ownership of MemoryBuffers clearer.

llvm-svn: 43518
2007-10-30 21:08:08 +00:00
Ted Kremenek 4edcb4d676 Implemented serialization of SourceLocation and SourceRange objects.
llvm-svn: 43343
2007-10-25 16:02:43 +00:00
Ted Kremenek 37a3275919 Modified current clients of Bitcode-Object serialization to use the
new split-header file configuration (Serialize.h and Deserialize.h)
now in place in the core LLVM repository.

Removed unneeded SerializeTrait specializations for enums in
TokenKinds.h

llvm-svn: 43306
2007-10-24 19:06:02 +00:00
Ted Kremenek f25f4a3de0 Implemented serialization for IdentifierInfo and IdentifierTable.
Updated serialization test code in the driver to test serialization of
these types.

llvm-svn: 43266
2007-10-23 22:18:37 +00:00
Anton Korobeynikov 002c52ce6e Unbreak mingw32. Maybe there should be something like libClandSystem? :)
llvm-svn: 43029
2007-10-16 09:09:44 +00:00