aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
AgeCommit message (Collapse)Author
2009-02-02Use the updated CommandLine api for -fno-blocks.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63563 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Fix typo noticed by Chris.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Turn on -flax-vector-conversions by default, issue a warning whenever one is ↵Anders Carlsson
done. Add a -fnolax-vector-conversions option. Fixes PR2862. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30wire up -fno-show-source-location option, patch by Alexei Svitkine!Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30Add -fno-blocks support. This fixes block-no-block-def.c.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63385 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29Fix name of -x option for C preprocessed input; it should beDaniel Dunbar
cpp-output, not c-cpp-output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63345 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29next round of diagnostics cleanups, moving some Chris Lattner
diags around, eliminating #defines, etc. Patch by Anders Johnsen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63318 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29Fix -Wimplicit-function-declaration, which required some refactoring andChris Lattner
changes in various diagnostics code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63282 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29Fix a wart that existed from before we had EXTWARN.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-29move library-specific diagnostic headers into library private dirs. ReduceChris Lattner
redundant #includes. Patch by Anders Johnsen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28Enhance PTHManager::Create() to take an optional Diagnostic* argument that ↵Ted Kremenek
can be used to report issues such as a missing PTH file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28Patch by Alexei Svitkine: Refactor Sema::ParseAST API to allow clients to ↵Ted Kremenek
pass as an argument a TranslationUnit object whose contents live beyond the call to ParseAST. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28Add a preliminary version number.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63168 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-27Split the single monolithic DiagnosticKinds.def file into oneChris Lattner
.def file for each library. This means that adding a diagnostic to sema doesn't require all the other libraries to be rebuilt. Patch by Anders Johnsen! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63111 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23Added clang option '--analyzer-display-progress' to indicate that the ↵Ted Kremenek
analyzer should output 'ANALYZE:' messages to display its progress on a source file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-23When using -analyzer-output-plist always output a plist file even if it ↵Ted Kremenek
contains no error reports. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22Use NonFragileABI as name of new Next abi. More comments Fariborz Jahanian
for the new meta-data. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62806 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-22Adjust to api change.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62785 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21Refactoring ObjC Next's runtime classes in preparation forFariborz Jahanian
the new ObjC's abi. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-21Don't turn off blocks when compiling Obj-C codeAnders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62701 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20Add -analyze action to run static analyzer, instead of inferring fromDaniel Dunbar
individual checker options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62634 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17add a simplified lexer ctor that sets up the lexer to raw-lex anChris Lattner
entire file. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17this massive patch introduces a simple new abstraction: it makesChris Lattner
"FileID" a concept that is now enforced by the compiler's type checker instead of yet-another-random-unsigned floating around. This is an important distinction from the "FileID" currently tracked by SourceLocation. *That* FileID may refer to the start of a file or to a chunk within it. The new FileID *only* refers to the file (and its #include stack and eventually #line data), it cannot refer to a chunk. FileID is a completely opaque datatype to all clients, only SourceManager is allowed to poke and prod it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15IdentifierInfo:Ted Kremenek
- IdentifierInfo can now (optionally) have its string data not be co-located with itself. This is for use with PTH. This aspect is a little gross, as getName() and getLength() now make assumptions about a possible alternate representation of IdentifierInfo. Perhaps we should make IdentifierInfo have virtual methods? IdentifierTable: - Added class "IdentifierInfoLookup" that can be used by IdentifierTable to perform "string -> IdentifierInfo" lookups using an auxilliary data structure. This is used by PTH. - Perform tests show that IdentifierTable::get() does not slow down because of the extra check for the IdentiferInfoLookup object (the regular StringMap lookup does enough work to mitigate the impact of an extra null pointer check). - The upshot is that now that some IdentifierInfo objects might be owned by the IdentiferInfoLookup object. This should be reviewed. PTH: - Modified PTHManager::GetIdentifierInfo to *not* insert entries in IdentifierTable's string map, and instead create IdentifierInfo objects on the fly when mapping from persistent IDs to IdentifierInfos. This saves a ton of work with string copies, hashing, and StringMap lookup and resizing. This change was motivated because when processing source files in the PTH cache we don't need to do any string -> IdentifierInfo lookups. - PTHManager now subclasses IdentifierInfoLookup, allowing clients of IdentifierTable to transparently use IdentifierInfo objects managed by the PTH file. PTHManager resolves "string -> IdentifierInfo" queries by doing a binary search over a sorted table of identifier strings in the PTH file (the exact algorithm we use can be changed as needed). These changes lead to the following performance changes when using PTH on Cocoa.h: - fsyntax-only: 10% performance improvement - Eonly: 30% performance improvement git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62273 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-14Fix typo and spelling of -Wunused-macros.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62239 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13Add an initial framework of a DeclContextPrinter. It can print DeclContext andZhongxing Xu
its Decls in indented format. An Example: $ cat t.cpp class A { int a; void f(); }; void A::f() { a = 3; } $ clang -print-decl-contexts t.cpp [translation unit] 0x9754d7c <typedef> __builtin_va_list [class] A 0x9753310 <class> A 0x975ce20 <field> a <c++ method> f <c++ ctor> A <c++ ctor> A <c++ method> operator= <c++ dtor> ~A [c++ method] f [[0x9753310]] Some comments: '<>' indicates a declaration, '[]' indicates a definition, '[[ ]]' displays the semantic DeclContext which is different from the lexical DeclContext. The symbols printed can definitely be changed in the future. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62136 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12Implement support for anonymous structs and unions in C. Both C andDouglas Gregor
C++ handle anonymous structs/unions in the same way. Addresses several bugs: <rdar://problem/6259534> <rdar://problem/6481130> <rdar://problem/6483159> The test case in PR clang/1750 now passes with -fsyntax-only, but CodeGen for inline assembler still fails. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62112 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09Always print out SourceManager stats with 'Stats' is true. This revealed ↵Ted Kremenek
that PTH always pulls in the source pages with -fsyntax-only (investigating further). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61996 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09Enable support for '-x objective-c++-header'.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08Place warning about 'readonly' property attributes whichFariborz Jahanian
are related to setter syntax under -Wreadonly-setter-attrs to prevent warnings in projects built with gcc. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-06Remove redunant (and incorrect) call to SourceManager::PrintStats(). This ↵Ted Kremenek
would be called after a SourceManager was 'cleared', so it printed bogus results. Moreover, these stats are already printed earlier in the code path. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61825 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-12Force i[0-9]86 to i386 when using LLVM_HOSTTRIPLE.Daniel Dunbar
Only use major part of OS version when on darwin and modifying OS part of target triple. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60957 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-05-std=c99 defaults blocks to off even on darwin, but -fblocks overridesChris Lattner
even it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60568 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04instead of forcing blocks on by default, make them default to off, but letChris Lattner
specific targets default them to on. Default blocks to on on 10.6 and later. Add a -fblocks option that allows the user to override the target's default. Use -fblocks in the various testcases that use blocks. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60563 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-04replace useNeXTRuntimeAsDefault with a generic hook that allows targetsChris Lattner
to specify their default language options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60561 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-02Add "-token-cache" option for using pretokenized cache files.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60440 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01Add LangOptions marker for assembler-with-cpp mode and use to defineDaniel Dunbar
__ASSEMBLER__ properly. Patch from Roman Divacky (with minor formatting changes). Thanks! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60362 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-01Enable blocks in C++Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60361 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26Implement implicit conversions for Objective-C specific types, e.g., Douglas Gregor
converting a pointer to one Objective-C interface into a pointer to another Objective-C interface, and conversions with 'id'. The semantics seems to match GCC, although they seem somewhat ad hoc. Fixed a few cases where we assumed the C++ definition of isObjectType, but were getting the C definition, causing failures in trouble with conversions to void pointers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60130 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-26Add plugin loading for clang. This will be used to load alternative ↵Zhongxing Xu
constraint manager for static analysis. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-22reverting this because it breaks some blocks cases, I'll send doug a testcaseTed Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21Don't turn off blocks in C++Douglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59827 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19switch TextDiagnosticPrinter to raw_ostream.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59597 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18remove a helper method with only one call site.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59495 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11Move backend output out of destructor.Daniel Dunbar
Don't free AST consumer when --disable-free is set. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03Hook up the Plist diagnostic client to the driver.Ted Kremenek
Fix Plist output. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58652 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03Rename 'HTMLDiagnostics.h' to 'PathDiagnosticClients.h'Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31Turn off module verification in Release-Asserts builds.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58500 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31"One" line fix for -parse-noop failure, "id" and several other thingsDaniel Dunbar
were being treated as type names for non-Objective-C files. - Other lines are just because MinimalAction didn't have access to the LangOptions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58498 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29Improve llvm-gcc compatibility, -Os implies -O2 (sortof).Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@58374 91177308-0d34-0410-b5e6-96231b3b80d8