Commit Graph

9 Commits

Author SHA1 Message Date
Fariborz Jahanian cc99b3ca9e Fixes a corner case bug whereby declaring and defining an extern variable in a
particular sequence causes its definition to not be generated in the object file.
(fixes radar 8071804).

llvm-svn: 106424
2010-06-21 16:08:37 +00:00
Douglas Gregor 6da83624e4 Whenever we emit a typo-correction diagnostic, also emit a note
pointing to the declaration that we found that has that name (if it is
unique).

llvm-svn: 92877
2010-01-07 00:17:44 +00:00
Douglas Gregor 598b08f818 Implement typo correction for id-expressions, e.g.,
typo.cpp:22:10: error: use of undeclared identifier 'radious'; did
      you mean 'radius'?
  return radious * pi;
         ^~~~~~~
         radius

This was super-easy, since we already had decent recovery by looking
for names in dependent base classes.

llvm-svn: 92341
2009-12-31 05:20:13 +00:00
Daniel Dunbar 8fbe78f6fc Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
   which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
   can be useful to redefine what gets run as 'clang -cc1' (for example, to set
   a default target).

llvm-svn: 91446
2009-12-15 20:14:24 +00:00
Daniel Dunbar a45cf5b6b0 Rename clang to clang-cc.
Tests and drivers updated, still need to shuffle dirs.

llvm-svn: 67602
2009-03-24 02:24:46 +00:00
Douglas Gregor 3731162ade Variables marked as "extern" can actually have internal linkage if
there is a previous declaration marked "static". This fixes PR3645.

llvm-svn: 67336
2009-03-19 22:01:50 +00:00
Douglas Gregor 5a80bd1504 Rework the way we find locally-scoped external declarations when we
need them to evaluate redeclarations or call a function that hasn't
already been declared. We now keep a DenseMap of these locally-scoped
declarations so that they are not visible but can be quickly found,
e.g., when we're looking for previous declarations or before we go
ahead and implicitly declare a function that's being called. Fixes
PR3672.

llvm-svn: 65792
2009-03-02 00:19:53 +00:00
Douglas Gregor eddf4333fd When we're declaring an object or function with linkage, teach name
lookup to skip over names without linkage. This finishes
<rdar://problem/6127293>.

llvm-svn: 65386
2009-02-24 20:03:32 +00:00
Douglas Gregor 5d68a20949 Extend the implicit declaration and checking against out-of-scope
external declarations to also support external variable
declarations. Unified the code for these two cases into two new
subroutines.

Note that we fail to diagnose cases like the one Neil pointed
out, where a visible non-external declaration hides an external
declaration by the same name. That will require some reshuffling of
name lookup.

llvm-svn: 65385
2009-02-24 19:23:27 +00:00