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
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
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
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
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
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
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
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
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
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
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
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
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