Commit Graph

10708 Commits

Author SHA1 Message Date
Daniel Dunbar a493ff47bd Update test.
llvm-svn: 66967
2009-03-13 22:11:42 +00:00
Chris Lattner 622b1041ca add a testcase for recursion through blocks pointers, rdar://6676764.
llvm-svn: 66965
2009-03-13 22:00:25 +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 4b7f3d7344 Devious test-case involved overload resolution and ADL during template instantiation.
llvm-svn: 66951
2009-03-13 21:04:12 +00:00
Daniel Dunbar c178c5f126 Driver: Desensitize test to location of input.
llvm-svn: 66950
2009-03-13 21:03:35 +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
Ted Kremenek decee183ee Fix typo.
llvm-svn: 66944
2009-03-13 20:47:27 +00:00
Ted Kremenek b83ab59e07 Add missing ';'.
llvm-svn: 66943
2009-03-13 20:45:13 +00:00
Daniel Dunbar 192f4facac Driver: Test pipelining for universal builds.
llvm-svn: 66942
2009-03-13 20:45:03 +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
Daniel Dunbar 427d6f1a95 ccc: Handle limited forms of -ccc-host-triple for testing
compatibility with C++ rewrite.

llvm-svn: 66938
2009-03-13 20:33:09 +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
Ted Kremenek 80caa92255 Update checker build.
llvm-svn: 66926
2009-03-13 18:48:36 +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 52183091f1 ccc/Driver: Forward -fheinous-gnu-extensions to clang.
llvm-svn: 66915
2009-03-13 18:12:01 +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
Daniel Dunbar dfab7abdea Driver: Fix think in ArgList::MakeIndex.
llvm-svn: 66908
2009-03-13 17:25:24 +00:00
Daniel Dunbar 3efedddcf9 Driver: Return 0 from BuildCompilation on -ccc-print-phases,
-ccc-print-options.

llvm-svn: 66907
2009-03-13 17:24:34 +00:00
Daniel Dunbar ed50f6c356 Driver: Print -ccc-print-phases on stderr.
llvm-svn: 66906
2009-03-13 17:20:20 +00:00
Ted Kremenek 3626e0add0 Fix typo.
llvm-svn: 66905
2009-03-13 17:02:59 +00:00
Steve Naroff c4b30e596c Fix <rdar://problem/6675489> BlockDecl should not use llvm::smallvector.
Also changed BlockDecl API to be more consistent (wrt FunctionDecl).

llvm-svn: 66904
2009-03-13 16:56:44 +00:00
Ted Kremenek 22358bd681 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>

llvm-svn: 66899
2009-03-13 16:32:54 +00:00
Steve Naroff cfb6cf4c02 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.

llvm-svn: 66896
2009-03-13 16:03:38 +00:00
Ted Kremenek 0bf152ef0b Updated comment.
llvm-svn: 66894
2009-03-13 15:39:16 +00:00
Steve Naroff 846b1ec40f 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...

llvm-svn: 66893
2009-03-13 15:38:40 +00:00
Ted Kremenek ec94f08dce 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

llvm-svn: 66892
2009-03-13 15:35:24 +00:00
Douglas Gregor 201217324a Split get_involved into Get Involved and Open Projects pages
llvm-svn: 66891
2009-03-13 15:06:27 +00:00
Daniel Dunbar 0a180f1499 Driver: Fix thinko in Darwin host identification.
llvm-svn: 66889
2009-03-13 12:23:29 +00:00
Daniel Dunbar aaf1ea6386 Driver: Support -ccc-print-phases.
llvm-svn: 66888
2009-03-13 12:19:02 +00:00
Daniel Dunbar 80665fb0c5 Driver: Add cast<> support for Action, and some other accessors.
llvm-svn: 66887
2009-03-13 12:17:08 +00:00
Daniel Dunbar 92d19016b5 ccc: Don't print the arch for every action when printing phases.
llvm-svn: 66886
2009-03-13 12:16:31 +00:00
Daniel Dunbar 6522933d7a 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.

llvm-svn: 66885
2009-03-13 11:38:42 +00:00
Gabor Greif aa033f9570 support cmake
llvm-svn: 66884
2009-03-13 11:37:39 +00:00
Daniel Dunbar 286c39a993 Driver: Make phase names nouns not verbs.
llvm-svn: 66883
2009-03-13 11:36:01 +00:00
Daniel Dunbar 2a62703018 Driver: Add remaining Action classes we need.
llvm-svn: 66882
2009-03-13 11:30:17 +00:00
Daniel Dunbar e71b9640ad Driver: Add types::getNumCompilationPhases, getCompilationPhase to
provide information about what steps should be done for a particular
file type.

llvm-svn: 66881
2009-03-13 11:28:30 +00:00
Daniel Dunbar 58cac7ca68 Driver: Pull Phase info into separate file.
llvm-svn: 66880
2009-03-13 11:27:05 +00:00
Daniel Dunbar 5a3b818dea ccc/Driver: Forward -fprint-source-range-info to clang.
llvm-svn: 66879
2009-03-13 10:03:45 +00:00
Chris Lattner 44219f3e58 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.

llvm-svn: 66862
2009-03-13 01:08:23 +00:00
Chris Lattner f0db0aed67 fix typo
llvm-svn: 66860
2009-03-13 01:05:57 +00:00
Daniel Dunbar 0f35a026a9 Driver: Ignore empty arguments.
llvm-svn: 66858
2009-03-13 01:01:44 +00:00