Anders Carlsson
6e8f550439
Handle MemberExprs in ResolveAddressOfOverloadedFunction.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83495 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:26:29 +00:00
John McCall
71fdaf4c5e
Dead code elimination.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 22:04:40 +00:00
Fariborz Jahanian
0351a1e2e1
Fixes problem in finding visible convertion functions of a class
...
where matching conversion types in base classes were still visible.
Plus refactoring and cleanup.
Added a test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83485 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 20:43:36 +00:00
Douglas Gregor
0a4074768a
Diagnose explicit instantiations and specializations that occur in class scope
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83473 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:30:37 +00:00
Fariborz Jahanian
ca4fb04b5c
When building candidate set for built-ins; when looking for
...
convesion functions, look in base classes to.
(Removes a FIXME).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83472 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:26:09 +00:00
Douglas Gregor
7974c3b706
Class template partial specializations can be declared anywhere that
...
its definition may be defined, including in a class.
Also, put in an assertion when trying to instantiate a class template
partial specialization of a member template, which is not yet
implemented.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83469 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 17:21:34 +00:00
Fariborz Jahanian
4303697cbc
Removed couple of unnecessary canonicalization
...
per Doug's obsevation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83464 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 16:56:50 +00:00
Ted Kremenek
55bac53391
Revert r83443.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 03:21:11 +00:00
Anders Carlsson
c4355b6883
Mangle anonymous structs/unions correctly. Fixes PR5139.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83448 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 01:45:02 +00:00
Mike Stump
44da821078
Fixup pathnames.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83443 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 01:11:54 +00:00
Anders Carlsson
b540491851
Add a MangleContext and pass it to all mangle functions. It will be used for keeping state, such as identifiers assigned to anonymous structs as well as scope encoding.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 01:06:45 +00:00
Ted Kremenek
5fe4d9deb5
Change ExplodedNode to have its NodeGroups all BumpPtrAllocated, avoiding malloc() traffic when adding successors/predecessors to a node. This was done by introducing BumpVector, which is essentially SmallVector with all memory being BumpPtrAllocated (this can certainly be cleaned up or moved into llvm/ADT).
...
This change yields a 1.8% speed increase when running the analyzer (with -analyzer-store=region) on a small benchmark file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83439 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:42:52 +00:00
Douglas Gregor
d5cb8765ad
Refactor checking of the scope of explicit template specialization
...
declarations and explicit template instantiations, improving
diagnostics and making the code usable for function template
specializations (as well as class template specializations and partial
specializations).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-07 00:13:32 +00:00
Mike Stump
82109bd64a
Fix eof.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:38:59 +00:00
Fariborz Jahanian
4657a99274
Patch to implement C++ [over.built]p11 of overload resolution.
...
Doug, please review. There is a FIXME in the test case with a question
which is unrelated to this patch (that is, error is issued
before set of builtins are added to the candidate list).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83429 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:08:05 +00:00
Anders Carlsson
edee783ed3
Uncomment some commented out code.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83428 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 23:02:00 +00:00
Anders Carlsson
2f1986b557
Change GetAddressCXXOfBaseClass to use CXXBasePaths for calculating base class offsets. Fix the code to handle virtual bases as well.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83426 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 22:43:30 +00:00
Anders Carlsson
b217c1b9d2
When mangling names, always use the canonical decl. Fixes PR5144.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83420 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 21:58:01 +00:00
Devang Patel
6e461bf753
InsertSubprogramStart if ATTACH_DEBUG_INFO_TO_AN_INSN is not defined.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83419 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 21:53:41 +00:00
Douglas Gregor
13d2d6cfd6
Test explicit specialization for all of the various cases where
...
explicit specializations can occur. Also, fix a minor recovery bug
where we should allow declarations coming from the parser to be NULL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83416 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 21:27:51 +00:00
Devang Patel
bbd9fa4b4a
Add support to attach debug info to an instruction.
...
This is not yet enabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83399 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 18:36:08 +00:00
Anders Carlsson
c33e4ba203
Emit the destructor epilogue in a cleanup block so a return from a destructor body still calls the epilogue.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83397 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 18:09:57 +00:00
Douglas Gregor
a8f32e0965
Refactor the code that walks a C++ inheritance hierarchy, searching
...
for bases, members, overridden virtual methods, etc. The operations
isDerivedFrom and lookupInBases are now provided by CXXRecordDecl,
rather than by Sema, so that CodeGen and other clients can use them
directly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83396 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 17:59:45 +00:00
Anders Carlsson
b299d3516d
Pass the right type to GetAddrOfFunction when getting functions for the VTable. Fixes PR5021.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83395 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 17:54:23 +00:00
Rafael Espindola
6961fdd661
Add the -nostdclanginc option to clang (the driver).
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 12:45:37 +00:00
Ted Kremenek
9e8710b2ca
Fix 'clang-cc -analyzer-display-progress' by flushing standard error after printing the name of the analyzed function.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83369 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 03:49:25 +00:00
Ted Kremenek
b1d042212f
Fix crash introduced by r83358 where a symbol could be eagerly
...
evaluated to an APSInt with a different bitwidth than the other
operand in a binary expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83368 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 03:44:49 +00:00
Ted Kremenek
cd8f6ac9b6
Fix: <rdar://problem/7275774> Static analyzer warns about NULL pointer when
...
adding assert
This fix required a few changes:
SimpleSValuator:
- Eagerly replace a symbolic value with its constant value in EvalBinOpNN
when it is constrained to a constant. This allows us to better constant fold
values along a path.
- Handle trivial case of '<', '>' comparison of pointers when the two pointers
are exactly the same.
RegionStoreManager:
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:39:48 +00:00
Rafael Espindola
2e9f652d53
Refactor the c++ include path a bit.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 01:33:02 +00:00
Devang Patel
979ec2e5ee
Set appropriate context for a global variable while emitting debug info.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83352 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:35:31 +00:00
Fariborz Jahanian
56fc0d18ca
Refixed pr5086 by letting Expr::isNullPointerConstant
...
handle checking for a null pointer for a zero-valued
enumerator; moving the test case from CodeGen to Sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83350 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-06 00:09:31 +00:00
Mike Stump
bd6dbd1978
Fix thinko and simplify.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83342 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 23:08:21 +00:00
Mike Stump
fb51ddfafc
Ensure we have atleast 2-byte alignment for member functions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83337 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 22:49:20 +00:00
Mike Stump
f55314dce9
Respect alignments better.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83328 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 21:58:44 +00:00
Fariborz Jahanian
b106fc635b
tweaked my last patch to 1) preserve the protocol in
...
extension class's protocol list so its AST is complete.
2) Because of this no need to issue warning on unimplemeted
methods coming from the extended class protocols
because warning is issued when class definition is seen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83326 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 21:32:49 +00:00
Douglas Gregor
445e23e9b9
Encode the Clang branch and Subversion revision into a PCH file, and
...
assume that PCH files from different Clang revisions are not
compatible. Addresses <rdar://problem/7266572>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83323 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 21:07:28 +00:00
Fariborz Jahanian
339798eae1
Patch to implement Protocols on class extensions.
...
<rdar://problem/7269631> Protocols on class extensions don't work
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83322 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 20:41:32 +00:00
Douglas Gregor
b8d1191fde
Provide a common set of routines in Version.h that return Subversion
...
branch/revision information. Use that information in the driver,
rather than one-off branch/revision computation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83321 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 20:33:49 +00:00
Douglas Gregor
60b5d8ed59
Pre-commit commit to get URL keyword expansion for Clang version information
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83319 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 18:52:24 +00:00
Benjamin Kramer
ffbb15e54a
Use new predicates for some type equality tests.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83303 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-05 13:47:21 +00:00
Anders Carlsson
719aa44de4
Pass the canonical method decl to GetVtableIndex. Fixes PR5120.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83272 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 19:56:56 +00:00
Anders Carlsson
375c31c467
Implement code generation of member function pointer calls. Fixes PR5121.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 19:43:08 +00:00
Anders Carlsson
83ccfc3cf0
Create CXXMemberCallExpr for pointer-to-member calls.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 17:40:22 +00:00
Anders Carlsson
26bc220377
Ignore No-op casts when evaluating lvalue expressions. Fixes PR5122.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 16:30:22 +00:00
Anders Carlsson
a024d17048
Teach AggExprEmitter about pointers to member functions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 15:43:24 +00:00
Anders Carlsson
2c51f092e4
Handle base-to-derived casts of member function pointers in CGExprConstant.cpp
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83265 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 15:13:22 +00:00
Anders Carlsson
f57b4e44d0
Handle members to function pointers in CGExprConstant.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83264 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 15:02:02 +00:00
Anders Carlsson
2b3583573b
Move some functions from CodeGenFunctions to CodeGenModule so they can be used by CGExprConstant.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83263 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-03 14:56:57 +00:00
Anders Carlsson
2df96e7019
Don't update the struct alignment when adding fields to a packed struct. Fixes PR5118.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83235 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 04:52:12 +00:00
Mike Stump
3d363c596d
More magic pixie dust.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-02 02:30:50 +00:00