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

1817 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis 40098e8cd7 [libclang] Make c-index-test check CINDEXTEST_REMAP_AFTER_TRIAL environment variable,
which when set it determines the trial number after which the remapping of files should
take effect.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139511 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-12 18:09:31 +00:00
Douglas Gregor 08e0bc16b3 Kill of the Decl::PCHLevel field entirely. We now only need to know
whether a Decl was deserialized from an AST file (any AST file).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139438 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-10 00:09:20 +00:00
Douglas Gregor 35120c6285 The translation unit is never deserialized
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139436 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 23:34:14 +00:00
Anna Zaks 9134294114 [analyzer] When running scan-build with -plist on ./configure, delete the plist files.
(scan-build does not set the $HtmlDir when running against configure. Previously, this implied that the plist files would appear in the current directory, with this patch they will get deleted.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139382 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-09 18:43:53 +00:00
James Molloy 066d502b2d Fix up MCInstPrinter creation to take the new SubtargetInfo parameter (see LLVM r139237)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139238 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-07 17:25:30 +00:00
Anna Zaks 71f11d6a39 [analyzer] Revert a regression introduced in r133104(The ARC Migration Tool..) due to a merge error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138919 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-31 23:53:24 +00:00
Chandler Carruth 20174221af Update libclang to have APIs corresponding to the new 'expansion' naming
system for macro-backed source locations. The old APIs are preserved for
legacy users.

This was intended to land with the main work of instantiation ->
expansion, but despite running it by Doug over a month ago, I forgot to
commit it. Very sorry for that...

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138860 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-31 16:53:37 +00:00
Argyrios Kyrtzidis 5f616b726f [libclang] Rename some functions and make sure we don't iterate past the tokens array.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138813 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-30 19:43:19 +00:00
Matt Beaumont-Gay b22732365c Fix type mismatch in initialization (caught by -Wliteral-conversion)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-29 16:37:29 +00:00
Nico Weber e2c8663ad2 [analyzer] update bug report url
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138721 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-28 11:50:56 +00:00
Fariborz Jahanian 95ed7784a3 objective-c: Treat top-level objective-c declarations
, such as list of forward @class decls, in a DeclGroup
node. Deal with its consequence throught clang. This
is in preparation for more Sema work ahead. // rdar://8843851.
Feel free to reverse if it breaks something important
and I am unavailable.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138709 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-27 20:50:59 +00:00
Douglas Gregor b5af843a20 Eliminate the -chained-pch flag and all of the frontend and libclang options associated with it. Chained PCH is the only way to build a PCH file that includes another PCH file
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138597 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 22:54:01 +00:00
Douglas Gregor 467dc88512 Introduce a -cc1 option "-emit-module", that creates a binary module
from the given source. -emit-module behaves similarly to -emit-pch,
except that Sema is somewhat more strict about the contents of
-emit-module. In the future, there are likely to be more interesting
differences.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138595 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 22:30:56 +00:00
Argyrios Kyrtzidis 6f155de99c [libclang] Fix getting a cursor that points inside tag definition that is part
of a type specifier.

e.g. for:

typedef struct _MyS {
  int foo;
} MyS;

pointing at field 'foo' would give a cursor for the typedef declaration 'MyS'
instead of the field.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138593 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 22:24:47 +00:00
Evan Cheng a6b4045dc4 Match LLVM change: TargetRegistry and TargetSelect have been moved to Support.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@138451 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-24 18:09:14 +00:00
Ted Kremenek 47695c8ad8 [libclang] Remove NestedNameSpecifierVisit, as Clang says that this code is dead.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137999 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 22:25:21 +00:00
Argyrios Kyrtzidis a676379b26 [libclang] Annotate correctly macro argument tokens.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137961 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-18 18:03:34 +00:00
Ted Kremenek baf82b0fdf [libclang] Workaround potential race condition with code completion AllocatedResults being freed after a CXTranslationUnit.
The Container USR's CXString had its underlying data owned by the CXTranslationUnit's string pool.  This
would result in trying to access freed memory.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137887 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 22:19:53 +00:00
Argyrios Kyrtzidis 94fe9eee8c [libclang] Implicit objc methods are skipped, no need to check isSynthesized.
Plus, isSynthesized returning true does not mean that there is not a user-declared method declaration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137858 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 20:15:55 +00:00
Argyrios Kyrtzidis 75cf3e86d3 Mark objc methods that are implicitly declared for properties (not user-declared) as implicit.
This results in libclang ignoring such methods.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 19:25:08 +00:00
Argyrios Kyrtzidis 4b43b30534 [libclang] Make clang_getCursor able to handle locations that point inside macro arguments.
e.g. for:

\define INVOKE(METHOD, CLASS) [CLASS METHOD]

void test2() {
  INVOKE(meth, MyClass);
}

Pointing at 'meth' will give a CXCursor_ObjCMessageExpr and pointing at 'MyClass'
will give a CXCursor_ObjCClassRef.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137796 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-17 00:31:25 +00:00
Jim Grosbach 09190be8ef Update createMCAsmParser() to match r137735.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137736 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-16 18:33:55 +00:00
Argyrios Kyrtzidis 427964e15f [libclang] Require explicit cursor visitation for all TypeLocs (compilation will
fail if a TypeLoc kind is not handled) and handle DecltypeTypeLoc and InjectedClassNameTypeLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137670 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 22:40:24 +00:00
Argyrios Kyrtzidis 3422fbc38f [libclang] Handle AttributedTypeLoc for cursor visitation. Fixes rdar://9535717.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137634 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15 18:44:43 +00:00
Francois Pichet af0f4d0b2e Implement function template specialization at class scope extension in Microsoft mode. A new AST node is introduced: ClassScopeFunctionSpecialization. This node holds a FunctionDecl that is not yet specialized; then during the class template instantiation the ClassScopeFunctionSpecialization will spawn the actual function specialization.
Example:
template <class T>
class A {
public:
  template <class U> void f(U p) {  }
  template <> void f(int p) {  } // <== class scope specialization
};

This extension is necessary to parse MSVC standard C++ headers, MFC and ATL code.
BTW, with this feature in, clang can parse (-fsyntax-only) all the MSVC 2010 standard header files without any error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137573 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-14 03:52:19 +00:00
Nick Lewycky 83f06e8223 The diagtool registration system tries to use a global variable from a method
called on another global variable. Use ManagedStatic to ensure that the global
we register with actually exists when we need it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137406 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 01:14:22 +00:00
Douglas Gregor 6bf2b9fbd3 In the serialized AST format, make the translation unit a "predefined"
declaration that never actually gets serialized. Instead, serialize
the various kinds of update records (lexical decls, visible decls, the
addition of an anonymous namespace) for the translation unit, even if
we're not chaining. This way, we won't have to deal with multiple
loaded translation unit declarations.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137395 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 00:15:20 +00:00
Ted Kremenek 0a20818384 scan-build: enable C++ support by default.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137382 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-11 22:47:20 +00:00
Argyrios Kyrtzidis 8a4bfaa04b [libclang] When pointing at an objc property don't return a cursor that points at the
synthesized method for the property. rdar://9771715

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 21:12:04 +00:00
Douglas Gregor eaf4fbab08 Switch a C-style cast over to a const_cast. No functionality change
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-10 16:34:38 +00:00
Ted Kremenek e802c613f2 Place back previous order of add_subdirectory()'s to reflect build depedencies.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 14:55:12 +00:00
Ted Kremenek 7eab9d33e2 Add libsupport to list of libraries to link into diagtool
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137110 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 03:41:03 +00:00
Ted Kremenek 2dc651dfd4 Add 'diagtool' to the 'tools/' directory. diagtool is a new tool (WIP) for analyzing and working with clang diagnostics.
Some interesting stats from 'diagtool list-warnings' on the current version of clang:

  Percentage of warnings with flags: 48.79%
  Number of unique flags: 148
  Average number of diagnostics per flag: 2.041

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137109 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 03:39:19 +00:00
Ted Kremenek 38559ec75f Sort CMakeLists.txt.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137107 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-09 03:39:10 +00:00
Douglas Gregor 8fa0a80b44 Add a new libclang API to return a CXCompletionString for an arbitrary
cursor, from Connor Wakamo! Addresses <rdar://problem/9087798>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136911 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04 20:04:59 +00:00
Chad Rosier 2b81910618 When the compiler crashes, the compiler driver now produces diagnostic
information including the fully preprocessed source file(s) and command line 
arguments.  The developer is asked to attach this diagnostic information to a 
bug report.
rdar://9575623


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136702 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02 17:58:04 +00:00
Douglas Gregor 0f91c8ccb3 When performing code completion after at @interface, allow both
already-defined and forward-declared results. Already-defined results
are fine because they could be the start of a category. Fixes
<rdar://problem/9811691>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136559 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-30 06:55:39 +00:00
Ted Kremenek d1194fbbf6 clang_getCXTUResourceUsage: report memory used by HeaderSearch.
This required converting the StringMaps to use a BumpPtrAllocator.  I measured the
compile time and saw no observable regression.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136190 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 23:46:11 +00:00
Ted Kremenek ca7dc2b755 clang_getCXTUResourceUsage: Report memory used by data structures in SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136189 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 23:46:06 +00:00
Benjamin Kramer a0651c5f5d Eliminate a bunch of temporary strings.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136092 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 16:59:25 +00:00
Douglas Gregor 0a47d69af8 Add new libclang API, clang_codeCompleteGetObjCSelector(), which
provides the partial Objective-C selector used in a code
completion. From Connor Wakamo!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136084 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 15:24:30 +00:00
Evan Cheng ccb21e4f2b Assembler really doesn't need to create TargetMachine anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136045 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 01:49:26 +00:00
Evan Cheng 7b6def7d17 Rename createCodeEmitter to createMCCodeEmitter; createObjectStreamer to createMCObjectStreamer.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136032 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 00:42:40 +00:00
Evan Cheng 3771235c9b Rename createAsmParser to createMCAsmParser.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136029 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-26 00:24:45 +00:00
Evan Cheng 21118dc86e Rename TargetAsmBackend to MCAsmBackend; rename createAsmBackend to createMCAsmBackend.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136011 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 23:25:09 +00:00
Francois Pichet 48a8d14fc6 Fix the MSVC build. 2 problems:
- buildPieces was return a C++ object from inside an extern "C". (MSVC didn't like that)
   - clang_getCursorReferenceNameRange was missing a CINDEX_LINKAGE causing a link error.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135983 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 22:00:44 +00:00
Chandler Carruth 642116259e Rename getInstantiationLineNumber to getExpansionLineNumber in both
SourceManager and FullSourceLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135969 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 21:09:52 +00:00
Chandler Carruth a77c031cb6 Rename getInstantiationColumnNumber to getExpansionColumnNumber in both
SourceManager and FullSourceLoc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135965 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 20:57:57 +00:00
Evan Cheng 75d8c91a5c Assembler doesn't need to initialize TargetMachine's anymore.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135964 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 20:53:26 +00:00
Chandler Carruth e7b2b6e87d Rename getDecomposedInstantiationLoc to getDecomposedExpansionLoc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135962 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-25 20:52:32 +00:00