Mike Stump
980ca22084
Fix some issues Daniel pointed out.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 20:48:09 +00:00
Sebastian Redl
f322ed6d39
Properly instantiate usage of overloaded operator []. Fixes PR5345.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 20:17:01 +00:00
Steve Naroff
f9f6196e9f
clang_getDeclSpelling(): For category implementations, make sure we hand back the category name (not the class name). This fixes <rdar://problem/7297518>.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 18:55:50 +00:00
John McCall
828bff2079
A few TemplateArgumentLoc clean-ups. Try to remember the Expr for a declaration.
...
Provide an API for getting the SourceRange of a TAL and use it judiciously.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85520 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 18:45:58 +00:00
Douglas Gregor
fd2300e1ee
Yet more instantiation-location information. Fixes PR5336.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85516 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 17:56:10 +00:00
Fariborz Jahanian
6fba746486
Patch for destruction of array of objects on block exit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85512 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 16:22:54 +00:00
Ted Kremenek
539afc7233
Update checker build.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85511 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 16:18:45 +00:00
Anders Carlsson
0ebb6d391d
Make sure to call CompleteConstructorCall for bases and members that are initialized implicitly in constructors so that default arguments etc are set correctly. Fixes PR5283.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85510 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 15:46:07 +00:00
Douglas Gregor
8de39b431d
Fix Release-Asserts build breakage
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 15:25:40 +00:00
Nuno Lopes
c6eb131a83
make clang emit undefs for padding of structs and unions instead of zeros. this enables constant compaction optimizations.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 11:27:06 +00:00
John McCall
4fff4b3fdf
Apparently when is now.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 08:17:34 +00:00
John McCall
833ca991c1
Track source information for template arguments and template specialization
...
types. Preserve it through template instantiation. Preserve it through PCH,
although TSTs themselves aren't serializable, so that's pretty much meaningless.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85500 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 08:12:44 +00:00
John McCall
275c10a8a4
Extract TemplateArgument into a new header just for common template
...
classes. Move its implementation into a new module.
This will seem marginally more justified in a bit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85499 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 07:48:15 +00:00
Zhongxing Xu
f1cbd80b14
Add an assertion to ensure NullDerefChecker exists.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85497 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 05:56:54 +00:00
Ted Kremenek
3f214b35ca
Fix accidental use of CheckSVal instead of CheckLocation, and add a
...
small test case to show we handle dereferences of undefined values.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 05:33:39 +00:00
Douglas Gregor
fc3bb49e91
StringSwitch-ify attribute name mapping.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85491 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 05:26:58 +00:00
Chris Lattner
7b8da89b1c
make this interpretable.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 05:25:27 +00:00
Ted Kremenek
01756192fe
Fix an insidious bug in RegionStore::RemoveDeadBindings() pointed out
...
by Zhongxing Xu. RemoveDeadBindings() would falsely prune
SymbolicRegions from the store that wrapped derived symbols whose
liveness could only be determined after scanning the store.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85484 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 05:14:17 +00:00
Chris Lattner
bceaf8614b
add two new and very exhaustive preprocessor tests, patch by
...
Ken Dyck!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85482 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 04:55:36 +00:00
Chris Lattner
c883770665
simplify intmax setup, patch by Ken Dyck!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85481 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 04:54:24 +00:00
Daniel Dunbar
ee848a73e5
Remove some obsolete or unnecessary FIXMEs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:39:57 +00:00
Daniel Dunbar
6e8371eb97
PR5328: Allow duplicatic -pedantic (and -pedantic-errors) options.
...
- clang-cc doesn't care about their relative order with other -W options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:24:45 +00:00
Daniel Dunbar
f7fb31f475
Kill off MakeFormattedString helper function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:24:37 +00:00
Zhongxing Xu
ec9227fea6
Move NullDeref and UndefDeref into their own checker.
...
Add a CheckLocation() interface to Checker.
Now ImplicitNullDeref nodes are cached in NullDerefChecker.
More cleanups follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85471 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 02:09:30 +00:00
Daniel Dunbar
607d7f6d8f
Reject -I- in driver instead of clang-cc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:53:44 +00:00
Daniel Dunbar
bea5a84ea6
Formatting fixes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85468 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:53:18 +00:00
Chris Lattner
6ebd79b58c
make this more interesting, test the static const array.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 01:20:34 +00:00
Ted Kremenek
d864e1a425
Add test case for <rdar://problem/7342806>.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85462 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:49:46 +00:00
Douglas Gregor
55d3f7ae51
[llvm up]
...
Switch a few ugly switch-on-string-literal constructs to use the new
llvm::StringSwitch.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:41:01 +00:00
Chris Lattner
d8ee95fd4f
optimize out some ifdefs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85453 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:22:00 +00:00
John Thompson
addb0f6958
Fix some Window-isms to get these tests to pass on Windows.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85450 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:10:42 +00:00
Douglas Gregor
ed9c0f90b7
Implement support for semantic checking and template instantiation of
...
class template partial specializations of member templates. Also,
fixes a silly little bug in the marking of "used" template parameters
in member templates. Fixes PR5236.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85447 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-29 00:04:11 +00:00
Chris Lattner
d9becd1846
Implement clang support for indirect branch and address of label
...
using the new LLVM support for this. This is temporarily hiding
behind horrible and ugly #ifdefs until the time when the optimizer
is stable (hopefully a week or so). Until then, lets make it "opt in" :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85446 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 23:59:40 +00:00
Ted Kremenek
e8ec699167
Unused ivars checker: also check methods in categories that are defined in the same translation unit. Fixes <rdar://problem/6260004>.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 22:18:22 +00:00
Steve Naroff
27d20a24a1
Fix <rdar://problem/7330784>. Avoid crashing on 'Class<p>' when generating meta-data for a class.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85440 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 22:03:49 +00:00
Mike Stump
460d138c19
Refine __builtin_object_size. Don't try and get a size for things
...
that don't have sizes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85435 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 21:22:24 +00:00
Fariborz Jahanian
d7a4a436ef
Minor cleanup.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 21:07:28 +00:00
Fariborz Jahanian
ae013b9da6
Code gen for array construction - WIP
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85432 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:55:41 +00:00
Steve Naroff
f96b524306
Remove _clang_initCXLookupHint() and _clang_getCursorWithHint(). Related to <rdar://problem/7310688>.
...
Localize the optimization to ResolveLocationInAST(). The last valid AST location is now stored with ASTUnit. There still isn't optimal, however it's an improvement (with a much cleaner API). Having the client manage an "hint" is error prone and complex.
I wanted to land the major changes before finishing up the optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85425 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:44:47 +00:00
Mike Stump
7d0f5c9ca1
Refactor a bit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85424 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:44:03 +00:00
Ted Kremenek
8fa3a1a673
Pull ivar scanning logic into another utility function. This refactoring will enable scanning
...
categories as well (WIP). No functionality change yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85423 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:37:47 +00:00
Chris Lattner
85e74acfcf
factor a creation of Int32Ty.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 20:36:47 +00:00
Fariborz Jahanian
680a3f3581
Use array's base element type in getting to its
...
constructor. WIP.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 19:04:36 +00:00
Fariborz Jahanian
c0fcce4614
Removed an unnecessary arguement passed to InitializeVarWithConstructor
...
which should come from the variable and wasn't correct for arrays in any case.
No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85415 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:41:06 +00:00
Fariborz Jahanian
a662e05287
Restored note on pointer to members with a pointer
...
to issue involved.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85409 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 18:06:53 +00:00
Chris Lattner
eb99b01897
random tidying
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85408 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 17:39:19 +00:00
Fariborz Jahanian
4efd398b14
Removed a Note related to pointer to member functions which
...
does not seem to exist any longer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85405 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 17:25:01 +00:00
Fariborz Jahanian
5de245058d
Diagnose use of data pointer member in a function call
...
expression instead of crashing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85401 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 16:49:46 +00:00
Douglas Gregor
457e2815d4
Mangle based on the declaration we're given, not the canonical
...
declaration, since attributes that affect mangling may have been added
to subsequent declarations. However, to determine the linkage of the
declaration, we need to look at the canonical declaration. Fixes PR4412.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85400 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 16:31:34 +00:00
Edward O'Callaghan
e7e18200e6
Fix for PR4887, Credit to Jonathan Gray.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85392 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-28 15:13:08 +00:00