aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
AgeCommit message (Collapse)Author
2007-12-17Unbreak -v with framework paths. Patch by Shantonu Sen.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45102 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17as it turns out, frameworks and headermaps are orthogonal. Make this so inChris Lattner
the internal representation. This also fixes a bug where -I foo -F foo would not search foo as both a normal and framework include dir. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45092 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17add a portability fixme.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45091 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17teach RemoveDuplicates about header maps.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45090 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17Step #1 in adding headermap support to clang.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45089 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17rearrange some code and make it more efficient.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15swtich to smallptrset, which is more efficient than std::set.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15make clang -v output more similar to gcc's -v output.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45064 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-15simplify the interfaces to ProcessInputFile and InitializePreprocessorChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45060 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Add check in the driver to see if a serialized AST file has been successfullyTed Kremenek
deserialized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45006 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Changed -serialize-ast to not create a temporary directory, but insteadTed Kremenek
create a .ast file in the current working directory. This mirrors the behavior of the -c option for gcc. Later we should add the ability to write the serialized file anywhere. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45004 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13Implemented -serialize-ast option for the driver. This is not really testedTed Kremenek
and is a work in progress. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44967 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12Implemented prototype mode where the driver can operate on serialized ASTsTed Kremenek
instead of source files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44962 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12TargetInfo no longer includes a reference to SourceManager.Ted Kremenek
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-12Moved construction of TargetInfo objects out of the DriverTed Kremenek
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-12Simplify some code, don't force the triple to a darwin triple if non-darwin.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44911 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Moved creation of SourceManager, HeaderSearch, TargetInfo, and LangOptionsTed Kremenek
into the loop that processes input files. These will soon become translation unit specific (with the exception of LangOptions). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11Modified the internals of Diagnostic and DiagnosticClient to useTed Kremenek
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-11Mega-patch: ripped SourceManager out of Diagnostic/DiagnosticClient. NowTed Kremenek
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-09avoid ///usr/include/foo.h, patch by Sean MiddleditchChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44731 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Subdivided the function InitializeBaseLanguage into InitializeBaseLanguage,Ted Kremenek
GetLanguage, and InitializeLangOptions. The goal is to break up this logic into atomic units of functionality that can later be refactored into better driver logic that is capable of handling a mixture of source files of different languages. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44642 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Avoid passing Diags into InitializeIncludePaths.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44639 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Modified: CreateTargetInfo(). Now takes Diagnostic* instead of Diagnostic&.Ted Kremenek
Modified: ctor of SerializationTest: Now takes LangOptions argument. We will eventually serialize this as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44630 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Moved creation of ASTConsumers that can operate on both freshly-parsed andTed Kremenek
deserialized ASTs into the function CreateASTConsumer(). This function is called by ProcessInputFile, and soon the logic that processes deserialized ASTs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44618 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-05Added serialization support of SourceManager to the clang driver.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44592 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Fixed order of operands to strstr call.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44561 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03For target processing, on non-Darwin systems instead of using the host triple,Ted Kremenek
we default to "i386-apple-darwin". This is an interim solution. Removed processing of "linux" triples from Targets.cpp, since we don't have any sensical Linux target support (yet). Cleaned up error processing of targets; added better diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44560 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Implemented serialization of TargetInfo.Ted Kremenek
SerializationTest (subclass of ASTConsumer) now takes Diagnostics& in its ctor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44555 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Few cleanups to patch 44551:Ted Kremenek
http://llvm.org/viewvc/llvm-project?view=rev&revision=44551 Removed debugging fprintfs for printing targets. Implemented error messages when processing invalid targets. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44552 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03Implemented initial support for "-triple" option to the clang driver. ThisTed Kremenek
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-11-30pass diagnostics into the rewrite test client.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44468 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30Support lax vector conversions.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28Implement support for -fwritable-strings and make the code generatorChris Lattner
merge string literals when it is not provided. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44394 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15Break out bool/true/false support into a LangOptionNate Begeman
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44164 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13Added -Wfloat-equal option to the driver. This makes warnings aboutTed Kremenek
floating point comparisons using == or != an opt-in rather than a default warning. Updated test case to use -Wfloat-equal. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-03Fix ownership model of ParseAST to allow the dtor of Chris Lattner
ASTConsumer to process the AST before it is destroyed. This allows elimination of HandleObjcMetaDataEmission. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43659 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-31Implement ObjC built-in types in MinimalAction.Steve Naroff
This fixes the recent regression with selector-1.m and -parse-noop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43575 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-17wean the diagnostics machinery off the preprocessor.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43085 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-16Started work on clang object serialization. ExperimentalTed Kremenek
serialization logic as well as driver code is now in Driver/SerializationTest.cpp. The status of this code is that it should be used by no clients. Added --test-pickling option to driver to run the serialization code. Modified IdentifierInfo and IdentifierTable to have friend classes that permit object serialization. Such friendship may not be needed in the final design. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@43052 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-15Add support for Pascal strings.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42974 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11add scafolding to play around with and bring up the code rewriter.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42855 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11rename -parse-ast-view to -ast-viewChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-11rename -parse-ast-print to -ast-printChris Lattner
rename -parse-ast-dump to -ast-dump remove -parse-ast, which is redundant with -fsyntax-only git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09Make a significant change to invert the control flow handlingChris Lattner
predefined macros. Previously, these were handled by the driver, now they are handled by the preprocessor. Some fallout of this: 1. Instead of preprocessing two buffers (the predefines, then the main source file) we now start preprocessing the main source file and inject the predefines as a "psuedo #include" from the main source file. 2. #1 allows us to nuke the Lexer::IsMainFile flag and simplify Preprocessor::isInPrimaryFile. 3. The driver doesn't have to know about standard #defines, the preprocessor knows, which is nice for people wanting to define their own drivers. 4. This allows us to put normal tokens in the predefine buffer, for example a definition for __builtin_va_list that is target-specific, and a typedef for id in objc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42818 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-09convert driver over to use Token::is/isNot APIs. fwew, all done.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42800 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-07Rename ASTStreamers.* -> ASTConsumers.*Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06speed up clang startup another 28% by avoiding std::vector<std::string> Chris Lattner
for holding builtin target-specific macros. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42689 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26Removed option "-parse-ast-check" from clang driver. This is now implementedTed Kremenek
using "-parse-ast -verify". Updated all test cases (using a sed script) that invoked -parse-ast-check to now use -parse-ast -verify. Fixed a bug where using "-verify" instead of "-parse-ast-check" would not correctly create the DiagClient needed to accumulate diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42365 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26Moved "VerifyDiagnostics" variable declaration to right below ProgActionTed Kremenek
declaration. This is because this option is logically tightly connected to the actions defined in ProgAction. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42364 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-26Refactored driver so that any action that is implemented using anTed Kremenek
ASTConsumer can also be verified using the diagnostics checker. From the command line, users may activate diagnostic checking using the "-verify" option. For example, "clang -verify -warn-dead-stores" checks if the warnings flagged by the dead store checker match those in the comments. Note that we still have the option "-parse-ast-check" for backwards comptability with existing test cases. This option is now equivalent to "-parse-ast -verify". git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42362 91177308-0d34-0410-b5e6-96231b3b80d8