aboutsummaryrefslogtreecommitdiff
path: root/Driver/clang.cpp
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-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-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-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-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-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-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-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-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-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-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-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-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-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-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-28Adapt help string to what the code is doing (default is lang_gnu99). Thanks ↵Gabor Greif
rdivacky! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26Add -emit-llvm-only option (generate LLVM IR & run passes, but discardDaniel Dunbar
output). - For timing IRgen phase. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65580 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21Put compiler headers in <prefix>/lib/clang/1.0/include (vsDaniel Dunbar
<prefix>/Headers, gross). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19fix a bug introduced in my previous patch: moving clang headers to theChris Lattner
"after" group instead of the system group makes it so #include <limits.h> picks up the *system* limits.h file before clang's. This causes a failure on linux and is definitely not what we want. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65026 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-19always search for "builtin" headers at the end of the search path,Chris Lattner
and never remap them with -isysroot. This fixes PR3614. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65012 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18add a bunch of timers for -E and other modes. This requiresChris Lattner
llvm r64874 or later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64875 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18move llvm backend specific #includes into Backend.cpp instead of Clang.cppChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64872 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18indentation and formattingChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64871 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18clang will hopefully never support ratfor.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64870 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18wire up a minimal -ftime-report, which prints the optimizer/codegen Chris Lattner
times. Daniel, plz add driver support. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64869 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17Backend: Accept -mcpu and -mattr for use by TargetMachine.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64798 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17Static Analyzer driver/options (partial) cleanup:Ted Kremenek
- Move all analyzer options logic to AnalysisConsumer.cpp. - Unified specification of stores/constraints/output to be: -analyzer-output=... -analyzer-store=... -analyzer-constraints=... instead of -analyzer-range-constraints, -analyzer-store-basic, etc. - Updated drivers (ccc-analyzer, scan-builds, new ccc) to obey this new interface - Updated test cases to conform to new driver options git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64737 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17add support for -fno-math-errno, and validate that it affects sema properly.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64708 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-17remove extraneous .Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64706 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16Support IRgen of sqrt -> llvm.sqrt, pow -> llvm.pow.Daniel Dunbar
- Define pow[lf]?, sqrt[lf]? as builtins. - Add -fmath-errno option which binds to LangOptions.MathErrno - Add new builtin flag Builtin::Context::isConstWithoutErrno for functions which can be marked as const if errno isn't respected for math functions. Sema automatically marks these functions as const when they are defined, if MathErrno=0. - IRgen uses const attribute on sqrt and pow library functions to decide if it can use the llvm intrinsic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64689 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-15PR3589: Don't simplify libcalls with -ffreestanding.Daniel Dunbar
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14Add -ffreestanding to suppress the implicit declaration of library builtins ↵Douglas Gregor
like printf and malloc. Fixes PR3586 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64566 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06add support for -x c++-header, update comment.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63924 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-06default diag::err_pp_file_not_found to mapping to fatal,Chris Lattner
implementing PR3492: #include failures should be a fatal error git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63915 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04Add -femit-all-decls codegen option.Daniel Dunbar
- Emits all declarations, even unused (static) ones. - Useful when doing minimization of codegen problems (otherwise problems localized to a static function aren't minimized well). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63776 91177308-0d34-0410-b5e6-96231b3b80d8