]> granicus.if.org Git - clang/log
clang
14 years agoImprove source-location information for builtin TypeLocs, from Enea
Douglas Gregor [Mon, 18 Jan 2010 18:04:31 +0000 (18:04 +0000)]
Improve source-location information for builtin TypeLocs, from Enea
Zaffanella (with a couple of my tweaks).

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

14 years agoDon't build/install clang++ in CLANG_IS_PRODUCTION build mode yet.
Daniel Dunbar [Mon, 18 Jan 2010 17:52:48 +0000 (17:52 +0000)]
Don't build/install clang++ in CLANG_IS_PRODUCTION build mode yet.

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

14 years agoFix -Asserts warning.
Daniel Dunbar [Mon, 18 Jan 2010 17:52:42 +0000 (17:52 +0000)]
Fix -Asserts warning.

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

14 years agoFix race condition in creating objdir.
Daniel Dunbar [Mon, 18 Jan 2010 17:52:37 +0000 (17:52 +0000)]
Fix race condition in creating objdir.

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

14 years agoEncoding calling conventions in the type system, from Charles Davis!
Douglas Gregor [Mon, 18 Jan 2010 17:14:39 +0000 (17:14 +0000)]
Encoding calling conventions in the type system, from Charles Davis!

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

14 years agoMore VTT builder fixes. With these fixes we now correctly handle the very complex...
Anders Carlsson [Mon, 18 Jan 2010 17:13:59 +0000 (17:13 +0000)]
More VTT builder fixes. With these fixes we now correctly handle the very complex VTT example from the Itanium ABI spec.

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

14 years agoAdd support for computing size in elements for symbolic regions obtained from
Zhongxing Xu [Mon, 18 Jan 2010 08:54:31 +0000 (08:54 +0000)]
Add support for computing size in elements for symbolic regions obtained from
malloc().

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

14 years agoMove some common code into BuildVTT.
Anders Carlsson [Mon, 18 Jan 2010 04:45:46 +0000 (04:45 +0000)]
Move some common code into BuildVTT.

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

14 years agoFix a bunch of VTT layout bugs, add simple tests for VTT layout.
Anders Carlsson [Mon, 18 Jan 2010 04:25:18 +0000 (04:25 +0000)]
Fix a bunch of VTT layout bugs, add simple tests for VTT layout.

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

14 years agoAdd test case for pr6069.
Zhongxing Xu [Mon, 18 Jan 2010 04:01:40 +0000 (04:01 +0000)]
Add test case for pr6069.

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

14 years agoUpdate virt.cpp for changes to the LLVM asm printer (?) This test should really be...
Anders Carlsson [Mon, 18 Jan 2010 03:58:13 +0000 (03:58 +0000)]
Update virt.cpp for changes to the LLVM asm printer (?) This test should really be all LLVM IR...

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

14 years agoIf the symbol has not been tracked, do not free it. This is possible when free
Zhongxing Xu [Mon, 18 Jan 2010 03:27:34 +0000 (03:27 +0000)]
If the symbol has not been tracked, do not free it. This is possible when free
is called on a pointer that does not get its value directly from malloc.

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

14 years agoMinor VTT builder cleanup, no functionality change.
Anders Carlsson [Sun, 17 Jan 2010 23:53:20 +0000 (23:53 +0000)]
Minor VTT builder cleanup, no functionality change.

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

14 years agoGet the ctor vtable address points directly from the VTT builder.
Anders Carlsson [Sun, 17 Jan 2010 17:10:44 +0000 (17:10 +0000)]
Get the ctor vtable address points directly from the VTT builder.

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

14 years agoPR6055: fix FreeBSD c++ include path. patch by Roman Divacky
Nuno Lopes [Sun, 17 Jan 2010 00:00:11 +0000 (00:00 +0000)]
PR6055: fix FreeBSD c++ include path. patch by Roman Divacky

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

14 years agoIntroduce a second queue of "local" pending implicit instantiation,
Douglas Gregor [Sat, 16 Jan 2010 22:29:39 +0000 (22:29 +0000)]
Introduce a second queue of "local" pending implicit instantiation,
which are instantiations of the member functions of local
classes. These implicit instantiations have to occur at the same time
as---and in the same local instantiation scope as---the enclosing
function, since the member functions of the local class can refer to
locals within the enclosing function. This should really, really fix PR5764.

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

14 years agoAdd PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr...
Sam Weinig [Sat, 16 Jan 2010 21:21:01 +0000 (21:21 +0000)]
Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr.

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

14 years agoWhile determining when to parse inline member functions of a class,
Douglas Gregor [Sat, 16 Jan 2010 20:52:59 +0000 (20:52 +0000)]
While determining when to parse inline member functions of a class,
distinguish between nested classes (whose member functions cannot be
parsed until the innermost non-nested class is complete) and local
classes (that are defined within a function but are not necessarily
nested). The upshot of this change, which fixes PR5764, is that the
bodies of member functions of local (non-nested) classes need to be
parsed when the local class is complete (and no later), since they may
refer to function-local static variables, typedefs, enums, etc.

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

14 years agoWhen we are instantiating a member function of a local class, be sure
Douglas Gregor [Sat, 16 Jan 2010 20:21:20 +0000 (20:21 +0000)]
When we are instantiating a member function of a local class, be sure
to merge the local instantiation scope with the outer local
instantiation scope, so that we can instantiate declarations from the
function owning the local class. Fixes an assert while instantiating
Boost.MPL's BOOST_MPL_ASSERT_MSG.

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

14 years agoFix a rewriting crash and correct rewriting of __block
Fariborz Jahanian [Sat, 16 Jan 2010 19:36:43 +0000 (19:36 +0000)]
Fix a rewriting crash and correct rewriting of __block
declaration where its initializer has a type-cast.

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

14 years agoImprove the test for unused-expression warnings slightly
Douglas Gregor [Sat, 16 Jan 2010 18:17:21 +0000 (18:17 +0000)]
Improve the test for unused-expression warnings slightly

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

14 years agoPartial fix for PR6022, where we were complaining when a friend
Douglas Gregor [Sat, 16 Jan 2010 18:09:52 +0000 (18:09 +0000)]
Partial fix for PR6022, where we were complaining when a friend
function template declared within a class template did not match a
function in another scope. We really need to rework how
friends-in-templates are semantically checked.

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

14 years agoGive ObjCClassRef cursors a sane representation, which is encapsulated
Douglas Gregor [Sat, 16 Jan 2010 17:14:40 +0000 (17:14 +0000)]
Give ObjCClassRef cursors a sane representation, which is encapsulated
in CXCursor.cpp. With this sane representation, fix the class
reference that is part of Objective-C category declarations so that
the cursor's location matches up with the reference, not the class
being referred to.

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

14 years agoImprove location information for Objective-C category declarations. We
Douglas Gregor [Sat, 16 Jan 2010 16:38:58 +0000 (16:38 +0000)]
Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.

The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.

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

14 years agoUse a sane encoding for CXCursor_ObjCProtocolRef, using the actual
Douglas Gregor [Sat, 16 Jan 2010 15:44:18 +0000 (15:44 +0000)]
Use a sane encoding for CXCursor_ObjCProtocolRef, using the actual
source locations where the protocols were referenced rather than the
location of some random enclosing declaration.

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

14 years agoKeep track of the source locations for each protocol reference in
Douglas Gregor [Sat, 16 Jan 2010 15:02:53 +0000 (15:02 +0000)]
Keep track of the source locations for each protocol reference in
Objective-C classes, protocol definitions, forward protocol
declarations, and categories. This information isn't actually used
yet; that's coming next.

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

14 years agoGive CXCursor_ObjCSuperClassRef a sane encoding, which is only known
Douglas Gregor [Sat, 16 Jan 2010 14:00:32 +0000 (14:00 +0000)]
Give CXCursor_ObjCSuperClassRef a sane encoding, which is only known
to CXCursor.cpp.

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

14 years agoFix a use of uninitialized memory in overload diagnostics.
John McCall [Sat, 16 Jan 2010 03:50:16 +0000 (03:50 +0000)]
Fix a use of uninitialized memory in overload diagnostics.

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

14 years agoAdd mapping from ObjCPropertDecl to CXCursorKind.
Ted Kremenek [Sat, 16 Jan 2010 02:08:29 +0000 (02:08 +0000)]
Add mapping from ObjCPropertDecl to CXCursorKind.

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

14 years agoRemove 'default' case in switch statement in clang_getCursorKindSpelling(). This...
Ted Kremenek [Sat, 16 Jan 2010 02:02:09 +0000 (02:02 +0000)]
Remove 'default' case in switch statement in clang_getCursorKindSpelling().  This identified a missing case (warned by the compiler) and identified that CXCursor_FirstDecl didn't actually correspond to the first decl.

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

14 years agoRemove TranslateKind and centralize Decl -> CXCursorKind in GetCursorKind(). This...
Ted Kremenek [Sat, 16 Jan 2010 01:44:12 +0000 (01:44 +0000)]
Remove TranslateKind and centralize Decl -> CXCursorKind in GetCursorKind().  This revealed a bunch of inconsistencies in how CXCursorKinds were being computed.

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

14 years agoAdd codgen for BI__builtin_llvm_memory_barrier.
Tanya Lattner [Sat, 16 Jan 2010 01:21:14 +0000 (01:21 +0000)]
Add codgen for BI__builtin_llvm_memory_barrier.

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

14 years agoThe codegen for these builtins was removed long ago, but their definitions remained...
Tanya Lattner [Sat, 16 Jan 2010 01:10:51 +0000 (01:10 +0000)]
The codegen for these builtins was removed long ago, but their definitions remained. Removing them totally.

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

14 years agoFix crash generating debug info for constructor for anonymous struct.
Eli Friedman [Sat, 16 Jan 2010 00:43:13 +0000 (00:43 +0000)]
Fix crash generating debug info for constructor for anonymous struct.

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

14 years agoMigrate Decl* -> cursorkind logic into CXCursor.cpp, and drastically tighten TUVisitor.
Ted Kremenek [Sat, 16 Jan 2010 00:36:30 +0000 (00:36 +0000)]
Migrate Decl* -> cursorkind logic into CXCursor.cpp, and drastically tighten TUVisitor.

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

14 years agoMake the AST explicitly represent the cast of the first operand of a
Eli Friedman [Sat, 16 Jan 2010 00:00:48 +0000 (00:00 +0000)]
Make the AST explicitly represent the cast of the first operand of a
pointer-to-member operator.

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

14 years agoRemove unused code.
Ted Kremenek [Fri, 15 Jan 2010 23:35:12 +0000 (23:35 +0000)]
Remove unused code.

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

14 years agoRefactor USR logic for EnumDecls and RecordDecls so that both handle 'anonymous'...
Ted Kremenek [Fri, 15 Jan 2010 23:34:31 +0000 (23:34 +0000)]
Refactor USR logic for EnumDecls and RecordDecls so that both handle 'anonymous' declarations in the same way.

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

14 years agoGeneralize handling for unreachable code warnings to all binary operators.
Mike Stump [Fri, 15 Jan 2010 23:33:51 +0000 (23:33 +0000)]
Generalize handling for unreachable code warnings to all binary operators.

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

14 years agoCandidates with arity mismatches are extra-special non-viable and need to
John McCall [Fri, 15 Jan 2010 23:32:50 +0000 (23:32 +0000)]
Candidates with arity mismatches are extra-special non-viable and need to
stand at the back of the line.

Thanks to Oliver Hunt for reminding me to do this.

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

14 years agoRefine location reporting for unreachable code warnings for comma expressions.
Mike Stump [Fri, 15 Jan 2010 23:17:13 +0000 (23:17 +0000)]
Refine location reporting for unreachable code warnings for comma expressions.

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

14 years agoUSR generation: look at the typedef of an anonymous struct (if any) when trying to...
Ted Kremenek [Fri, 15 Jan 2010 23:08:25 +0000 (23:08 +0000)]
USR generation: look at the typedef of an anonymous struct (if any) when trying to generate a USR.

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

14 years agodefine __weak to null in rewritten source for
Fariborz Jahanian [Fri, 15 Jan 2010 22:29:39 +0000 (22:29 +0000)]
define __weak to null in rewritten source for
-fms-extensions as well.

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

14 years agoMake CXCursor's data opaque.
Douglas Gregor [Fri, 15 Jan 2010 21:56:13 +0000 (21:56 +0000)]
Make CXCursor's data opaque.

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

14 years agoMake LookupResult::resolveKind() robust against NotFoundInCurrentInstantiation.
John McCall [Fri, 15 Jan 2010 21:27:01 +0000 (21:27 +0000)]
Make LookupResult::resolveKind() robust against NotFoundInCurrentInstantiation.
Fixes PR 6049.

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

14 years agoAdd CXCursor.[h,cpp]. These files will centralize the logic for creating/probing...
Ted Kremenek [Fri, 15 Jan 2010 20:35:54 +0000 (20:35 +0000)]
Add CXCursor.[h,cpp].  These files will centralize the logic for creating/probing CXCursors.

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

14 years agoFix a couple bugs in copy assignment operator synthesis.
Eli Friedman [Fri, 15 Jan 2010 20:06:11 +0000 (20:06 +0000)]
Fix a couple bugs in copy assignment operator synthesis.

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

14 years agoAdd USR generation for enums.
Ted Kremenek [Fri, 15 Jan 2010 20:04:31 +0000 (20:04 +0000)]
Add USR generation for enums.

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

14 years agoAdd -cursor-at=file:line:column command line option to c-index-test,
Douglas Gregor [Fri, 15 Jan 2010 19:40:17 +0000 (19:40 +0000)]
Add -cursor-at=file:line:column command line option to c-index-test,
to directly check the results of clang_getCursor(). Also, start
migrating some index-test tests over to c-index test [*] and some
grep-using tests over to FileCheck.

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

14 years agoPreserve type source information for C++ named casts through template
John McCall [Fri, 15 Jan 2010 19:13:16 +0000 (19:13 +0000)]
Preserve type source information for C++ named casts through template
instantiation.

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

14 years agoDon't lose type source information when rebuilding C-style cast expressions.
John McCall [Fri, 15 Jan 2010 18:56:44 +0000 (18:56 +0000)]
Don't lose type source information when rebuilding C-style cast expressions.
Also we don't need to recheck for altivec initializers, I think.

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

14 years agoPreserve type source information in explicit cast expressions.
John McCall [Fri, 15 Jan 2010 18:39:57 +0000 (18:39 +0000)]
Preserve type source information in explicit cast expressions.
Patch by Enea Zaffanella.

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

14 years agogetLocationFromCursor: If a cursor is a reference and has a referringDecl, using...
Ted Kremenek [Fri, 15 Jan 2010 18:24:18 +0000 (18:24 +0000)]
getLocationFromCursor: If a cursor is a reference and has a referringDecl, using the referringDecl for the location.

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

14 years agoDo not do the block-specific rewrite when there is no block literals.
Fariborz Jahanian [Fri, 15 Jan 2010 18:14:52 +0000 (18:14 +0000)]
Do not do the block-specific rewrite when there is no block literals.
Fixes radar 7546096.

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

14 years agoWhen determining whether a DeclRefExpr is value-dependent when it
Douglas Gregor [Fri, 15 Jan 2010 16:21:02 +0000 (16:21 +0000)]
When determining whether a DeclRefExpr is value-dependent when it
references a const variable of integral type, the initializer may be
in a different declaration than the one that name-lookup saw. Find the
initializer anyway. Fixes PR6045.

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

14 years agoWhen determining whether the type is the current instantiation, strip
Douglas Gregor [Fri, 15 Jan 2010 16:05:33 +0000 (16:05 +0000)]
When determining whether the type is the current instantiation, strip
qualifiers. Fixes PR6021.

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

14 years agoConvert the type of the LValue offset variable in APValue to CharUnits, moving
Ken Dyck [Fri, 15 Jan 2010 12:37:54 +0000 (12:37 +0000)]
Convert the type of the LValue offset variable in APValue to CharUnits, moving
the LValue-related methods of APValue out of line to avoid header file leaching.

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

14 years agoDon't repeat lookup when instantiating resolved member expressions.
John McCall [Fri, 15 Jan 2010 08:34:02 +0000 (08:34 +0000)]
Don't repeat lookup when instantiating resolved member expressions.
Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit
member accesses, which can arise from unqualified lookups and therefore may
reference decls from enclosing class scopes.

Fixes PR 5838.

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

14 years agoDon't suggest the developer use 'arc4random' instead of 'rand' when that function...
Ted Kremenek [Fri, 15 Jan 2010 08:20:31 +0000 (08:20 +0000)]
Don't suggest the developer use 'arc4random' instead of 'rand' when that function is not available.  Fixes PR 6012.

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

14 years agoTeach BugReporter to "escape" the occurance of '%' characters in diagnostic messages...
Ted Kremenek [Fri, 15 Jan 2010 07:56:51 +0000 (07:56 +0000)]
Teach BugReporter to "escape" the occurance of '%' characters in diagnostic messages when emitted results to the standard Diagnostics output.  Fixes PR 6033.

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

14 years agoConvert a few more uses of std::string& to llvm::StringRef.
Ted Kremenek [Fri, 15 Jan 2010 07:43:59 +0000 (07:43 +0000)]
Convert a few more uses of std::string& to llvm::StringRef.

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

14 years agoAdd testcase for recent checkin.
Mike Stump [Fri, 15 Jan 2010 03:15:36 +0000 (03:15 +0000)]
Add testcase for recent checkin.

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

14 years agoRefine unreachable warnings. WIP.
Mike Stump [Fri, 15 Jan 2010 02:06:42 +0000 (02:06 +0000)]
Refine unreachable warnings.  WIP.

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

14 years agoWhen performing qualified name lookup into the current instantiation,
Douglas Gregor [Fri, 15 Jan 2010 01:44:47 +0000 (01:44 +0000)]
When performing qualified name lookup into the current instantiation,
do not look into base classes if there are any dependent base
classes. Instead, note in the lookup result that we couldn't look into
any dependent bases. Use that new result kind to detect when this case
occurs, so that we can fall back to treating the type/value/etc. as a
member of an unknown specialization.

Fixes an issue where we were resolving lookup at template definition
time and then missing an ambiguity at template instantiation time.

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

14 years agoFix Release-Asserts for the time being.
Mike Stump [Fri, 15 Jan 2010 00:50:35 +0000 (00:50 +0000)]
Fix Release-Asserts for the time being.

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

14 years agoPatch to avoid duplicate declaration of byref structs
Fariborz Jahanian [Thu, 14 Jan 2010 23:05:52 +0000 (23:05 +0000)]
Patch to avoid duplicate declaration of byref structs
for __block variables of same name declared in multiple scopes.
Fixes radar 7540194

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

14 years agoEmit linkage name even if it matches regular name. The code generator uses linkage...
Devang Patel [Thu, 14 Jan 2010 21:46:57 +0000 (21:46 +0000)]
Emit linkage name even if it matches regular name. The code generator uses linkage name to find subprogram entry for the current function.

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

14 years agoForgot to commit these
Anton Korobeynikov [Thu, 14 Jan 2010 21:36:52 +0000 (21:36 +0000)]
Forgot to commit these

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

14 years agofix grammaro
Chris Lattner [Thu, 14 Jan 2010 21:00:58 +0000 (21:00 +0000)]
fix grammaro

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

14 years agolong long is 64 bits on msp430
Anton Korobeynikov [Thu, 14 Jan 2010 20:22:45 +0000 (20:22 +0000)]
long long is 64 bits on msp430

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

14 years agoPre-emptive bugfixes in the diagnostics code: allow arbitrary punctuation
John McCall [Thu, 14 Jan 2010 20:11:39 +0000 (20:11 +0000)]
Pre-emptive bugfixes in the diagnostics code:  allow arbitrary punctuation
characters to be escaped and implement a scan-forward function which
properly respects brace nesting.

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

14 years agoSimplify test case. This test case also applies to PR 6013.
Ted Kremenek [Thu, 14 Jan 2010 19:47:50 +0000 (19:47 +0000)]
Simplify test case.  This test case also applies to PR 6013.

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

14 years agoAssociate test case with Bugzilla PR.
Ted Kremenek [Thu, 14 Jan 2010 19:38:41 +0000 (19:38 +0000)]
Associate test case with Bugzilla PR.

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

14 years agoDocument the extensions I made to the diagnostics-formatting system yesterday.
John McCall [Thu, 14 Jan 2010 19:12:17 +0000 (19:12 +0000)]
Document the extensions I made to the diagnostics-formatting system yesterday.

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

14 years agoAfter dyn_cast'ing, it generally makes sense to check the *output* of
Douglas Gregor [Thu, 14 Jan 2010 18:13:22 +0000 (18:13 +0000)]
After dyn_cast'ing, it generally makes sense to check the *output* of
the dyn_cast against NULL rather than the *input*. Fixes PR6025.

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

14 years agoAdd comment.
Devang Patel [Thu, 14 Jan 2010 18:06:13 +0000 (18:06 +0000)]
Add comment.

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

14 years agoWhen qualified lookup into the current instantiation fails (because it
Douglas Gregor [Thu, 14 Jan 2010 17:47:39 +0000 (17:47 +0000)]
When qualified lookup into the current instantiation fails (because it
finds nothing), and the current instantiation has dependent base
classes, treat the qualified lookup as if it referred to an unknown
specialization. Fixes PR6031.

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

14 years agoSwitch a few callers of MaybeAddResult over to AddResult, when the
Douglas Gregor [Thu, 14 Jan 2010 16:14:35 +0000 (16:14 +0000)]
Switch a few callers of MaybeAddResult over to AddResult, when the
declarations we're adding do not need any name-hiding checks.

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

14 years agoSwitch code-completion's ivar lookup over to LookupVisibleDecls,
Douglas Gregor [Thu, 14 Jan 2010 16:08:12 +0000 (16:08 +0000)]
Switch code-completion's ivar lookup over to LookupVisibleDecls,
eliminating yet one more ResultBuilder::MaybeAddResult caller.

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

14 years agoStart migrating code-completion results from
Douglas Gregor [Thu, 14 Jan 2010 16:01:26 +0000 (16:01 +0000)]
Start migrating code-completion results from
ResultBuilder::MaybeAddResult over to ResultBuilder::AddResult.

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

14 years agoSwitch the remaining code completions over to LookupVisibleDecls,
Douglas Gregor [Thu, 14 Jan 2010 15:47:35 +0000 (15:47 +0000)]
Switch the remaining code completions over to LookupVisibleDecls,
after adding the ability to determine whether our lookup is a
base-class lookup. Eliminate CollectMemberLookupResults, since it is
no longer used (yay).

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

14 years agoMade ObjC method name mangling match GCC (which does it in a stupid and broken way...
David Chisnall [Thu, 14 Jan 2010 14:08:19 +0000 (14:08 +0000)]
Made ObjC method name mangling match GCC (which does it in a stupid and broken way that can give conflicts on method names containing underscores, but is needed for gdb to work because gdb does not know how to read ObjC class tables and relies on the mangling).

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

14 years agoFix pr6035.
Zhongxing Xu [Thu, 14 Jan 2010 03:45:06 +0000 (03:45 +0000)]
Fix pr6035.

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

14 years agoMove code completion for qualified name lookup (foo::) to
Douglas Gregor [Thu, 14 Jan 2010 03:35:48 +0000 (03:35 +0000)]
Move code completion for qualified name lookup (foo::) to
LookupVisibleDecls. Also, a function does not hide another function.

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

14 years agoImprove overload diagnostics some more by calling out qualifier mismatches
John McCall [Thu, 14 Jan 2010 03:28:57 +0000 (03:28 +0000)]
Improve overload diagnostics some more by calling out qualifier mismatches
for special diagnostics.  Unfortunately, the non-overload diagnostics are not
this good.

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

14 years agoEliminate the code-completion-specifier CollectLookupResults in favor
Douglas Gregor [Thu, 14 Jan 2010 03:27:13 +0000 (03:27 +0000)]
Eliminate the code-completion-specifier CollectLookupResults in favor
of the more general LookupVisibleDecls.

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

14 years agoSimplify the code-completion logic for nested-name-specifiers: rather
Douglas Gregor [Thu, 14 Jan 2010 03:21:49 +0000 (03:21 +0000)]
Simplify the code-completion logic for nested-name-specifiers: rather
than traversing visible declarations twice, only perform one traversal
and recognize nested-name-specifiers as special.

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

14 years agoDon't assume a random access iterator, instead just use CFG::iterator.
Mike Stump [Thu, 14 Jan 2010 02:45:29 +0000 (02:45 +0000)]
Don't assume a random access iterator, instead just use CFG::iterator.
Thanks Ted.

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

14 years agoStore the address points for constructor vtables directly in the VTT builder, because...
Anders Carlsson [Thu, 14 Jan 2010 02:29:07 +0000 (02:29 +0000)]
Store the address points for constructor vtables directly in the VTT builder, because that's the only time they're needed.

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

14 years agoAvoid snowballing errors into additional warnings. To do better, we'd
Mike Stump [Thu, 14 Jan 2010 02:26:52 +0000 (02:26 +0000)]
Avoid snowballing errors into additional warnings.  To do better, we'd
need an error term for the CFG.  I suspect we'll always have to cope
with getCFG returning 0, though, I'd love to see even that possibility
removed.

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

14 years agoSwitch return site to use clang_getNullCursor().
Ted Kremenek [Thu, 14 Jan 2010 01:51:23 +0000 (01:51 +0000)]
Switch return site to use clang_getNullCursor().

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

14 years agoFurther tweak USR generation by shorting names and distinguish between namespaces...
Ted Kremenek [Thu, 14 Jan 2010 01:50:21 +0000 (01:50 +0000)]
Further tweak USR generation by shorting names and distinguish between namespaces and functions.

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

14 years agoAdd a DenseMapInfo specialization for BaseSubobject.
Anders Carlsson [Thu, 14 Jan 2010 01:39:42 +0000 (01:39 +0000)]
Add a DenseMapInfo specialization for BaseSubobject.

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

14 years agoWhen providing completions for a member access expression in C++,
Douglas Gregor [Thu, 14 Jan 2010 01:17:14 +0000 (01:17 +0000)]
When providing completions for a member access expression in C++,
provided nested-name-specifier results for base classes (only), rather
than everything that could possibly be a nested-name-specifier.

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

14 years agoSwitch code-completion for ordinary names over to the new(ish)
Douglas Gregor [Thu, 14 Jan 2010 01:09:38 +0000 (01:09 +0000)]
Switch code-completion for ordinary names over to the new(ish)
LookupVisibleDecls, unifying the name lookup mechanisms used by code
completion and typo correction. Aside from the software-engineering
improvements, this makes code-completion see through using directives
and see ivars when performing unqualified name lookup in an
Objective-C instance method.

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

14 years agoImprove the diagnostic for bad conversions in overload resolution to talk
John McCall [Thu, 14 Jan 2010 00:56:20 +0000 (00:56 +0000)]
Improve the diagnostic for bad conversions in overload resolution to talk
about 'object argument' vs. 'nth argument'.

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

14 years agoAdd the %ordinal format modifier for turning '1' into '1st'. Hard-coded for
John McCall [Thu, 14 Jan 2010 00:50:32 +0000 (00:50 +0000)]
Add the %ordinal format modifier for turning '1' into '1st'.  Hard-coded for
English right now;  would not be impossible to grab a special format string
from the diagnostic pool and localize that way.

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

14 years agoBecause CurLoc is the current source location as far as CGDebugInfo is concerned...
Devang Patel [Thu, 14 Jan 2010 00:48:09 +0000 (00:48 +0000)]
Because CurLoc is the current source location as far as CGDebugInfo is concerned. It is expected that this is set (usually left bracket location of function body compound statement) before EmitfunctionStart() is used.

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

14 years agoMore refactoring of ResultBuilder::MaybeAddResult. No intended
Douglas Gregor [Thu, 14 Jan 2010 00:41:07 +0000 (00:41 +0000)]
More refactoring of ResultBuilder::MaybeAddResult. No intended
functionality change.

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

14 years agoEmit human readable names for c/c++ functions. Avoid emitting linkage name if it...
Devang Patel [Thu, 14 Jan 2010 00:36:21 +0000 (00:36 +0000)]
Emit human readable names for c/c++ functions. Avoid emitting linkage name if it matches regular name.

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