aboutsummaryrefslogtreecommitdiff
path: root/Driver
AgeCommit message (Collapse)Author
2009-03-24Move <root>/Driver into <root>/tools/clang-cc.Daniel Dunbar
Again, I tried to update cmake but it is untested. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67605 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-24Rename clang to clang-cc.Daniel Dunbar
Tests and drivers updated, still need to shuffle dirs. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23if the driver decides to run clang on a .s file, treat it as a .S file.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67532 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-22PTHManager::Create():Ted Kremenek
- Make the Diagnostic::Level for PTH errors to be specified by the caller clang (driver): - Set the PTHManager diagnostic level to "Diagnostic::Error" for -include-pth (a hard error) and Diagnostic::Warning for -token-cache (we can still proceed). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21Frontend: Handle empty input on stdin.Daniel Dunbar
- PR3854. I think it makes more sense to change MemoryBuffer::getSTDIN (return 0 should indicate error, not empty), but it is documented to return 0 for empty inputs, and some other code appears to rely on this. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67449 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20ccc/Driver/clang-fe: Accept -fbuiltin, and forward -f[no-]builtin to clang.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20InitListDesignations hasn't been used (ever). Eliminate it, andDouglas Gregor
simplify the parsing and action interface for designated initializers. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20fix test/Preprocessor/macro_paste_mscomment.c.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67403 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20add a new LangOptions::GNUMode bit to distinguish between GNU99 and C99 etc.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67374 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20Preserve ordering between -include and -include-pth.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67354 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20Implement "-include-pth" in low-level driver. This allows a PTH file to be usedTed Kremenek
similar to a regular file passed to "-include". When -include-pth is used, the low-level driver queries the PTH file for the name of the original source file that generated the PTH file and implicitly adds a '#include' for that file in the Predefines buffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Store the name of the original file used to generate the PTH file in the PTHTed Kremenek
file itself. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67340 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Per Daniel's suggestion, remove default case from switch statement to makeTed Kremenek
uncaught language cases a compile warning instead of a runtime error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67325 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Allow notes to be printed following a fatal error, then suppress anyDouglas Gregor
diagnostics following those notes. Make exceeding the template instantiation depth a fatal error. Thanks to Daniel for pointing out the problem! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67320 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19Support langkind_cxx_pch when determining the language dialect.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67315 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16Build system changes to use TableGen to generate the variousDouglas Gregor
diagnostics. This builds on the patch that Sebastian committed and then revert. Major differences are: - We don't remove or use the current ".def" files. Instead, for now, we just make sure that we're building the ".inc" files. - Fixed CMake makefiles to run TableGen and build the ".inc" files when needed. Tested with both the Xcode and Makefile generators provided by CMake, so it should be solid. - Fixed normal makefiles to handle out-of-source builds that involve the ".inc" files. I'll send a separate patch to the list with Sebastian's changes that eliminate the use of the .def files. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67058 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-16simplify this code by reading the decision from LangOptions instead Chris Lattner
of recomputing the property from command line options. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67047 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15Handle static_asserts when instantiating structs.Anders Carlsson
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67031 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15Convert a bunch of actions to smart pointers, and also bring ↵Sebastian Redl
PrintParserCallbacks a bit more in line with reality. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67029 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-15Don't accept '$' in identifiers in assembler-with-cpp mode.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67013 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14Don't run simplify lib calls with -ffreestanding (fix for alreadyDaniel Dunbar
failing test case). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13wire up a new -fno-builtin option, make it control things like simplifylibcalls,Chris Lattner
etc and make freestanding imply it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66972 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13Implement template instantiation for several more kinds of expressions:Douglas Gregor
- C++ function casts, e.g., T(foo) - sizeof(), alignof() More importantly, this allows us to verify that we're performing overload resolution during template instantiation, with argument-dependent lookup and the "cached" results of name lookup from the template definition. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13introduce a new -fheinous-gnu-extensions flag that enables reallyChris Lattner
really horrible extensions that are disabled by default but that can be accepted by -fheinous-gnu-extensions (but which always emit a warning when enabled). As our first instance of this, implement PR3788/PR3794, which allows non-lvalues in inline asms in contexts where lvalues are required. bleh. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13implement a new -fprint-source-range-info option, whichChris Lattner
defaults to off. When enabled, it emits range info along with the file/line/col information for a diagnostic. This allows tools that textually parse the output of clang to know where the ranges are, even if they span multiple lines. For example, with: $ clang exprs.c -fprint-source-range-info We now produce: exprs.c:21:11:{21:12-21:13}: warning: use of unary operator that may be intended as compound assignment (+=) var =+ 5; // expected-warning {{use of unary operator that may be intended as compound assignment (+=)}} ^~ exprs.c:22:11:{22:12-22:13}: warning: use of unary operator that may be intended as compound assignment (-=) var =- 5; // expected-warning {{use of unary operator that may be intended as compound assignment (-=)}} ^~ exprs.c:36:13:{36:3-36:12}: error: assignment to cast is illegal, lvalue casts are not supported (float*)X = P; // expected-error {{assignment to cast is illegal, lvalue casts are not supported}} ~~~~~~~~~ ^ exprs.c:41:4:{41:3-41:4}: error: called object type 'int' is not a function or function pointer X(); // expected-error {{called object type 'int' is not a function or function pointer}} ~^ exprs.c:45:15:{45:8-45:14}{45:17-45:24}: error: invalid operands to binary expression ('int *' and '_Complex float') P = (P-42) + Gamma*4; // expected-error {{invalid operands to binary expression ('int *' and '_Complex float')}} ~~~~~~ ^ ~~~~~~~ exprs.c:61:7:{61:16-61:22}: error: invalid application of '__alignof' to bitfield R = __alignof(P->x); // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}} ^ ~~~~~~ Note the range info after the column in the initial diagnostic. This is obviously really annoying if you're not a tool parsing the output of clang, which is why it is off by default. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66862 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed toTed Kremenek
be CompoundStmts. I think this is a valid assumption, and felt that the API should reflect it. Others please validate this assumption to make sure I didn't break anything. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66814 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12Add Diagnostic files for Frontend and move a couple errors over.Daniel Dunbar
- Notably, clang now exits with an error if it can't find a file. This flushed out a bug in the CGColorSpace.c test case. :) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66789 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11gnu++0x is definitely *not* the defaultGabor Greif
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66736 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11Eliminate CXXClassVarDecl. It doesn't add anythingDouglas Gregor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66696 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-11Display the exploded graph before calling BugReporter.FlushReports(). The latterTed Kremenek
deletes all registered BugTypes from BugReporter, and thus we need to display the graph first. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66623 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10Limit the template instantiation depth to some user-configurable valueDouglas Gregor
(default: 99). Beyond this limit, produce an error and consider the current template instantiation a failure. The stack we're building to track the instantiations will, eventually, be used to produce instantiation backtraces from diagnostics within template instantiation. However, we're not quite there yet. This adds a new Clang driver option -ftemplate-depth=NNN, which should eventually be generated from the GCC command-line operation -ftemplate-depth-NNN (note the '-' rather than the '='!). I did not make the driver changes to do this mapping. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66513 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09move -g option down into rest of codegen sectionChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66480 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09move debug info generation flag into CompileOptions.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-09implement -Wsystem-headers, eliminating the wierd thing I added for testing.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Fix warnings in build on clang-x86_64-freebsd buildbot.Mike Stump
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66344 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-07Improve error messages on bad warning options.Sebastian Redl
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06Implement the machinery that can process TableGenerated warning options.Sebastian Redl
Manually write a table and some ad-hoc code to provide feature parity with the current code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66276 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06capitalize for consistency, a crash in regalloc now looks like this:Chris Lattner
Stack dump: 0. Program arguments: clang pr3399.c -S -O3 1. <eof> parser at end of file 2. Code generation 3. Running pass 'Linear Scan Register Allocator' on function '@foo' Abort git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66261 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06To the user, this is just a compiler of course, duh.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66251 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06clean up the OVERVIEW line in clang --help.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66250 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-05rename PrettyStackTraceDecl -> PrettyStackTraceActionsDecl.Chris Lattner
Introduce a new PrettyStackTraceDecl. Use it to add the top level LLVM IR generation stuff in Backend.cpp to stack traces. We now get crashes like: Stack dump: 0. Program arguments: clang t.c -emit-llvm 1. <eof> parser at end of file 2. t.c:1:5: LLVM IR generation of declaration 'a' Abort for IR generation crashes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66153 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Implemented access check for ivars accessed insideFariborz Jahanian
c-style functions declared inside objc @implementations. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66087 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Start making use of "pretty stack dumps" to get Chris Lattner
better crash info when clang crashes. Step #2 of many. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04minor cleanupsChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04Change Parser::ParseCaseStatement to use an iterative approach to parsingChris Lattner
multiple sequential case statements instead of doing it with recursion. This fixes a problem where we run out of stack space parsing 100K directly nested cases. There are a couple other problems that prevent this from being useful in practice (right now the example only parses correctly with -disable-free and doesn't work with -emit-llvm), but this is a start. I'm not including a testcase because it is large and uninteresting for regtesting. Sebastian, I would appreciate it if you could scrutinize the smart pointer gymnastics I do. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03implement support for propagating *features* down to the code generatorChris Lattner
and defining target-specific macros based on them (like __SSE3__ and friends). After extensive discussion with Daniel, this work will need driver support, which will translate things like -msse3 into a -mattr feature. Until this work is done, the code in clang.cpp is disabled and the X86TargetInfo ctor still defaults to SSE2. With these two things changed, this code will work. PR3634 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65966 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03Fix <rdar://problem/6640991> Exception handling executes wrong clause ↵Steve Naroff
(Daniel, please verify). Also necessary to fix: <rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements <rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65964 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02start wiring up support for target-specific -mfoo options like -msseChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65881 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-02Rename lib/Driver (etc) to lib/Frontend in prep for the *actual*Daniel Dunbar
driver taking lib/Driver. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65811 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-28Minor name change (move the ObjC prefix to a more appropriate place).Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65695 91177308-0d34-0410-b5e6-96231b3b80d8