Commit Graph

4544 Commits

Author SHA1 Message Date
Anders Carlsson 6caa9dd693 Check signedness of bitfield sizes.
llvm-svn: 67045
2009-03-16 18:19:21 +00:00
Daniel Dunbar e75d834c7c Driver: Implement majority tool binding logic.
- Still need code for determining proper output location.

 - Doesn't work yet, of course, as the host isn't providing real
   tool chains.

 - Interface still has a few warts, but has gotten a nice bit of
   polish during the rewrite.

llvm-svn: 67038
2009-03-16 06:56:51 +00:00
Daniel Dunbar 3ce436d229 Driver: Migrate some data into the Compilation; after pipelining
access to most data should go through the current Compilation, not the
Driver (which shouldn't be specialized on variables for a single
compilation).

llvm-svn: 67037
2009-03-16 06:42:30 +00:00
Daniel Dunbar 9e2136d930 Driver: Sketch Tool and ToolChain classes.
llvm-svn: 67036
2009-03-16 05:25:36 +00:00
Sebastian Redl ed0f3b021e Parser support for rvalue references.
llvm-svn: 67033
2009-03-15 22:02:01 +00:00
Anders Carlsson 5bd30395b9 (Hopefully) instantiate dependent array types correctly.
llvm-svn: 67032
2009-03-15 20:12:13 +00:00
Anders Carlsson 27de6a5e91 Handle static_asserts when instantiating structs.
llvm-svn: 67031
2009-03-15 18:44:04 +00:00
Anders Carlsson a39058118b Add the ability to clone integer and string literals. Use it when instantiating template expressions.
llvm-svn: 67030
2009-03-15 18:34:13 +00:00
Sebastian Redl 6d4256c3c1 Convert a bunch of actions to smart pointers, and also bring PrintParserCallbacks a bit more in line with reality.
llvm-svn: 67029
2009-03-15 17:47:39 +00:00
Douglas Gregor afd7c9c855 Fix bitfield-instantiation ownership bug noticed by Anders
llvm-svn: 67028
2009-03-15 17:43:26 +00:00
Anders Carlsson 78e2bc0328 Make sure to release the expressions.
llvm-svn: 67027
2009-03-15 17:35:16 +00:00
Daniel Dunbar 27a08fab6b Add note on theoretical IRgen improvement.
llvm-svn: 67024
2009-03-15 06:39:56 +00:00
Daniel Dunbar 64895a0703 Remove a FIXME.
llvm-svn: 67022
2009-03-15 06:05:20 +00:00
Daniel Dunbar 2e8536cfaa Only intptr_t is protected by __intptr_t_defined.
llvm-svn: 67018
2009-03-15 03:16:47 +00:00
Daniel Dunbar 02ae54c549 Driver: claim input arguments when building phases.
llvm-svn: 67016
2009-03-15 01:40:22 +00:00
Daniel Dunbar adc91e6597 Driver: Start warning about unused arguments.
- This has a number of current flaws, enabling now to flush out
   problems while bringing up other parts.

llvm-svn: 67015
2009-03-15 01:38:15 +00:00
Daniel Dunbar ae0e55eb7f Driver: Update ArgList::{hasArg,getLastArg} to optionally claim the
arguments if they exist.

llvm-svn: 67014
2009-03-15 00:48:16 +00:00
Sebastian Redl 4ae9b126fe Revert the switch to the tablegen diags. It fails for seperate objdir builds and cmake builds, and I have no clue what to do about it. Revisit this after someone with a clue about the build systems has looked at it.
llvm-svn: 67009
2009-03-14 15:58:54 +00:00
Sebastian Redl 51e037e3c4 Switch diagnostics from .def to tablegen files. Please validate the Windows build.
llvm-svn: 67007
2009-03-14 12:00:12 +00:00
Anders Carlsson 54b2698587 Handle dependent types/exprs in static_assert expressions.
llvm-svn: 66997
2009-03-14 00:33:21 +00:00
Ted Kremenek d0fa573a7d Remove dead DeclarationName constructors that involving knowing about the
internal implementation of Selector.

llvm-svn: 66996
2009-03-14 00:27:40 +00:00
Anders Carlsson 5bbe1d7ba7 More static_assert work. Check that the assert expr is valid and show an error if it's false. Create the declaration and add it to the current context.
llvm-svn: 66995
2009-03-14 00:25:26 +00:00
Douglas Gregor 52aba87df7 Check for overflow and signedness problems with template
arguments. Eliminates a FIXME.

llvm-svn: 66993
2009-03-14 00:20:21 +00:00
Ted Kremenek 9a46804ca8 Make Selector::getIdentifierInfo() private. I took a first attempt at this last
week in:

http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090302/013580.html

That patch caused the output of the diagnostics to change. Since
'DeclarationName' can already reason about Selectors and the Diagnostics logic
reasons about DeclarationName, there is no additional code needed to get the
diagnostics working by making Selector::getIdentifierInfo() private.

llvm-svn: 66992
2009-03-14 00:20:08 +00:00
Douglas Gregor 69bd16d814 Make sure that the canonical representation of integral template arguments uses the bitwidth and signedness of the template parameter
llvm-svn: 66990
2009-03-14 00:03:48 +00:00
Douglas Gregor 084d855a17 Implement template instantiation for the prefix unary operators. As
always, refactored the existing logic to tease apart the parser action
and the semantic analysis shared by the parser and template
instantiation.

llvm-svn: 66987
2009-03-13 23:49:33 +00:00
Daniel Dunbar 1bb3b2ccf3 Driver: Add types::{isAcceptedByClang,isCXX} predicates.
llvm-svn: 66986
2009-03-13 23:46:19 +00:00
Daniel Dunbar 313c291269 Driver: Add simple Job classes, simple wrappers for information about
what processes to execute during a compilation.

llvm-svn: 66985
2009-03-13 23:36:33 +00:00
Mike Stump 5469f29aa9 Do up codegen for function static data and externs in functions in block
literals.

llvm-svn: 66984
2009-03-13 23:34:28 +00:00
Anders Carlsson b4cf3ad61b Pass more sane arguments to ActOnStaticAssertDeclaration
llvm-svn: 66983
2009-03-13 23:29:20 +00:00
Daniel Dunbar 438ff8dbe7 Driver: Action vtables were still hungry.
llvm-svn: 66980
2009-03-13 23:17:57 +00:00
Ted Kremenek 6483bc2f19 BlockDecl::Destroy now deallocates BlockDecl's array of ParmVarDecl*.
llvm-svn: 66979
2009-03-13 23:17:24 +00:00
Daniel Dunbar 3f261ff66b Driver: Provide food and shelter for Action vtables.
llvm-svn: 66978
2009-03-13 23:08:03 +00:00
Chris Lattner c890aa2802 wire up a new -fno-builtin option, make it control things like simplifylibcalls,
etc and make freestanding imply it.

llvm-svn: 66972
2009-03-13 22:38:49 +00:00
Daniel Dunbar 95e6b191cb Driver: Sprinkle some consts in, stub out BuildJobs method.
llvm-svn: 66968
2009-03-13 22:12:33 +00:00
Chris Lattner e07ea35817 fix PR3798 by ignoring all diagnostics generated while repreprocessing a file in rewrite macros.
llvm-svn: 66961
2009-03-13 21:44:46 +00:00
Chris Lattner 83aba00ee8 make Preprocessor::Diags be a pointer instead of a reference.
llvm-svn: 66955
2009-03-13 21:17:43 +00:00
Chris Lattner 80c21df8ea use accessor instead of poking ivar directly
llvm-svn: 66954
2009-03-13 21:17:23 +00:00
Douglas Gregor 0950e41b73 Implement template instantiation for several more kinds of expressions:
- 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.

llvm-svn: 66947
2009-03-13 21:01:28 +00:00
Fariborz Jahanian b03d5a6b36 Fix a bug in building function pointer type
corresponding to block pointer.

llvm-svn: 66940
2009-03-13 20:36:41 +00:00
Daniel Dunbar e5dc48233f Driver: For universal builds, handle archs in the order they were seen.
llvm-svn: 66939
2009-03-13 20:33:35 +00:00
Ted Kremenek 340fd2dd6e Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowed
to return an owning pointer.

llvm-svn: 66934
2009-03-13 20:27:06 +00:00
Mike Stump f807ccc58e Remove FIXME, issue has been resolved.
llvm-svn: 66931
2009-03-13 19:38:54 +00:00
Douglas Gregor f50abb42c3 Remove an already-fixed FIXME
llvm-svn: 66924
2009-03-13 18:41:07 +00:00
Douglas Gregor 1baf54e1aa Refactor the way we handle operator overloading and template
instantiation for binary operators. This change moves most of the
operator-overloading code from the parser action ActOnBinOp to a new,
parser-independent semantic checking routine CreateOverloadedBinOp. 

Of particular importance is the fact that CreateOverloadedBinOp does
*not* perform any name lookup based on the current parsing context (it
doesn't take a Scope*), since it has to be usable during template
instantiation, when there is no scope information. Rather, it takes a
pre-computed set of functions that are visible from the context or via
argument-dependent lookup, and adds to that set any member operators
and built-in operator candidates. The set of functions is computed in
the parser action ActOnBinOp based on the current context (both
operator name lookup and argument-dependent lookup). Within a
template, the set computed by ActOnBinOp is saved within the
type-dependent AST node and is augmented with the results of
argument-dependent name lookup at instantiation time (see
TemplateExprInstantiator::VisitCXXOperatorCallExpr).

Sadly, we can't fully test this yet. I'll follow up with template
instantiation for sizeof so that the real fun can begin.

llvm-svn: 66923
2009-03-13 18:40:31 +00:00
Daniel Dunbar c5a5ac5015 Driver: Fix '-x none' handling.
- Enough stuff works now we can test argument parsing & pipelining.

llvm-svn: 66913
2009-03-13 17:57:10 +00:00
Daniel Dunbar 7326ad57a4 ccc/Driver: Normalize phase spelling in -ccc-print-phases.
llvm-svn: 66912
2009-03-13 17:52:07 +00:00
Daniel Dunbar e2ca3bddde Driver: Some minor bug fixes.
- language recognition was recognizing prefixes incorrectly.
 - -x none wasn't working.
 - test for "can lipo" was backwords.
 - missed a '"' in -ccc-print-phases

llvm-svn: 66911
2009-03-13 17:46:02 +00:00
Chris Lattner cda4d7e196 introduce a new -fheinous-gnu-extensions flag that enables really
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.

llvm-svn: 66910
2009-03-13 17:38:01 +00:00
Chris Lattner ef26c77c56 add a helper function to strip noop casts.
llvm-svn: 66909
2009-03-13 17:28:01 +00:00