]> granicus.if.org Git - clang/log
clang
15 years agoDriver: Add types::{isAcceptedByClang,isCXX} predicates.
Daniel Dunbar [Fri, 13 Mar 2009 23:46:19 +0000 (23:46 +0000)]
Driver: Add types::{isAcceptedByClang,isCXX} predicates.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66986 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add simple Job classes, simple wrappers for information about
Daniel Dunbar [Fri, 13 Mar 2009 23:36:33 +0000 (23:36 +0000)]
Driver: Add simple Job classes, simple wrappers for information about
what processes to execute during a compilation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66985 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDo up codegen for function static data and externs in functions in block
Mike Stump [Fri, 13 Mar 2009 23:34:28 +0000 (23:34 +0000)]
Do up codegen for function static data and externs in functions in block
literals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66984 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPass more sane arguments to ActOnStaticAssertDeclaration
Anders Carlsson [Fri, 13 Mar 2009 23:29:20 +0000 (23:29 +0000)]
Pass more sane arguments to ActOnStaticAssertDeclaration

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66983 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Action vtables were still hungry.
Daniel Dunbar [Fri, 13 Mar 2009 23:17:57 +0000 (23:17 +0000)]
Driver: Action vtables were still hungry.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66980 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBlockDecl::Destroy now deallocates BlockDecl's array of ParmVarDecl*.
Ted Kremenek [Fri, 13 Mar 2009 23:17:24 +0000 (23:17 +0000)]
BlockDecl::Destroy now deallocates BlockDecl's array of ParmVarDecl*.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66979 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Provide food and shelter for Action vtables.
Daniel Dunbar [Fri, 13 Mar 2009 23:08:03 +0000 (23:08 +0000)]
Driver: Provide food and shelter for Action vtables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66978 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoForce triple for a couple test cases.
Daniel Dunbar [Fri, 13 Mar 2009 22:48:51 +0000 (22:48 +0000)]
Force triple for a couple test cases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66974 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agowire up a new -fno-builtin option, make it control things like simplifylibcalls,
Chris Lattner [Fri, 13 Mar 2009 22:38:49 +0000 (22:38 +0000)]
wire up a new -fno-builtin option, make it control things like simplifylibcalls,
etc and make freestanding imply it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66972 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoInclude component warning TableGen files in Diagnostic.td.
Ted Kremenek [Fri, 13 Mar 2009 22:19:07 +0000 (22:19 +0000)]
Include component warning TableGen files in Diagnostic.td.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66969 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Sprinkle some consts in, stub out BuildJobs method.
Daniel Dunbar [Fri, 13 Mar 2009 22:12:33 +0000 (22:12 +0000)]
Driver: Sprinkle some consts in, stub out BuildJobs method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66968 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate test.
Daniel Dunbar [Fri, 13 Mar 2009 22:11:42 +0000 (22:11 +0000)]
Update test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66967 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a testcase for recursion through blocks pointers, rdar://6676764.
Chris Lattner [Fri, 13 Mar 2009 22:00:25 +0000 (22:00 +0000)]
add a testcase for recursion through blocks pointers, rdar://6676764.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66965 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agofix PR3798 by ignoring all diagnostics generated while repreprocessing a file in...
Chris Lattner [Fri, 13 Mar 2009 21:44:46 +0000 (21:44 +0000)]
fix PR3798 by ignoring all diagnostics generated while repreprocessing a file in rewrite macros.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66961 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agomake Preprocessor::Diags be a pointer instead of a reference.
Chris Lattner [Fri, 13 Mar 2009 21:17:43 +0000 (21:17 +0000)]
make Preprocessor::Diags be a pointer instead of a reference.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66955 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agouse accessor instead of poking ivar directly
Chris Lattner [Fri, 13 Mar 2009 21:17:23 +0000 (21:17 +0000)]
use accessor instead of poking ivar directly

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66954 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDevious test-case involved overload resolution and ADL during template instantiation.
Douglas Gregor [Fri, 13 Mar 2009 21:04:12 +0000 (21:04 +0000)]
Devious test-case involved overload resolution and ADL during template instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66951 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Desensitize test to location of input.
Daniel Dunbar [Fri, 13 Mar 2009 21:03:35 +0000 (21:03 +0000)]
Driver: Desensitize test to location of input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66950 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement template instantiation for several more kinds of expressions:
Douglas Gregor [Fri, 13 Mar 2009 21:01:28 +0000 (21:01 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66947 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix typo.
Ted Kremenek [Fri, 13 Mar 2009 20:47:27 +0000 (20:47 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66944 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd missing ';'.
Ted Kremenek [Fri, 13 Mar 2009 20:45:13 +0000 (20:45 +0000)]
Add missing ';'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66943 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Test pipelining for universal builds.
Daniel Dunbar [Fri, 13 Mar 2009 20:45:03 +0000 (20:45 +0000)]
Driver: Test pipelining for universal builds.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66942 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix a bug in building function pointer type
Fariborz Jahanian [Fri, 13 Mar 2009 20:36:41 +0000 (20:36 +0000)]
Fix a bug in building function pointer type
corresponding to block pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66940 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: For universal builds, handle archs in the order they were seen.
Daniel Dunbar [Fri, 13 Mar 2009 20:33:35 +0000 (20:33 +0000)]
Driver: For universal builds, handle archs in the order they were seen.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66939 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Handle limited forms of -ccc-host-triple for testing
Daniel Dunbar [Fri, 13 Mar 2009 20:33:09 +0000 (20:33 +0000)]
ccc: Handle limited forms of -ccc-host-triple for testing
compatibility with C++ rewrite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66938 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowed
Ted Kremenek [Fri, 13 Mar 2009 20:27:06 +0000 (20:27 +0000)]
Fix PR 3677 [retain checker]: custom 'allocWithZone' methods should be allowed
to return an owning pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66934 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove FIXME, issue has been resolved.
Mike Stump [Fri, 13 Mar 2009 19:38:54 +0000 (19:38 +0000)]
Remove FIXME, issue has been resolved.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66931 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Fri, 13 Mar 2009 18:48:36 +0000 (18:48 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66926 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove an already-fixed FIXME
Douglas Gregor [Fri, 13 Mar 2009 18:41:07 +0000 (18:41 +0000)]
Remove an already-fixed FIXME

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66924 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRefactor the way we handle operator overloading and template
Douglas Gregor [Fri, 13 Mar 2009 18:40:31 +0000 (18:40 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66923 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc/Driver: Forward -fheinous-gnu-extensions to clang.
Daniel Dunbar [Fri, 13 Mar 2009 18:12:01 +0000 (18:12 +0000)]
ccc/Driver: Forward -fheinous-gnu-extensions to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66915 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Fix '-x none' handling.
Daniel Dunbar [Fri, 13 Mar 2009 17:57:10 +0000 (17:57 +0000)]
Driver: Fix '-x none' handling.
 - Enough stuff works now we can test argument parsing & pipelining.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66913 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc/Driver: Normalize phase spelling in -ccc-print-phases.
Daniel Dunbar [Fri, 13 Mar 2009 17:52:07 +0000 (17:52 +0000)]
ccc/Driver: Normalize phase spelling in -ccc-print-phases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66912 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Some minor bug fixes.
Daniel Dunbar [Fri, 13 Mar 2009 17:46:02 +0000 (17:46 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66911 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agointroduce a new -fheinous-gnu-extensions flag that enables really
Chris Lattner [Fri, 13 Mar 2009 17:38:01 +0000 (17:38 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66910 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a helper function to strip noop casts.
Chris Lattner [Fri, 13 Mar 2009 17:28:01 +0000 (17:28 +0000)]
add a helper function to strip noop casts.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66909 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Fix think in ArgList::MakeIndex.
Daniel Dunbar [Fri, 13 Mar 2009 17:25:24 +0000 (17:25 +0000)]
Driver: Fix think in ArgList::MakeIndex.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66908 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Return 0 from BuildCompilation on -ccc-print-phases,
Daniel Dunbar [Fri, 13 Mar 2009 17:24:34 +0000 (17:24 +0000)]
Driver: Return 0 from BuildCompilation on -ccc-print-phases,
-ccc-print-options.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66907 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Print -ccc-print-phases on stderr.
Daniel Dunbar [Fri, 13 Mar 2009 17:20:20 +0000 (17:20 +0000)]
Driver: Print -ccc-print-phases on stderr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66906 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix typo.
Ted Kremenek [Fri, 13 Mar 2009 17:02:59 +0000 (17:02 +0000)]
Fix typo.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66905 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.
Steve Naroff [Fri, 13 Mar 2009 16:56:44 +0000 (16:56 +0000)]
Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.

Also changed BlockDecl API to be more consistent (wrt FunctionDecl).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66904 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd a hack in the analyzer to recover some path-sensitivity at branch
Ted Kremenek [Fri, 13 Mar 2009 16:32:54 +0000 (16:32 +0000)]
Add a hack in the analyzer to recover some path-sensitivity at branch
conditions. Currently the analyzer does not reason well about
promotions/truncations of symbolic values, so at branch conditions when we see:

  if (condition)

and condition is something like a 'short' or 'char', essentially ignore the
promotion to 'int' so that we track constraints on the original symbolic value.
We only ignore the casts if the underlying type has the same or fewer bits as
the converted type.

This fixes:

<rdar://problem/6619921>

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66899 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoReimplement fix for <rdar://problem/6451399> problems with labels and blocks.
Steve Naroff [Fri, 13 Mar 2009 16:03:38 +0000 (16:03 +0000)]
Reimplement fix for <rdar://problem/6451399> problems with labels and blocks.

This solution is much simpler (and doesn't add any per-scope overhead, which concerned Chris).

The only downside is the LabelMap is now declared in two places (Sema and BlockSemaInfo). My original fix tried to unify the LabelMap in "Scope" (which would support nested functions in general). In any event, this fixes the bug given the current language definition. If/when we decide to support GCC style nested functions, this will need to be tweaked.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66896 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdated comment.
Ted Kremenek [Fri, 13 Mar 2009 15:39:16 +0000 (15:39 +0000)]
Updated comment.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66894 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoRemove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision...
Steve Naroff [Fri, 13 Mar 2009 15:38:40 +0000 (15:38 +0000)]
Remove ActiveScope (revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65694 and http://llvm.org/viewvc/llvm-project?view=rev&revision=66741).

Will replace with something better today...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66893 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix failure reported by Sebastian of test/Analysis/ptr-arith.c when the target
Ted Kremenek [Fri, 13 Mar 2009 15:35:24 +0000 (15:35 +0000)]
Fix failure reported by Sebastian of test/Analysis/ptr-arith.c when the target
is 64-bit. I used his suggestion of doing a direct bitwidth/signedness
conversion of the 'offset' instead of just changing the sign. For more
information, see:

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2009-March/004587.html

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66892 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoSplit get_involved into Get Involved and Open Projects pages
Douglas Gregor [Fri, 13 Mar 2009 15:06:27 +0000 (15:06 +0000)]
Split get_involved into Get Involved and Open Projects pages

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66891 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Fix thinko in Darwin host identification.
Daniel Dunbar [Fri, 13 Mar 2009 12:23:29 +0000 (12:23 +0000)]
Driver: Fix thinko in Darwin host identification.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66889 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Support -ccc-print-phases.
Daniel Dunbar [Fri, 13 Mar 2009 12:19:02 +0000 (12:19 +0000)]
Driver: Support -ccc-print-phases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66888 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add cast<> support for Action, and some other accessors.
Daniel Dunbar [Fri, 13 Mar 2009 12:17:08 +0000 (12:17 +0000)]
Driver: Add cast<> support for Action, and some other accessors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66887 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Don't print the arch for every action when printing phases.
Daniel Dunbar [Fri, 13 Mar 2009 12:16:31 +0000 (12:16 +0000)]
ccc: Don't print the arch for every action when printing phases.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66886 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Complete "pipelining" (building the list of abstract actions
Daniel Dunbar [Fri, 13 Mar 2009 11:38:42 +0000 (11:38 +0000)]
Driver: Complete "pipelining" (building the list of abstract actions
to perform). Still doesn't do anything interesting.
 - This code came out much cleaner than in ccc with the reworked
   phases & mapping of types to lists of compilation steps (phases) to
   perform.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66885 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agosupport cmake
Gabor Greif [Fri, 13 Mar 2009 11:37:39 +0000 (11:37 +0000)]
support cmake

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66884 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Make phase names nouns not verbs.
Daniel Dunbar [Fri, 13 Mar 2009 11:36:01 +0000 (11:36 +0000)]
Driver: Make phase names nouns not verbs.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66883 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add remaining Action classes we need.
Daniel Dunbar [Fri, 13 Mar 2009 11:30:17 +0000 (11:30 +0000)]
Driver: Add remaining Action classes we need.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66882 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add types::getNumCompilationPhases, getCompilationPhase to
Daniel Dunbar [Fri, 13 Mar 2009 11:28:30 +0000 (11:28 +0000)]
Driver: Add types::getNumCompilationPhases, getCompilationPhase to
provide information about what steps should be done for a particular
file type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66881 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Pull Phase info into separate file.
Daniel Dunbar [Fri, 13 Mar 2009 11:27:05 +0000 (11:27 +0000)]
Driver: Pull Phase info into separate file.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66880 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc/Driver: Forward -fprint-source-range-info to clang.
Daniel Dunbar [Fri, 13 Mar 2009 10:03:45 +0000 (10:03 +0000)]
ccc/Driver: Forward -fprint-source-range-info to clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66879 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoimplement a new -fprint-source-range-info option, which
Chris Lattner [Fri, 13 Mar 2009 01:08:23 +0000 (01:08 +0000)]
implement a new -fprint-source-range-info option, which
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

15 years agofix typo
Chris Lattner [Fri, 13 Mar 2009 01:05:57 +0000 (01:05 +0000)]
fix typo

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66860 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Ignore empty arguments.
Daniel Dunbar [Fri, 13 Mar 2009 01:01:44 +0000 (01:01 +0000)]
Driver: Ignore empty arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66858 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Handle "immediate" options.
Daniel Dunbar [Fri, 13 Mar 2009 00:51:18 +0000 (00:51 +0000)]
Driver: Handle "immediate" options.

Also, add some FIXMEs, improve doxygen & comments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66857 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix test.
Fariborz Jahanian [Fri, 13 Mar 2009 00:43:34 +0000 (00:43 +0000)]
Fix test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66856 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUpdate checker build.
Ted Kremenek [Fri, 13 Mar 2009 00:43:31 +0000 (00:43 +0000)]
Update checker build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66855 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFixed an ir-gen bug related to strong-cast generation of
Fariborz Jahanian [Fri, 13 Mar 2009 00:42:52 +0000 (00:42 +0000)]
Fixed an ir-gen bug related to strong-cast generation of
source being a non-pointer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66854 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix spelling error, and add target triplet to header.
Mike Stump [Fri, 13 Mar 2009 00:41:24 +0000 (00:41 +0000)]
Fix spelling error, and add target triplet to header.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66853 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImprove the representation of operator expressions like "x + y" within
Douglas Gregor [Fri, 13 Mar 2009 00:33:25 +0000 (00:33 +0000)]
Improve the representation of operator expressions like "x + y" within
C++ templates. In particular, keep track of the overloaded operators
that are visible from the template definition, so that they can be
merged with those operators visible via argument-dependent lookup at
instantiation time.

Refactored the lookup routines for argument-dependent lookup and for
operator name lookup, so they can be called without immediately adding
the results to an overload set.

Instantiation of these expressions is completely wrong. I'll work on
that next.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66851 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoWhen testing with VERBOSE=0, report results in the ISO format. We
Mike Stump [Fri, 13 Mar 2009 00:21:49 +0000 (00:21 +0000)]
When testing with VERBOSE=0, report results in the ISO format.  We
include the triplet so that people that run multiple targets in
parallel, say i386 and x86_64 can distinguish between the two.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66849 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc/Driver: Mark {dump{machine,specs,version},
Daniel Dunbar [Fri, 13 Mar 2009 00:17:48 +0000 (00:17 +0000)]
ccc/Driver: Mark {dump{machine,specs,version},
print-{multi-{directory,lib,os-directory}, search-dirs} as unsupported
instead of handling separately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66848 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoBring in std::string to fix compilation on GCC 4.3
Argyrios Kyrtzidis [Fri, 13 Mar 2009 00:01:07 +0000 (00:01 +0000)]
Bring in std::string to fix compilation on GCC 4.3

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66846 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Determine which compilation stages to run.
Daniel Dunbar [Thu, 12 Mar 2009 23:55:14 +0000 (23:55 +0000)]
Driver: Determine which compilation stages to run.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66844 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse the correct data structures!
Ted Kremenek [Thu, 12 Mar 2009 23:41:59 +0000 (23:41 +0000)]
Use the correct data structures!

ExplodedGraph::TrimGraph:
- Just do a DFS both ways instead of BFS-DFS. We're just determining what subset
  of the nodes are reachable from the root and reverse-reachable from the bug
  nodes.  DFS is more efficient for this task.

BugReporter:
- MakeReportGraph: Do a reverse-BFS instead of a reverse-DFS to determine the
  approximate shortest path through the simulation graph. We were seeing some
  weird cases where too many loops were being reported for simple bugs. Possibly
  we will need to replace this with actually computing the shortest path in
  terms of line numbers.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66842 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoEliminate some unused default cases in switches on the binary operator kind
Douglas Gregor [Thu, 12 Mar 2009 22:51:37 +0000 (22:51 +0000)]
Eliminate some unused default cases in switches on the binary operator kind

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66837 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore objc2's ivar layout bitmap.
Fariborz Jahanian [Thu, 12 Mar 2009 22:50:49 +0000 (22:50 +0000)]
More objc2's ivar layout bitmap.
bitmap generation for basic ivars seem to
work now. This is work in progress.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66836 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoImplement template instantiation for builtin binary operators
Douglas Gregor [Thu, 12 Mar 2009 22:46:12 +0000 (22:46 +0000)]
Implement template instantiation for builtin binary operators

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66835 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse paropery's setter attribute name as
Fariborz Jahanian [Thu, 12 Mar 2009 22:34:11 +0000 (22:34 +0000)]
Use paropery's setter attribute name as
the selector for the property setter.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66834 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStore the type of the integral value within a TemplateArgument, so that we can more...
Douglas Gregor [Thu, 12 Mar 2009 22:20:26 +0000 (22:20 +0000)]
Store the type of the integral value within a TemplateArgument, so that we can more efficiently reconstruct an IntegerLiteral from it during template instantiation

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66833 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoFix crash when using TypedViewRegions and ObjCQualifiedIdTypes (TypedViewRegion:...
Ted Kremenek [Thu, 12 Mar 2009 22:15:08 +0000 (22:15 +0000)]
Fix crash when using TypedViewRegions and ObjCQualifiedIdTypes (TypedViewRegion::getLValueType() was not implemented).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66830 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd file I forgot to commit in previous commit.
Ted Kremenek [Thu, 12 Mar 2009 18:42:19 +0000 (18:42 +0000)]
Add file I forgot to commit in previous commit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66820 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Value initialization is nicer than memset.
Daniel Dunbar [Thu, 12 Mar 2009 18:42:02 +0000 (18:42 +0000)]
Driver: Value initialization is nicer than memset.
 - Who wouldn't want correctness to hang critically on two easily
   ignored characters?

Thanks Doug!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66819 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoPathDiagnostics:
Ted Kremenek [Thu, 12 Mar 2009 18:41:53 +0000 (18:41 +0000)]
PathDiagnostics:
- PathDiagnosticControlFlowPiece now consists of a "start" and "end" location
  to indicating the branch location and where the branch goes.

BugReporter:
- Updated BugReporter to construct PathDiagnosticControlFlowPiece objects with
  "end" locations.

PlistDiagnostics:
- Plists now contain the bug "type" (not just bug "category")
- Plists now encode control-flow pieces differently than events; now the
  "start" and "end" locations are recorded

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66818 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add majority of driver-driver implementation.
Daniel Dunbar [Thu, 12 Mar 2009 18:40:18 +0000 (18:40 +0000)]
Driver: Add majority of driver-driver implementation.
 - Compare to driverdriver.c if bored; not completely fair since the
   driver gets a bit more code in other places to handle binding archs
   (for Xarch) but not completely unfair either.

Fear not, extra Action classes will have a happy home for their
vtables soon.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66817 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoUse StmtVisitor to handle the decoding of expressions for
Douglas Gregor [Thu, 12 Mar 2009 18:36:18 +0000 (18:36 +0000)]
Use StmtVisitor to handle the decoding of expressions for
instantiation. This is roughly the structure we want to expression
instantiation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66816 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAPI fix: All "bodies" for functions, Objective-C methods, blocks, are assumed to
Ted Kremenek [Thu, 12 Mar 2009 18:33:24 +0000 (18:33 +0000)]
API fix: All "bodies" for functions, Objective-C methods, blocks, are assumed to
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

15 years agoDriver: Drop some unnecessary uses of clang namespace.
Daniel Dunbar [Thu, 12 Mar 2009 18:31:08 +0000 (18:31 +0000)]
Driver: Drop some unnecessary uses of clang namespace.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66813 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Introduce ActionList typedef, tweak some constness.
Daniel Dunbar [Thu, 12 Mar 2009 18:24:49 +0000 (18:24 +0000)]
Driver: Introduce ActionList typedef, tweak some constness.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66809 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add types::canLipoType helper method.
Daniel Dunbar [Thu, 12 Mar 2009 18:21:41 +0000 (18:21 +0000)]
Driver: Add types::canLipoType helper method.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66807 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add some HostInfo accessors.
Daniel Dunbar [Thu, 12 Mar 2009 18:20:49 +0000 (18:20 +0000)]
Driver: Add some HostInfo accessors.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66806 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add ArgList support for synthesizing arguments.
Daniel Dunbar [Thu, 12 Mar 2009 18:20:18 +0000 (18:20 +0000)]
Driver: Add ArgList support for synthesizing arguments.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66805 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoMore ident fixes
Anders Carlsson [Thu, 12 Mar 2009 17:55:17 +0000 (17:55 +0000)]
More ident fixes

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66801 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoadd a callback for macro expansion, based on a patch by Paolo Bolzoni!
Chris Lattner [Thu, 12 Mar 2009 17:31:43 +0000 (17:31 +0000)]
add a callback for macro expansion, based on a patch by Paolo Bolzoni!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66799 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoStraw man for instantiation of expressions. Use it to instantiate the
Douglas Gregor [Thu, 12 Mar 2009 16:53:44 +0000 (16:53 +0000)]
Straw man for instantiation of expressions. Use it to instantiate the
width of bitfields.

I'll be burning this down and replacing it with a properly-dispatched
implementation like the one used for types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66796 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Add ArgList::getLastArg.
Daniel Dunbar [Thu, 12 Mar 2009 16:03:38 +0000 (16:03 +0000)]
Driver: Add ArgList::getLastArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66794 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Fix broken assertion.
Daniel Dunbar [Thu, 12 Mar 2009 15:59:34 +0000 (15:59 +0000)]
ccc: Fix broken assertion.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66793 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoccc: Fix -ccc-print-phases when doing a universal build.
Daniel Dunbar [Thu, 12 Mar 2009 15:57:47 +0000 (15:57 +0000)]
ccc: Fix -ccc-print-phases when doing a universal build.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66792 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoAdd Diagnostic files for Frontend and move a couple errors over.
Daniel Dunbar [Thu, 12 Mar 2009 10:14:16 +0000 (10:14 +0000)]
Add Diagnostic files for Frontend and move a couple errors over.
 - 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

15 years agoDriver: Tweak diag names to be more consistent.
Daniel Dunbar [Thu, 12 Mar 2009 09:13:48 +0000 (09:13 +0000)]
Driver: Tweak diag names to be more consistent.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66787 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Use standard Diagnostic interface for diagnostics.
Daniel Dunbar [Thu, 12 Mar 2009 08:55:43 +0000 (08:55 +0000)]
Driver: Use standard Diagnostic interface for diagnostics.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66786 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: Fix thinko in Arg::hasArg.
Daniel Dunbar [Thu, 12 Mar 2009 08:45:11 +0000 (08:45 +0000)]
Driver: Fix thinko in Arg::hasArg.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66785 91177308-0d34-0410-b5e6-96231b3b80d8

15 years agoDriver: '-' is parsed as an input.
Daniel Dunbar [Thu, 12 Mar 2009 08:44:47 +0000 (08:44 +0000)]
Driver: '-' is parsed as an input.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66784 91177308-0d34-0410-b5e6-96231b3b80d8