Граф коммитов

23915 Коммитов

Автор SHA1 Сообщение Дата
Peter Collingbourne 1b7255de78 Move ExecuteCompilerInvocation to a new library FrontendTool
r110903 introduced a dependency from Frontend to every library that
declared an Action by introducing Action references that previously
resided in the driver in the file ExecuteCompilerInvocation.cpp.
This patch moves ExecuteCompilerInvocation to a new library named
FrontendTool which is intended to bear these dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111873 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-24 00:31:22 +00:00
Douglas Gregor aaa107acc8 When calling a function or messaging a method marked "sentinel", add
the ", nil", ", NULL", or ", (void*)0" to the end of the code
completion, since it always has to be there anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:51:41 +00:00
Chris Lattner c070da46b8 fix PR7953 - Windows filename are case insensitive:
#pragma once wasn't working on win32 if the header file was included
using a different case.
I tracked down  the problem to the fact that clang::FileManager was
caching files using case sensitive string (UniqueFiles) on Windows.

I changed FileManager to cache filename in lower case only.
Doesn't affect UNIX because UNIX uses Inode to uniquely identify files.

unix doesn't use this codepath.

Analysis and patch by Francois Pichet!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111866 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:50:42 +00:00
John McCall b556db435f Don't call this field 'Expr', it changes lookup in illegal ways that
GCC diagnoses.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:46:51 +00:00
John McCall 9ae2f076ca Kill off ExprArg (now just Expr*) and StmtArg (now just Stmt*).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111863 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:25:46 +00:00
Douglas Gregor 58ddb60f40 Introduce new libclang API functions that determine the availability
of a cursor or code-completion result, e.g., whether that result
refers to an unavailable, deleted, or deprecated declaration.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111858 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 23:00:57 +00:00
Fariborz Jahanian d097be8f81 Handling remaining rule for synthesize bitfields in
class extensions (nonfragile-abi2).For every class @interface and class
extension @interface, if the last ivar is a bitfield of any type,
then add an implicit `char :0` ivar to the end of that interface.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111857 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:46:52 +00:00
Daniel Dunbar 00577ada44 Driver: Move Clang "triple" computation routines to method on the
ToolChain. This fixes a potenial bad cast when running Clang on PPC code, since
the tool chain in effect is not a subclass of the Darwin one, but we were
treating it like it was.
 - This introduces some gross code duplication, but the right fix for it is to
   just move the Driver to start depending on the targets in libBasic, so I am
   not planning on fixing it immediately.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:35:37 +00:00
Daniel Dunbar 60a4543d42 libclang: Print more information when recovering from crashes in
clang_parseTranslationUnit.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111855 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:35:34 +00:00
Devang Patel 6237cea785 Emit debug info for enum constants.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 22:07:25 +00:00
Douglas Gregor aa5f77b2c9 Include __FUNCTION__, __PRETTY_FUNCTION_, __func__ in code-completion
results for expression contexts within a function.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:54:33 +00:00
Douglas Gregor fb6294123b Introduce a code-completion hook for the Objective-C collection
argument in a for-each statement (e.g., "for (id x in <blah>)"), which
restricts the expression completions provided to Objective-C types (or
class types in C++).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111843 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:17:50 +00:00
Dan Gohman 45f7c78ea3 Reinstate the code for emitting an initial debug type for a struct,
to handle the case where the struct is only forward-declared. In
this case, a temporary MDNode is not needed and not desired.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111842 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 21:15:56 +00:00
Daniel Dunbar 673745ff71 Driver/Darwin: Switch to using simplified tool chain by default -- what better
way to see what will break! :)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111840 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 20:58:55 +00:00
Daniel Dunbar eab3bc4f0b Driver/Darwin: When using the simplified Clang toolchain, make sure to also pass
the arch specific gcc lib path.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111839 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 20:58:52 +00:00
Daniel Dunbar c4ab3493bb Driver: Update -ccc-install-dir to also set the installed dir. Totally
non-obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 20:58:50 +00:00
Tom Care 823894110e Modified pseudoconstant test case to make it a bit clearer and fix a missing line
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111833 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:57:25 +00:00
Tom Care db34ab7096 Several small changes to PseudoConstantAnalysis and the way IdempotentOperationChecker uses it.
- Psuedo -> Pseudo (doh...)
- C++ reference support
- Added pseudoconstant test case for __block vars
- Separated out static local checking from pseudoconstant analysis and generalized to non-local checking
- Added missing test cases for storage false positives

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:51:57 +00:00
Douglas Gregor 6d72cbedba Don't include macro results when we're completing a declarator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 19:33:40 +00:00
Fariborz Jahanian 000835d0b0 Support for IRGen of synthesize bitfield ivars in
objc-nonfragile-abi2 (radar 7824380).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:51:39 +00:00
Devang Patel e5848d680c test case for PR7920.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:26:10 +00:00
Douglas Gregor 2ccccb3ff4 Introduce a new code-completion point when we're parsing a
declarator. Here, we can only see a few things (e.g., cvr-qualifiers,
nested name specifiers) and we do not want to provide other non-macro
completions. Previously, we would end up in recovery mode and would
provide a large number of non-relevant completions.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111818 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 18:23:48 +00:00
Douglas Gregor 5d743fa747 Emit an error noting that Clang does not support code generation for
the ternary operator without a left-hand side in C++ (PR7726), from
Jean-Daniel Dupas!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111809 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 14:50:27 +00:00
Douglas Gregor 11add9b2e9 Add XML for CXXConstructExpr, from Benoit Belley!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111808 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 14:44:46 +00:00
Douglas Gregor ae2fb144fe When complaining about a duplicate declspec, provide a Fix-It that
removes the copy. Patch from Eelis van der Weegen, tweaked/updated by
me.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111807 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 14:34:43 +00:00
Douglas Gregor ee45e24f0a Clarify documentation of escaping for backslash
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111806 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 14:03:03 +00:00
Chandler Carruth 6d09a194bb Add a virtual destructor to the base of another class hierarchy with virtual
methods.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111804 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 08:37:21 +00:00
Chandler Carruth 4e6fbce427 Relax the construction of a definition for implicit, trivial default
constructors. We perform semantic checking when creating the definition, and
this isn't needed in certain contexts (value initialization) but is in others
(default initialization). This fixes PR7948.

We add explicit code to the default initialization path to ensure the
definition is both present and valid.

Doug, please review. I think this follows your latest suggestion, and it ended
up remarkably cleaner than I anticipated. Also let me know if similar logic
should be followed for destructors and copy-constructors.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111802 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 07:55:51 +00:00
John McCall 2b5289b6fd Push DeclGroupRefs and TemplateNames in an opaque but type-safe way
through the parser.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 07:28:44 +00:00
Argyrios Kyrtzidis 42d0f2a03e In Sema::AddBuiltinOperatorCandidates, candidate pointer types set can also contain a ObjCObjectPointerType since r111699.
Don't assume that they are only PointerTypes or we will crash.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111798 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 07:12:16 +00:00
John McCall de719f7131 chandlerc pointed out that ending a line with /\ is not very friendly. :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111797 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 06:56:36 +00:00
John McCall 1f58816e65 Kill off Parser::TemplateParameterList to avoid misparses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111796 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 06:53:58 +00:00
John McCall ca0408fb49 Sundry incremental steps towards killing off Action.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111795 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 06:44:23 +00:00
Chris Lattner b6c504b910 fix rdar://8340348, a miscompile of boost that was exposed by r109848.
That revision started classifying truly empty structs like "Y" and "X"
as being NoClass/NoClass and turning them into 'ignore'.  The call code
turns around and allocates space for the ignored argument with 
GetUndefRValue.  The bug is that GetUndefRValue would return the address
as undef, instead of returning an object with a defined address but 
undefined contents.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111794 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 05:26:13 +00:00
Zhongxing Xu 796788ff21 Adjust code placement.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111790 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 01:37:32 +00:00
John McCall 0bab0cdab7 Abstract out everything having to do with member pointers into the ABI
class;  they should just be completely opaque throughout IR gen now,
although I haven't really audited that.

Fix a bug apparently inherited from gcc-4.2 where we failed to null-check
member data pointers when performing derived-to-base or base-to-derived
conversions on them.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111789 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 01:21:21 +00:00
John McCall 5172ed92b4 Extract a method to check whether a function is the global placement
operator new[].



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111788 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-23 01:17:59 +00:00
John McCall f16aa103d3 Go back to asking CodeGenTypes whether a type is zero-initializable.
Make CGT defer to the ABI on all member pointer types.
This requires giving CGT a handle to the ABI.
It's way easier to make that work if we avoid lazily creating the ABI.
Make it so.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111786 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 21:01:12 +00:00
Nick Lewycky b76495673a Add x86intrin.h which is generic x86 intrinsics for more than just Intel. Thus
far, this just #include's immintrin.h for compatibility.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111785 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 20:38:05 +00:00
Douglas Gregor b8f7de94c3 Do not elide copy construction when we're performing base-class initialization
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 18:27:02 +00:00
Douglas Gregor db68e28c05 Eliminate a stale assertion. Fixes Clang self-host.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111782 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 18:26:35 +00:00
Douglas Gregor 8c3e554d00 Preserve the zero-initialization and construction-kind settings when
instantiating CXXConstructExpr expressions.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111780 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 17:20:18 +00:00
Douglas Gregor 759e41baf6 When performing value-initialization for a class with a non-trivial,
implicitly-defined default constructor, zero-initialize the memory
before calling the default constructor. Previously, we would only
zero-initialize in the case of a trivial default constructor.

Also, simplify the hideous logic that determines when we have a
trivial default constructor and, therefore, don't need to emit any
call at all.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111779 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 16:15:35 +00:00
John McCall e14add4a27 Clean up a very silly use of first-class aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111777 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 11:04:31 +00:00
John McCall d608cdb7c0 Experiment with using first-class aggregates to represent member function
pointers.  I find the resulting code to be substantially cleaner, and it
makes it very easy to use the same APIs for data member pointers (which I have
conscientiously avoided here), and it avoids a plethora of potential
inefficiencies due to excessive memory copying, but we'll have to see if it
actually works.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111776 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 10:59:02 +00:00
John McCall e9fd7eb6c6 Extract member function pointer comparison and null comparison into
the ABI code.  Implement correct semantics for these on ARM.

I believe this completes the implementation of member function pointers
on ARM.

I think I'm going to switch member function pointers over to be
non-aggregates while I have all this in mind.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111774 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 08:30:07 +00:00
Chandler Carruth e97673f10f Add two new enumerations to the unsupported list for Windows so that all cases
are handled.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111773 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 06:56:37 +00:00
John McCall 875ab10245 Abstract out member-pointer creation. I'm really unhappy about the current
duplication between the constant and non-constant paths in all of this.

Implement ARM ABI semantics for member pointer constants and conversion.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111772 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 06:43:33 +00:00
John McCall cf2c85e76f Abstract more member-pointerness out.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111771 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 04:16:24 +00:00
John McCall 3023def6be Abstract out member-pointer conversions.
Pretty much everything having to do with member pointers is ABI-specific.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111770 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-22 03:04:22 +00:00