]>
granicus.if.org Git - clang/log
Anders Carlsson [Wed, 17 Feb 2010 06:07:19 +0000 (06:07 +0000)]
First cut at emitting vcall offsets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96455
91177308 -0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Wed, 17 Feb 2010 04:48:01 +0000 (04:48 +0000)]
Do not add functions marked with the unused attribute to the list of unused functions to warn about. Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96452
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Wed, 17 Feb 2010 03:52:49 +0000 (03:52 +0000)]
Emit complete constructors and destructors as aliases to base constructors
and destructors when the two entities are semantically identical, i.e. when
the class has no virtual base classes. We only do this for linkage types
for which aliases are supported, i.e. internal and external, i.e. not linkonce.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96451
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 17 Feb 2010 03:11:55 +0000 (03:11 +0000)]
Pass through whether a base is virtual or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96449
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Feb 2010 02:37:45 +0000 (02:37 +0000)]
Add IBAction attribute to keep the IBOutlet attribute company.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96447
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sanjiv Gupta [Wed, 17 Feb 2010 02:25:52 +0000 (02:25 +0000)]
implement EmitVAArg. pretty much the same way other targets do.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96446
91177308 -0d34-0410-b5e6-
96231b3b80d8
Tanya Lattner [Wed, 17 Feb 2010 02:17:21 +0000 (02:17 +0000)]
Fix unused function warning to handle used attributes and redeclarations. Update test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96444
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 17 Feb 2010 02:12:47 +0000 (02:12 +0000)]
Implement AST importing and checking for Objective-C method declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96442
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Wed, 17 Feb 2010 02:05:23 +0000 (02:05 +0000)]
Correctly calculate base offsets for 'this' pointer adjustments involving virtual bases. This can't be tested yet due to lack of vcall offsets :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96441
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Feb 2010 01:42:24 +0000 (01:42 +0000)]
Convert clang_getCompletionChunkText() to return a CXString.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96439
91177308 -0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Wed, 17 Feb 2010 00:44:47 +0000 (00:44 +0000)]
Revert r95939, as suggested by Alexandre Julliard from the Wine project (and
our own Chris Lattner).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96431
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Feb 2010 00:41:40 +0000 (00:41 +0000)]
Remove trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96427
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Feb 2010 00:41:32 +0000 (00:41 +0000)]
Change clang_getCursorKindSpelling() to return a CXString
instead of a 'const char *'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96425
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Feb 2010 00:41:20 +0000 (00:41 +0000)]
Change clang_getFileName() to return a 'CXString' instead of 'const char *'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96424
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Wed, 17 Feb 2010 00:41:08 +0000 (00:41 +0000)]
Move createCXString() functions out of CIndexer and into the clang::cxstring namespace.
We can much more succinctly refer to these functions this way.
Also change the default behavior of createCXString(StringRef&) to duplicate the
string. This is almost always what we want. The other case is where we pass
a constant c-string, which uses the other version of createCXString().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96423
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Wed, 17 Feb 2010 00:34:30 +0000 (00:34 +0000)]
Implement AST importing of Objective-C instance variables.
Check superclasses when merging two Objective-C @interfaces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96420
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 16 Feb 2010 22:27:50 +0000 (22:27 +0000)]
More rewriter test converted to compile with clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96406
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 16 Feb 2010 22:13:48 +0000 (22:13 +0000)]
With addition of -Wno-address-of-temporary (thank you Doug) we can now
have rewriter test cases which pass the .cpp file through clang
and also test c++ aspect of clang.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96405
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 16 Feb 2010 22:04:33 +0000 (22:04 +0000)]
IRgen optimization: cache the value of 'this' and 'vtt' instead of
repeatedly reloading from an alloca. We still need to create the alloca
for debug info purposes (although we currently create it in all cases
because of some abstraction boundaries that're hard to break down).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96403
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Tue, 16 Feb 2010 21:41:20 +0000 (21:41 +0000)]
Distinguish two lexical blocks at the same level.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96397
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 16 Feb 2010 21:39:57 +0000 (21:39 +0000)]
Introduce a new kind of failed result for isLvalue/isModifiableLvalue
which describes temporary objects of class type in C++. Use this to
provide a more-specific, remappable diagnostic when takin the address
of such a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96396
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 19:45:20 +0000 (19:45 +0000)]
IRgen: Switch 'retval' to use CreateIRTemp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96376
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 19:44:56 +0000 (19:44 +0000)]
Disable warn_unused_function for now, its breaking various project builds due to
false positives.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96375
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 19:44:13 +0000 (19:44 +0000)]
IRgen: Add CreateIRTemp, which creates a temporary alloca but with type converted "not-for-memory". Dunno a better name.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96374
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 19:43:39 +0000 (19:43 +0000)]
IRgen: Switch EmitCompoundLiteralLValue to use CreateMemTemp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96373
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 16 Feb 2010 19:28:15 +0000 (19:28 +0000)]
Do not try to instantiate invalid declarations. It's a recipe for
disaster. Fixes PR6161.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96371
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 16 Feb 2010 19:09:40 +0000 (19:09 +0000)]
Improve parsing and instantiation of destructor names, so that we can
now cope with the destruction of types named as dependent templates,
e.g.,
y->template Y<T>::~Y()
Nominally, we implement C++0x [basic.lookup.qual]p6. However, we don't
follow the letter of the standard here because that would fail to
parse
template<typename T, typename U>
X0<T, U>::~X0() { }
properly. The problem is captured in core issue 339, which gives some
(but not enough!) guidance. I expect to revisit this code when the
resolution of 339 is clear, and/or we start capturing better source
information for DeclarationNames.
Fixes PR6152.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96367
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Feb 2010 18:29:31 +0000 (18:29 +0000)]
when a diagnostic is an extension and has no other -W flag,
indicate that it was enabled with -pedantic so people know
why they're getting them:
$ printf "int x;" | clang -xc - -pedantic
<stdin>:1:7: warning: no newline at end of file [-pedantic]
int x;
^
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96365
91177308 -0d34-0410-b5e6-
96231b3b80d8
Charles Davis [Tue, 16 Feb 2010 18:27:26 +0000 (18:27 +0000)]
dllimport and dllexport are declspec attributes, too. They're also
Win32-specific.
Also, fix a test to use FileCheck instead of grepping LLVM IR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96364
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Feb 2010 18:21:25 +0000 (18:21 +0000)]
add two aliases for SSE functions we already have, fixing PR6316.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96363
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Feb 2010 18:14:57 +0000 (18:14 +0000)]
add freebsd/ppc[64] support, patch by Nathan Whitehorn, PR6318
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96362
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 16 Feb 2010 17:26:03 +0000 (17:26 +0000)]
Minor rewriter cleanup and a test for a block rewriting bug.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96361
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Feb 2010 16:55:10 +0000 (16:55 +0000)]
Add test case showing that a recursive block that captures a block pointer that
isn't marked '__block' is bad.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96357
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 16 Feb 2010 16:50:08 +0000 (16:50 +0000)]
Add an extreme vbase offsets test. I'm kinda amazed that this works myself ;)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96356
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 16 Feb 2010 16:49:35 +0000 (16:49 +0000)]
Handle layout of vtables for virtual bases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96355
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 16 Feb 2010 16:26:28 +0000 (16:26 +0000)]
Move some code around in preparation for virtual base vtables.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96354
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Tue, 16 Feb 2010 16:21:26 +0000 (16:21 +0000)]
Fix rewriter bug when function call inside block with block parameter
causes C++ compile error (radar
7651312 ).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96352
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 16 Feb 2010 16:02:57 +0000 (16:02 +0000)]
Fix a bug where we would not emit secondary vtables for bases of a primary base.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96351
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Tue, 16 Feb 2010 10:07:31 +0000 (10:07 +0000)]
Rename argument so the name reflects what it's doing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96342
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Feb 2010 08:33:59 +0000 (08:33 +0000)]
Add simpler checker to check if variables captured by a block are uninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96341
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 16 Feb 2010 06:53:13 +0000 (06:53 +0000)]
Support local namespace aliases and permit them to be instantiated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96335
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 16 Feb 2010 04:59:55 +0000 (04:59 +0000)]
Emit vbase offsets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96329
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Tue, 16 Feb 2010 04:49:44 +0000 (04:49 +0000)]
More work on the new layout code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96328
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 16 Feb 2010 04:15:37 +0000 (04:15 +0000)]
When emitting complete destructors for classes with virtual bases, compute
the offset to the virtual bases statically inside of relying on the virtual
base offsets in the object's vtable(s). This is both more efficient and
sound against the destructor's manipulation of the vtables.
Also extract a few helper routines.
Oh and we seem to pass all tests with an optimized clang now.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96327
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 16 Feb 2010 04:10:53 +0000 (04:10 +0000)]
White-list comma expressions with the literal 0 as their RHS against
unused-value warnings. This is a common macro idiom.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96326
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Tue, 16 Feb 2010 03:57:14 +0000 (03:57 +0000)]
Make the various type-decl Types (and their associated ASTContext routines)
accept const decls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96325
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sanjiv Gupta [Tue, 16 Feb 2010 03:37:11 +0000 (03:37 +0000)]
Re-applying 96173. Looks like finally I got the test case right.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96321
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Feb 2010 02:14:24 +0000 (02:14 +0000)]
Add test case to show that Clang now checks the format string
arguments of asprintf (<rdar://problem/
6657191 >).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96319
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 01:55:10 +0000 (01:55 +0000)]
c-index-test: Pass appropriate client data.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96317
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 01:55:04 +0000 (01:55 +0000)]
ASTUnit: Constant fold UseBumpAllocator to true, we don't care to support this as an argument.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96316
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 01:54:54 +0000 (01:54 +0000)]
ASTUnit::LoadFromCompilerInvocation - Take ownership of the provided invocation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96315
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 01:54:47 +0000 (01:54 +0000)]
CompilerInstance: Move LLVMContext member out of constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96314
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 16 Feb 2010 01:54:33 +0000 (01:54 +0000)]
Switch clang to use its own LLVMContext (not the global one).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96313
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Feb 2010 01:47:05 +0000 (01:47 +0000)]
Fix test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96311
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Feb 2010 01:46:59 +0000 (01:46 +0000)]
Refactor the logic for printf argument type-checking into analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.
Fixes <rdar://problem/
3065808 >.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96310
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Tue, 16 Feb 2010 01:46:47 +0000 (01:46 +0000)]
Added 'AsWideChar' flag to LengthModifier.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96309
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 16 Feb 2010 01:20:57 +0000 (01:20 +0000)]
Skeleton for importing Objective-C classes
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96306
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Tue, 16 Feb 2010 00:23:21 +0000 (00:23 +0000)]
mark __builtin_longjmp noreturn, PR6312
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96302
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Tue, 16 Feb 2010 00:04:46 +0000 (00:04 +0000)]
Don't import __va_list_tag or __builtin_va_list when merging
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96299
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 15 Feb 2010 23:54:17 +0000 (23:54 +0000)]
Cope with anonymous tags defined within declarators by structurally
comparing their types under the assumption that they are equivalent,
rather than importing the types and then checking for compatibility. A
few minor tweaks here:
- Teach structural matching to handle compatibility between
function types with prototypes and those without prototypes.
- Teach structural matching that an incomplete record decl is the
same as any other record decl with the same name.
- Keep track of pairs of declarations that we have already checked
(but failed to find as structurally matching), so we don't emit
diagnostics repeatedly.
- When importing a typedef of an anonymous tag, be sure to link the
imported tag type to its typedef.
With these changes, we survive a repeated import of <stdlib.h> and
<stdio.h>. Alas, the ASTNodeImporter is getting a little grotty.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96298
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Mon, 15 Feb 2010 23:02:46 +0000 (23:02 +0000)]
Convert GRExprEngine's handling of ObjCMessageExprs to use a worklist
to evaluate arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96293
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Mon, 15 Feb 2010 22:42:31 +0000 (22:42 +0000)]
Add Sema support for __builtin_fpclassify by extending the existing check for __builtin_isinf and friends. Part of PR6083.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96291
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 15 Feb 2010 22:20:11 +0000 (22:20 +0000)]
Issue a bettter diagnostics for incorrect property setter name.
(radar
7647953 ).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96284
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 15 Feb 2010 22:12:26 +0000 (22:12 +0000)]
Fix instantiation of template functions with local classes that contain virtual
methods.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96283
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 15 Feb 2010 22:05:17 +0000 (22:05 +0000)]
Tell ASTMerge to merge every declaration it sees, rather than cherry-picking those declarations that we know will work.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96280
91177308 -0d34-0410-b5e6-
96231b3b80d8
Douglas Gregor [Mon, 15 Feb 2010 22:01:00 +0000 (22:01 +0000)]
Reimplement the structural-equality checks used to determine whether
two types in different AST contexts are equivalent. Rather than
transforming the type from one context into the other context, we
perform a deep structural comparison of the types. This change
addresses a serious problem with recursive data types like
struct ListNode {
int value;
struct ListNode *Next;
} xList;
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96278
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 15 Feb 2010 21:55:26 +0000 (21:55 +0000)]
Class continuation now has its own property ast for
those declared in it. This is to allow duplicate
property diagnostics for properties declared in class extensions
multiple times (radar
7629420 ) and for future use.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96276
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 15 Feb 2010 21:37:11 +0000 (21:37 +0000)]
Test to compile the rewritten file for my last patch.
(radar
7649577 related).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96274
91177308 -0d34-0410-b5e6-
96231b3b80d8
Fariborz Jahanian [Mon, 15 Feb 2010 21:11:41 +0000 (21:11 +0000)]
Fix a broken rewritin of @implementation keyword.
(fixes radar
7649577 ).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96270
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 15 Feb 2010 19:38:00 +0000 (19:38 +0000)]
Optimize the implementation of IdDeclInfo pooling in the IdentifierResolver.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96253
91177308 -0d34-0410-b5e6-
96231b3b80d8
Devang Patel [Mon, 15 Feb 2010 18:08:38 +0000 (18:08 +0000)]
Use getLocStart(), instead of getLocEnd(), to record starting location of objc method. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96245
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sanjiv Gupta [Mon, 15 Feb 2010 18:02:12 +0000 (18:02 +0000)]
reverting back 96242 as it still causes a test failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96244
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sanjiv Gupta [Mon, 15 Feb 2010 17:19:13 +0000 (17:19 +0000)]
Re-applying 96173 with corresponding changes in test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96242
91177308 -0d34-0410-b5e6-
96231b3b80d8
Duncan Sands [Mon, 15 Feb 2010 16:14:01 +0000 (16:14 +0000)]
Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96224
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chandler Carruth [Mon, 15 Feb 2010 11:53:20 +0000 (11:53 +0000)]
Defer covariance checks for dependent types. Add test cases that also ensure
they are re-checked on instantiation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96217
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Mon, 15 Feb 2010 04:28:35 +0000 (04:28 +0000)]
Simplify code. If we can reach here, the base must be virtual.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96211
91177308 -0d34-0410-b5e6-
96231b3b80d8
John McCall [Mon, 15 Feb 2010 01:23:36 +0000 (01:23 +0000)]
When emitting an aggregate into a temporary, make sure we set the alignment
on the alloca.
The fact that codegen makes this class of bug so wonderfully easy to make is
embarrassing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96204
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 22:58:16 +0000 (22:58 +0000)]
clang::Attr objects should be treated as AST nodes as well by
the LLVMConventionsChecker.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96202
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 19:09:13 +0000 (19:09 +0000)]
Add LLVM conventions check that scans for AST elements (types, stmts, decls)
that allocate heap memory.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96184
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 19:09:05 +0000 (19:09 +0000)]
Change LLVMConventionsChecker to accept an entire translation unit instead
of operating on each code decl. This exposes two flaws in AnalysisConsumer
that should eventually be fixed:
(1) It is not possible to associate multiple "actions" with a single
command line argument. This will require the notion of an
"analysis" group, and possibly tablegen support. (although eventually
we want to support dynamically loading analyses as well)
(2) AnalysisConsumer may not actually be scanning the declarations in namespaces.
We'll experiment first in LLVMConventionsChecker before changing the
behavior in AnalysisConsumer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96183
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 19:08:51 +0000 (19:08 +0000)]
Rework translation unit actions to actually take an entire translation unit
as imput.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96182
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 19:08:43 +0000 (19:08 +0000)]
For the StringRef check, also visit the children of DeclStmts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96181
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 19:08:36 +0000 (19:08 +0000)]
Place type-checking static methods at type of file (where they will congregate).
No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96180
91177308 -0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 14 Feb 2010 18:38:38 +0000 (18:38 +0000)]
temporarily revert 96173, it is causing test failures.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96176
91177308 -0d34-0410-b5e6-
96231b3b80d8
Sanjiv Gupta [Sun, 14 Feb 2010 18:20:18 +0000 (18:20 +0000)]
renamed pic16 specifiic macros.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96173
91177308 -0d34-0410-b5e6-
96231b3b80d8
Anders Carlsson [Sun, 14 Feb 2010 17:05:59 +0000 (17:05 +0000)]
Don't compute final overriders or build vtables for bases that don't need a vtable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96171
91177308 -0d34-0410-b5e6-
96231b3b80d8
Benjamin Kramer [Sun, 14 Feb 2010 14:14:16 +0000 (14:14 +0000)]
Pass StringRefs to InsertText/ReplaceText in RewriteObjC and remove a ton of unnecessary length arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96164
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 10:02:57 +0000 (10:02 +0000)]
CIndex: Switch CXSourceRange to proper half-open intervals.
- Doug, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96162
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 10:02:42 +0000 (10:02 +0000)]
CIndex: Avoid an unnecessary getLocForEndOfToken call, the region of interest
doesn't need to be a full token.
- Doug, please review.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96161
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 08:32:51 +0000 (08:32 +0000)]
c-index-test: Unify and always print half-open extents.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96160
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 08:32:32 +0000 (08:32 +0000)]
c-index-test: Simplify file scanning code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96159
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 08:32:24 +0000 (08:32 +0000)]
c-index-test: Unify syntax for printing extents. Yes, there were 4.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96158
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 08:32:11 +0000 (08:32 +0000)]
CIndex: Simplify (remove provably dead code).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96157
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 08:32:05 +0000 (08:32 +0000)]
CIndex: Inline CompareRegionOfInterest(CXSourceRange) into sole caller.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96156
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 08:31:57 +0000 (08:31 +0000)]
Rename translateSourceRange(CXSourceRange) translateCXSourceRange, instead of
having overloaded functions with inverse semantics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96155
91177308 -0d34-0410-b5e6-
96231b3b80d8
Zhongxing Xu [Sun, 14 Feb 2010 06:49:48 +0000 (06:49 +0000)]
Fix pr6293. If ptr is NULL, no operation is preformed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96154
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 02:45:18 +0000 (02:45 +0000)]
Add new static analyzer for checking LLVM coding conventions: -analyzer-check-llvm-conventions
Currently these checks are intended to be largely syntactical, but may get more
sophisticated over time.
As an initial foray into this brave new world, emit a static analyzer warning
when binding a temporary 'std::string' to an 'llvm::StringRef' where the
lifetime of the 'std::string' does not outlive the 'llvm::StringRef'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96147
91177308 -0d34-0410-b5e6-
96231b3b80d8
Ted Kremenek [Sun, 14 Feb 2010 02:44:52 +0000 (02:44 +0000)]
Two changes to AnalysisConsumer::HandleTopLevelSingleDecl():
(1) Since CXXMethodDecl subclasses FunctionDecl (and CXXDestructorDecl
and CXXConversion subclass CXXMethodDecl), refactor switch statement
to handle them all in one spot.
(2) Use 'DeclarationName::getAsString()' to handle all functions that
don't have simple identifiers (fixing a null dereference when scanning
for specific functions).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96146
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 01:47:36 +0000 (01:47 +0000)]
CIndex: Kill off CXSourceLocationPtr, and AtEnd arguments.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96145
91177308 -0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Sun, 14 Feb 2010 01:47:29 +0000 (01:47 +0000)]
CIndex: Stop hiding magic end bit in CXSourceRange locations where clients can't
see it. Instead, translate the locations up-front when we create a
CXSourceRange.
- This is part of a move to make CXSourceRange a pure half-open range, which is
a more natural API for clients to deal with. More cleanups to follow.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96144
91177308 -0d34-0410-b5e6-
96231b3b80d8