]> granicus.if.org Git - clang/log
clang
14 years agoImprove code completion by introducing patterns for the various C and
Douglas Gregor [Sun, 10 Jan 2010 23:08:15 +0000 (23:08 +0000)]
Improve code completion by introducing patterns for the various C and
C++ grammatical constructs that show up in top-level (namespace-level)
declarations, member declarations, template declarations, statements,
expressions, conditions, etc. For example, we now provide a pattern
for

  static_cast<type>(expr)

when we can have an expression, or

  using namespace identifier;

when we can have a using directive.

Also, improves the results of code completion at the beginning of a
top-level declaration. Previously, we would see value names (function
names, global variables, etc.); now we see types, namespace names,
etc., but no values.

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

14 years agoMake sure this test case tests analyzing both x86_64 and i386 archs.
Ted Kremenek [Sun, 10 Jan 2010 22:31:25 +0000 (22:31 +0000)]
Make sure this test case tests analyzing both x86_64 and i386 archs.

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

14 years agoSilence MSVC warning.
Benjamin Kramer [Sun, 10 Jan 2010 19:57:50 +0000 (19:57 +0000)]
Silence MSVC warning.

RewriteObjC.cpp(4419) : warning C4804: '>' : unsafe use of type 'bool' in operation

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

14 years agoMake clone() method out-of-line for Attr classes.
Anton Korobeynikov [Sun, 10 Jan 2010 14:38:13 +0000 (14:38 +0000)]
Make clone() method out-of-line for Attr classes.

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

14 years agoTry to make cmake happy
Anton Korobeynikov [Sun, 10 Jan 2010 13:06:34 +0000 (13:06 +0000)]
Try to make cmake happy

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

14 years agoGeneralize target weirdness handling having proper layering in mind:
Anton Korobeynikov [Sun, 10 Jan 2010 12:58:08 +0000 (12:58 +0000)]
Generalize target weirdness handling having proper layering in mind:
 1. Add helper class for sema checks for target attributes
 2. Add helper class for codegen of target attributes

As a proof-of-concept - implement msp430's 'interrupt' attribute.

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

14 years agoRename file to generalization in next commits
Anton Korobeynikov [Sun, 10 Jan 2010 12:57:30 +0000 (12:57 +0000)]
Rename file to generalization in next commits

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

14 years agoSimplify code. No functionality change.
Benjamin Kramer [Sun, 10 Jan 2010 09:51:00 +0000 (09:51 +0000)]
Simplify code. No functionality change.

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

14 years agoEnhance test case.
Zhongxing Xu [Sun, 10 Jan 2010 02:52:56 +0000 (02:52 +0000)]
Enhance test case.

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

14 years agostringref'ize a bunch of filename handling logic. Much
Chris Lattner [Sun, 10 Jan 2010 01:35:12 +0000 (01:35 +0000)]
stringref'ize a bunch of filename handling logic.  Much
nicer than passing around two const char*'s.

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

14 years agotry to make this more stable?
Chris Lattner [Sun, 10 Jan 2010 00:59:17 +0000 (00:59 +0000)]
try to make this more stable?

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

14 years agoFix PR5982, a refacto in checking for '=' in a -D argument.
Daniel Dunbar [Sun, 10 Jan 2010 00:46:21 +0000 (00:46 +0000)]
Fix PR5982, a refacto in checking for '=' in a -D argument.

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

14 years agoFix a FIXME.
Daniel Dunbar [Sun, 10 Jan 2010 00:46:10 +0000 (00:46 +0000)]
Fix a FIXME.

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

14 years agoDarwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
Daniel Dunbar [Sun, 10 Jan 2010 00:46:00 +0000 (00:46 +0000)]
Darwin/ld: Don't pass '-weak_reference_mismatches non-weak' when
-weak_reference_mismatches is not present, it is the default.

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

14 years agoadd comment to test.
Chris Lattner [Sun, 10 Jan 2010 00:36:16 +0000 (00:36 +0000)]
add comment to test.

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

14 years agoclarify comment.
Chris Lattner [Sun, 10 Jan 2010 00:35:27 +0000 (00:35 +0000)]
clarify comment.

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

14 years agoimplement rdar://7520940: published framework headers should
Chris Lattner [Sun, 10 Jan 2010 00:24:58 +0000 (00:24 +0000)]
implement rdar://7520940: published framework headers should
import other headers within the same framework with the full
framework path, not with a relative include.

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

14 years agoFix overzealous assertion in GRExprEngine::VisitLValue(). A
Ted Kremenek [Sat, 9 Jan 2010 22:58:54 +0000 (22:58 +0000)]
Fix overzealous assertion in GRExprEngine::VisitLValue().  A
CallExpr/ObjCMessageExpr can be visited in an "lvalue" context if it
returns a struct temporary.  Currently the analyzer doesn't reason
about struct temporary returned by function calls, but we shouldn't
crash here either.

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

14 years agoimplement -ftabstop=width, patch by Christian Adåker
Chris Lattner [Sat, 9 Jan 2010 21:54:33 +0000 (21:54 +0000)]
implement -ftabstop=width, patch by Christian Adåker

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

14 years agorevert 91891, a workaround for PR5514.
Chris Lattner [Sat, 9 Jan 2010 21:45:57 +0000 (21:45 +0000)]
revert 91891, a workaround for PR5514.

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

14 years agoimplement codegen support for preinc as an lvalue, PR5514.
Chris Lattner [Sat, 9 Jan 2010 21:44:40 +0000 (21:44 +0000)]
implement codegen support for preinc as an lvalue, PR5514.

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

14 years agorefactor pre/postinc logic into CGF and require the caller to pass in the
Chris Lattner [Sat, 9 Jan 2010 21:40:03 +0000 (21:40 +0000)]
refactor pre/postinc logic into CGF and require the caller to pass in the
lvalue to poke, no functionality change.

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

14 years agorevert r92749, which is just dead code.
Chris Lattner [Sat, 9 Jan 2010 21:14:47 +0000 (21:14 +0000)]
revert r92749, which is just dead code.

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

14 years agomake missing prototypes warn by default in c99 mode like GCC does,
Chris Lattner [Sat, 9 Jan 2010 20:43:38 +0000 (20:43 +0000)]
make missing prototypes warn by default in c99 mode like GCC does,
rdar://7083878

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

14 years agoadd a bunch of missing prototypes to tests
Chris Lattner [Sat, 9 Jan 2010 20:43:19 +0000 (20:43 +0000)]
add a bunch of missing prototypes to tests

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

14 years agoFix broken diagnostic when returning the address of a stack-allocated array.
Ted Kremenek [Sat, 9 Jan 2010 20:05:00 +0000 (20:05 +0000)]
Fix broken diagnostic when returning the address of a stack-allocated array.

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

14 years agoSimplify with StringSwitch.
Benjamin Kramer [Sat, 9 Jan 2010 18:53:11 +0000 (18:53 +0000)]
Simplify with StringSwitch.

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

14 years ago2010 is here.
Chris Lattner [Sat, 9 Jan 2010 18:40:42 +0000 (18:40 +0000)]
2010 is here.

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

14 years agoHopefully unbreak build with g++ >= 4.3.
Benjamin Kramer [Sat, 9 Jan 2010 18:20:57 +0000 (18:20 +0000)]
Hopefully unbreak build with g++ >= 4.3.

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

14 years agoUse MacroBuilder for TargetDefines instead of std::vector.
Benjamin Kramer [Sat, 9 Jan 2010 17:55:51 +0000 (17:55 +0000)]
Use MacroBuilder for TargetDefines instead of std::vector.

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

14 years agoMove MacroBuilder into Frontend/Utils.h and clean it up a bit.
Benjamin Kramer [Sat, 9 Jan 2010 17:43:21 +0000 (17:43 +0000)]
Move MacroBuilder into Frontend/Utils.h and clean it up a bit.

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

14 years agoRework InitPreprocessor to use a MacroBuilder class instead of pushing around
Benjamin Kramer [Sat, 9 Jan 2010 16:17:37 +0000 (16:17 +0000)]
Rework InitPreprocessor to use a MacroBuilder class instead of pushing around
std::vectors.

- MacroBuilder wraps a raw_ostream so it can easily write to any buffer
  supported by raw_ostream.
- MacroBuilder's method take Twines for easy string concatenation (this was done
  with sprintf and temporary buffers before).
- Targets still use std::vector as they don't have access to the builder.

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

14 years agoSwitch UndefineBuiltinMacro() over to using StringRef
Kovarththanan Rajaratnam [Sat, 9 Jan 2010 09:31:32 +0000 (09:31 +0000)]
Switch UndefineBuiltinMacro() over to using StringRef

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

14 years agoSwitch DefineBuiltinMacro() over to using StringRef
Kovarththanan Rajaratnam [Sat, 9 Jan 2010 09:27:11 +0000 (09:27 +0000)]
Switch DefineBuiltinMacro() over to using StringRef

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

14 years agoWhen binding an rvalue to a reference, create a temporary object. Use
Zhongxing Xu [Sat, 9 Jan 2010 09:16:47 +0000 (09:16 +0000)]
When binding an rvalue to a reference, create a temporary object. Use
CXXObjectRegion to represent it.

In Environment, lookup a literal expression before make up a value for it.

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

14 years agoimprove support for dragonfly, patch by Sascha Wildner!
Chris Lattner [Sat, 9 Jan 2010 05:41:14 +0000 (05:41 +0000)]
improve support for dragonfly, patch by Sascha Wildner!

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

14 years agoFix indentation.
Mike Stump [Fri, 8 Jan 2010 19:28:41 +0000 (19:28 +0000)]
Fix indentation.

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

14 years agoAdd in final overrider logic.
Mike Stump [Fri, 8 Jan 2010 19:25:36 +0000 (19:25 +0000)]
Add in final overrider logic.

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

14 years agoFix handling in GRExprEngine of 'default' branch in switch statements
Ted Kremenek [Fri, 8 Jan 2010 18:54:04 +0000 (18:54 +0000)]
Fix handling in GRExprEngine of 'default' branch in switch statements
when the default case is winnowed down to be infeasible.  When all
cases were ruled out (and the analysis state for the default case
would be infeasible) we would still consider the default case
possible.  This fixes PR 5969.

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

14 years agoOrganize testcase into namespaces.
John McCall [Fri, 8 Jan 2010 18:40:32 +0000 (18:40 +0000)]
Organize testcase into namespaces.

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

14 years agoFor now, add back clang_getDeclSource().
Ted Kremenek [Fri, 8 Jan 2010 17:11:32 +0000 (17:11 +0000)]
For now, add back clang_getDeclSource().

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

14 years agoChange the printing of OR_Deleted overload results to print all the candidates,
John McCall [Fri, 8 Jan 2010 04:41:39 +0000 (04:41 +0000)]
Change the printing of OR_Deleted overload results to print all the candidates,
not just the viable ones.  This is reasonable because the most common use of
deleted functions is to exclude some implicit conversion during calls;  users
therefore will want to figure out why some other options were excluded.

Started sorting overload results.  Right now it just sorts by location in the
translation unit (after putting viable functions first), but we can do better than
that.

Changed bool OnlyViable parameter to PrintOverloadCandidates to an enum for better
self-documentation.

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

14 years agoUse -fno-math-errno by default, and remove the IsMathErrnoDefault
Dan Gohman [Fri, 8 Jan 2010 02:20:44 +0000 (02:20 +0000)]
Use -fno-math-errno by default, and remove the IsMathErrnoDefault
targethook, which is no longer being used. This fixes PR5971.

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

14 years agoclang ObjC rewriter: generated code used in "for (x in y)" loop uses
Fariborz Jahanian [Fri, 8 Jan 2010 01:29:44 +0000 (01:29 +0000)]
clang ObjC rewriter: generated code used in "for (x in y)" loop uses
incorrect cast, causing compile error (fixes radar 7342867).

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

14 years agoReorganize PrintOverloadCandidates. No functionality change.
John McCall [Fri, 8 Jan 2010 00:58:21 +0000 (00:58 +0000)]
Reorganize PrintOverloadCandidates.  No functionality change.

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

14 years agoFix for PR5967: Make const-marking for LLVM globals correct for cases requiring
Eli Friedman [Fri, 8 Jan 2010 00:50:11 +0000 (00:50 +0000)]
Fix for PR5967: Make const-marking for LLVM globals correct for cases requiring
run-time initialization, and emit run-time initializers aggresively to avoid
ordering issues with deferred globals.

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

14 years agoImprove the fix-its for -Wparentheses to ensure that the fix-it
Douglas Gregor [Fri, 8 Jan 2010 00:20:23 +0000 (00:20 +0000)]
Improve the fix-its for -Wparentheses to ensure that the fix-it
suggestions follow recovery. Additionally, add a note to these
diagnostics which suggests a fix-it for changing the behavior to what
the user probably meant. Examples:

t.cpp:2:9: warning: & has lower precedence than ==; == will be evaluated first
      [-Wparentheses]
  if (i & j == k) {
        ^~~~~~~~
          (     )
t.cpp:2:9: note: place parentheses around the & expression to evaluate it first
  if (i & j == k) {
        ^
      (    )

t.cpp:14:9: warning: using the result of an assignment as a condition
without
      parentheses [-Wparentheses]
  if (i = f()) {
      ~~^~~~~
      (      )
t.cpp:14:9: note: use '==' to turn this assignment into an equality
comparison
  if (i = f()) {
        ^
        ==

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

14 years agoExport a public symbol for classes with the GNU runtime.
David Chisnall [Fri, 8 Jan 2010 00:14:31 +0000 (00:14 +0000)]
Export a public symbol for classes with the GNU runtime.

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

14 years agoMore crashtracer enhancements to CIndex. When "popping" a crashtracer string
Ted Kremenek [Thu, 7 Jan 2010 23:13:53 +0000 (23:13 +0000)]
More crashtracer enhancements to CIndex.  When "popping" a crashtracer string
restore to the one most recently created.

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

14 years agoAdd an "implicit" bit to CXXThisExpr, so that we can track
Douglas Gregor [Thu, 7 Jan 2010 23:12:05 +0000 (23:12 +0000)]
Add an "implicit" bit to CXXThisExpr, so that we can track
implicitness without losing track of the (logical or actual) location
where "this" would occur in the source.

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

14 years agoFixes a bug where we were rewriting two definitions of
Fariborz Jahanian [Thu, 7 Jan 2010 22:51:18 +0000 (22:51 +0000)]
Fixes a bug where we were rewriting two definitions of
_objc_method (part of radar 7490408).

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

14 years agoAdd checker for type infos.
Mike Stump [Thu, 7 Jan 2010 22:50:03 +0000 (22:50 +0000)]
Add checker for type infos.

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

14 years agoTidy up crashtracer logic in CIndex.
Ted Kremenek [Thu, 7 Jan 2010 22:49:05 +0000 (22:49 +0000)]
Tidy up crashtracer logic in CIndex.

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

14 years agoAdd checked for VTTs.
Mike Stump [Thu, 7 Jan 2010 22:28:10 +0000 (22:28 +0000)]
Add checked for VTTs.

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

14 years agoDetailed vtable checker.
Mike Stump [Thu, 7 Jan 2010 22:21:26 +0000 (22:21 +0000)]
Detailed vtable checker.

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

14 years agoFixes a bug in my last patch (related to radar 7490331).
Fariborz Jahanian [Thu, 7 Jan 2010 22:15:31 +0000 (22:15 +0000)]
Fixes a bug in my last patch (related to radar 7490331).

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

14 years ago1/2 off all structs should not have any virtual functions.
Mike Stump [Thu, 7 Jan 2010 20:55:28 +0000 (20:55 +0000)]
1/2 off all structs should not have any virtual functions.
Replace magic numbers with uuids.

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

14 years agoAdd a descriptive tag to each line to make the exact differences
Mike Stump [Thu, 7 Jan 2010 19:39:43 +0000 (19:39 +0000)]
Add a descriptive tag to each line to make the exact differences
easier to understand.

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

14 years agoWhen parsing an identifier as an expression in C++, only try to annotate it
John McCall [Thu, 7 Jan 2010 19:29:58 +0000 (19:29 +0000)]
When parsing an identifier as an expression in C++, only try to annotate it
as a type or scope token if the next token requires it.

This eliminates a lot of redundant lookups in C++, but there's room for
improvement;  a better solution would do a single lookup whose kind and
results would be passed through the parser.

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

14 years agoDon't use two argument mixing function.
Mike Stump [Thu, 7 Jan 2010 19:24:27 +0000 (19:24 +0000)]
Don't use two argument mixing function.

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

14 years agoAlso generate the .s files.
Mike Stump [Thu, 7 Jan 2010 19:19:39 +0000 (19:19 +0000)]
Also generate the .s files.

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

14 years agoAdd a testcase generator for vtable/rtti testing. WIP.
Mike Stump [Thu, 7 Jan 2010 18:58:28 +0000 (18:58 +0000)]
Add a testcase generator for vtable/rtti testing.  WIP.

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

14 years agoAvoid error when convering a pointer to integer in
Fariborz Jahanian [Thu, 7 Jan 2010 18:31:42 +0000 (18:31 +0000)]
Avoid error when convering a pointer to integer in
rewriting.

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

14 years agoFix rewriting of ivars. Fixes radar 7490331.
Fariborz Jahanian [Thu, 7 Jan 2010 18:18:32 +0000 (18:18 +0000)]
Fix rewriting of ivars. Fixes radar 7490331.

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

14 years agoConvert from char pointer to char array
Kovarththanan Rajaratnam [Thu, 7 Jan 2010 18:11:14 +0000 (18:11 +0000)]
Convert from char pointer to char array

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

14 years agoFix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().
Ted Kremenek [Thu, 7 Jan 2010 18:00:35 +0000 (18:00 +0000)]
Fix typo: rename Rewriter::getRewritenText() -> Rewriter::getRewrittenText().

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

14 years agoTigthen scope of local char array
Kovarththanan Rajaratnam [Thu, 7 Jan 2010 16:01:54 +0000 (16:01 +0000)]
Tigthen scope of local char array

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

14 years agofix PR5869: mangle static symbols like gcc does to make it easier to diff symbol...
Nuno Lopes [Thu, 7 Jan 2010 09:36:51 +0000 (09:36 +0000)]
fix PR5869: mangle static symbols like gcc does to make it easier to diff symbol tables

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

14 years agoTest linkage of typeinfo and typeinfo names for class templates
Douglas Gregor [Thu, 7 Jan 2010 04:09:30 +0000 (04:09 +0000)]
Test linkage of typeinfo and typeinfo names for class templates

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

14 years agoImprove the lead diagnostic for C++ object subscript expressions with
John McCall [Thu, 7 Jan 2010 02:04:15 +0000 (02:04 +0000)]
Improve the lead diagnostic for C++ object subscript expressions with
no viable overloads.  Use a different message when the class provides
no operator[] overloads at all; use it for operator(), too.

Partially addresses PR 5900.

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

14 years agoChange ObjCContainerDecl to contain the entire range for the '@end'
Ted Kremenek [Thu, 7 Jan 2010 01:20:12 +0000 (01:20 +0000)]
Change ObjCContainerDecl to contain the entire range for the '@end'
piece of the declaration.  The '@' and the 'end' are separate tokens,
and require two SourceLocations to accurately track.

This change was motivated because ObjCContainerDecl::getSourceRange()
would previously not return the entire range of the declaration (the
'end' would be left off).

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

14 years agoAdd FileCheck prefix to another location in the output of c-index-test.
Ted Kremenek [Thu, 7 Jan 2010 01:17:12 +0000 (01:17 +0000)]
Add FileCheck prefix to another location in the output of c-index-test.

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

14 years agoAdd a test case for code-completion in the presence of tabs
Douglas Gregor [Thu, 7 Jan 2010 00:40:35 +0000 (00:40 +0000)]
Add a test case for code-completion in the presence of tabs

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

14 years ago_mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
Chris Lattner [Thu, 7 Jan 2010 00:36:41 +0000 (00:36 +0000)]
_mm_xor_ps does a xor not a nxor. The other 'xor' builtins look fine,
but this one is wrong.  Thanks to Tanya for noticing this.

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

14 years agoMake this test be ingored for linux.
Fariborz Jahanian [Thu, 7 Jan 2010 00:31:48 +0000 (00:31 +0000)]
Make this test be ingored for linux.

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

14 years agoFix the search for visible declarations within a Scope to ensure that
Douglas Gregor [Thu, 7 Jan 2010 00:31:29 +0000 (00:31 +0000)]
Fix the search for visible declarations within a Scope to ensure that
we look into a Scope that corresponds to a compound statement whose
scope was combined with the scope of the function that owns it. This
improves typo correction in many common cases.

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

14 years agoWhen we typo-correct a base class initializer, point to the base class
Douglas Gregor [Thu, 7 Jan 2010 00:26:25 +0000 (00:26 +0000)]
When we typo-correct a base class initializer, point to the base class
specifier that we corrected to.

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

14 years agoWhenever we emit a typo-correction diagnostic, also emit a note
Douglas Gregor [Thu, 7 Jan 2010 00:17:44 +0000 (00:17 +0000)]
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).

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

14 years agoFixes the test.
Fariborz Jahanian [Wed, 6 Jan 2010 23:54:34 +0000 (23:54 +0000)]
Fixes the test.

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

14 years agoWhen suggesting a typo correction for an @implementation without a
Douglas Gregor [Wed, 6 Jan 2010 23:44:25 +0000 (23:44 +0000)]
When suggesting a typo correction for an @implementation without a
corresponding @interface, provide a note showing which interface we're
referring to. This note has the fix-it hint on it.

Also, don't automatically apply fix-it hints for notes. They're meant
to express fix-its that would change semantics.

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

14 years agoChange clang_getDeclExtent() to have the endpoint point to the last character in...
Ted Kremenek [Wed, 6 Jan 2010 23:43:31 +0000 (23:43 +0000)]
Change clang_getDeclExtent() to have the endpoint point to the last character in the last token.

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

14 years agoTest case for rewriting of __weak byref objects.
Fariborz Jahanian [Wed, 6 Jan 2010 23:31:34 +0000 (23:31 +0000)]
Test case for rewriting of __weak byref objects.

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

14 years agoMove the allocation of designators in DesignatedInitExpr to the
Douglas Gregor [Wed, 6 Jan 2010 23:17:19 +0000 (23:17 +0000)]
Move the allocation of designators in DesignatedInitExpr to the
ASTContext. Fixes <rdar://problem/7495428>.

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

14 years agoDon't assert when dealing with unsigned casts of lvalues. Fixes PR5961.
John McCall [Wed, 6 Jan 2010 22:57:21 +0000 (22:57 +0000)]
Don't assert when dealing with unsigned casts of lvalues.  Fixes PR5961.

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

14 years agoAdd test from PR5913, which has already been fixed
Douglas Gregor [Wed, 6 Jan 2010 22:09:05 +0000 (22:09 +0000)]
Add test from PR5913, which has already been fixed

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

14 years agoDerive tighter ranges for & and >> in the conversion-checking code.
John McCall [Wed, 6 Jan 2010 22:07:33 +0000 (22:07 +0000)]
Derive tighter ranges for & and >> in the conversion-checking code.

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

14 years agoAdd testcase for PR5817, although the bug was already fixed
Douglas Gregor [Wed, 6 Jan 2010 22:06:13 +0000 (22:06 +0000)]
Add testcase for PR5817, although the bug was already fixed

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

14 years agoFix linkage for RTTI names by re-using the logic for computing the
Douglas Gregor [Wed, 6 Jan 2010 22:00:56 +0000 (22:00 +0000)]
Fix linkage for RTTI names by re-using the logic for computing the
linkage of vtables. Before this, we were emitting RTTI names for
template instantiations with strong external linkage rather than with
weak ODR linkage.

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

14 years agoFix a bug when property is redeclared in multiple
Fariborz Jahanian [Wed, 6 Jan 2010 21:38:30 +0000 (21:38 +0000)]
Fix a bug when property is redeclared in multiple
continuation classes and its original declaration
is imported from a protocol. This fixes radar 7509234.

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

14 years agoFix marking of virtual members for nested classes whose first non-pure virtual functi...
Douglas Gregor [Wed, 6 Jan 2010 20:27:16 +0000 (20:27 +0000)]
Fix marking of virtual members for nested classes whose first non-pure virtual function has a body inlined in the class

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

14 years agoFix for PR5691
David Chisnall [Wed, 6 Jan 2010 18:02:59 +0000 (18:02 +0000)]
Fix for PR5691

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

14 years agoMake sure that the key-function computation produces the correct
Douglas Gregor [Wed, 6 Jan 2010 17:00:51 +0000 (17:00 +0000)]
Make sure that the key-function computation produces the correct
result for a nested class whose first non-pure virtual member function
has an inline body. Previously, we were checking for the key function
before we had seen the (delayed) inline body.

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

14 years agoImprove the diagnostics used to report implicitly-generated class members
John McCall [Wed, 6 Jan 2010 09:43:14 +0000 (09:43 +0000)]
Improve the diagnostics used to report implicitly-generated class members
as parts of overload sets.  Also, refer to constructors as 'constructors'
rather than functions.

Adjust a lot of tests.

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

14 years agoFix (invalid) may-be-uninitialized warning.
Daniel Dunbar [Wed, 6 Jan 2010 07:13:04 +0000 (07:13 +0000)]
Fix (invalid) may-be-uninitialized warning.

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

14 years agoAdd missing CINDEX_LINKAGE.
Daniel Dunbar [Wed, 6 Jan 2010 06:51:48 +0000 (06:51 +0000)]
Add missing CINDEX_LINKAGE.

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

14 years agoAdd _clang_getDeclExtent to export list.
Daniel Dunbar [Wed, 6 Jan 2010 05:41:00 +0000 (05:41 +0000)]
Add _clang_getDeclExtent to export list.

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

14 years agoSignificantly rework the calculation of effective integer-expression ranges
John McCall [Wed, 6 Jan 2010 05:24:50 +0000 (05:24 +0000)]
Significantly rework the calculation of effective integer-expression ranges
for -Wsign-compare and -Wconversion, and use that coordinated logic to drive
both diagnostics.  The new logic works more transparently with implicit
conversions, conditional operators, etc., as well as bringing -Wconversion's
ability to deal with pseudo-closed operations (e.g. arithmetic on shorts) to
-Wsign-compare.

Fixes PRs 5887, 5937, 5938, and 5939.

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

14 years agoRevert my available_externally vtables experiment. It's breaking the LLVM-with-Clang...
Douglas Gregor [Wed, 6 Jan 2010 04:50:56 +0000 (04:50 +0000)]
Revert my available_externally vtables experiment. It's breaking the LLVM-with-Clang build with linker errors that I have yet to investigate.

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

14 years agoMake our marking of virtual members functions in a class be
Douglas Gregor [Wed, 6 Jan 2010 04:44:19 +0000 (04:44 +0000)]
Make our marking of virtual members functions in a class be
deterministic and work properly with templates. Once a class that
needs a vtable has been defined, we now do one if two things:

  - If the class has no key function, we place the class on a list of
    classes whose virtual functions will need to be "marked" at the
    end of the translation unit. The delay until the end of the
    translation unit is needed because we might see template
    specializations of these virtual functions.
  - If the class has a key function, we do nothing; when the key
    function is defined, the class will be placed on the
    aforementioned list.

At the end of the translation unit, we "mark" all of the virtual
functions of the classes on the list as used, possibly causing
template instantiation and other classes to be added to the
list. This gets LLVM's lib/Support/CommandLine.cpp compiling again.

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

14 years agoAdd enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().
Ted Kremenek [Wed, 6 Jan 2010 03:42:32 +0000 (03:42 +0000)]
Add enhanced crash reporter breadcrumbs for clang_createTranslationUnitFromSourceFile().

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