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

33444 Коммитов

Автор SHA1 Сообщение Дата
Chandler Carruth d4e6e7e4a8 Fix the --hash-style option when the target is MIPS as it is
incompatible with the MIPS ABI.

Patch by Simon Atanasyan.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146243 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 04:45:18 +00:00
Richard Smith 8a0f15592b Document the updated behaviour of __builtin_constant_p introduced in r146236.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146241 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 03:40:28 +00:00
Anna Zaks 432a4558b8 [analyzer] Fix inconsistency on when SValBuilder assumes that 2
types are equivalent.

+ A taint test which tests bitwise operations and which was
triggering an assertion due to presence of the integer to integer cast.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146240 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 03:34:02 +00:00
Argyrios Kyrtzidis 42786839cf In ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
infinite recursion due to bad OpaqueValueExpr.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146237 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 02:44:48 +00:00
Richard Smith e052d46f4d Replace the implementation of __builtin_constant_p (which was based on the GCC
documentation) with one based on what GCC's __builtin_constant_p is actually
intended to do (discovered by asking a friendly GCC developer).

In particular, an expression which folds to a pointer is now only considered to
be a "constant" by this builtin if it refers to the first character in a string
literal.

This fixes a rather subtle wrong-code issue when building with glibc. Given:

const char cs[4] = "abcd";
int f(const char *p) { return strncmp(p, cs, 4); }

... the macro magic for strncmp produces a (potentially crashing) call to
strlen(cs), because it expands to an expression starting with:

  __builtin_constant_p(cs) && strlen(cs) < 4 ? /* ... */

Under the secret true meaning of __builtin_constant_p, this is guaranteed to be
safe!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146236 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 02:04:48 +00:00
Douglas Gregor 6a1db484f3 Implement the notion of umbrella directories, which implicity cover
all of the headers below that particular directory. Use umbrella
directories as a clean way to deal with (1) directories/frameworks
that don't have an umbrella header, but don't want to enumerate all of
their headers, and (2) PrivateHeaders, which we never want to
enumerate and want to keep separate from the main umbrella header. 

This also eliminates a little more of the "magic" for private headers,
and frameworks in general.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146235 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 02:04:43 +00:00
Chandler Carruth 71088d1af2 Move ChainedIncludesSource into the Frontend library. This never really
belonged in the Serialization library, it's setting up a compilation,
not just deserializing.

This should fix PR11512, making Serialization actually be layered below
Frontend, a long standing layering violation in Clang.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146233 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 01:55:54 +00:00
Chandler Carruth 8bd25b421f Clean up the comments for this file now that its contents are totally
different from what the comments indicated. Also drop a no longer used
include that also violates the layering between Serialization and
Frontend.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146230 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 01:45:42 +00:00
Chandler Carruth cb381eac84 Move a free function from the Frontend library into the Lex library as
part of HeaderSearch. This function just normalizes filenames for use
inside of a synthetic include directive, but it is used in both the
Frontend and Serialization libraries so it needs a common home.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146227 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 01:33:57 +00:00
Fariborz Jahanian 5a477dbf75 deprecated enum should not warn when used initializing another deprecated enumerator.
// rdar://10535640


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146218 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 01:15:54 +00:00
Argyrios Kyrtzidis c6994005dc Save category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146213 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:31:40 +00:00
Argyrios Kyrtzidis 4451746d8f [libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
passed to clang_findReferencesInFile.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146211 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:17:49 +00:00
Argyrios Kyrtzidis 48977874cb [arcmt] Un-XFAIL a test.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146210 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:17:47 +00:00
Chandler Carruth 66aff4a3b0 Teach the Makefile build about the new diagnostic file from r146207.
Amazingly this is all that's required.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:09:20 +00:00
Rafael Espindola 9b7568da31 Use default visibility in the the symbols declared in unwind.h. This matches
the behavior of gcc's unwind.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146208 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:08:01 +00:00
Chandler Carruth a2398d7da9 Separate the serialization library's diagnostics from the frontend's
diagnostics. Conflating them was highly confusing and makes it harder to
establish a firm layering separation between these two libraries.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146207 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-09 00:02:23 +00:00
Eli Friedman 6d402dc963 Misc Minix-specific changes to clang:
. move compiler-rt to a separate directory so the -L argument only includes compiler-rt (thanks joerg)
. build all clang subdirs
. switches the Minix platform to ELF
. normalizes toolchain invocation

Patch by Ben Gras.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146206 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 23:54:21 +00:00
Bill Wendling cc1f918ed4 Don't get the exception obj from the slot more than once.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146202 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 23:21:26 +00:00
Anna Zaks 5fc7def35e [analyzer] If memory region is tainted mark data as tainted.
+ random comments

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146199 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:38:43 +00:00
Eli Friedman 1e4f68ce0b Fix an edge case in IRGen for conditionals. PR11509.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146189 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 22:01:56 +00:00
Hal Finkel 39993ddef3 add tree test for suse on ppc64 (r146142)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146176 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 20:36:19 +00:00
DeLesley Hutchins 1fa3c0682a This patch extends thread safety analysis with support for the scoped_lockable attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 20:23:06 +00:00
Lang Hames 2cad9e32e6 Added missing testcase from r145849. Thanks to Dave Blaikie for catching this.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146169 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 19:26:24 +00:00
Douglas Gregor 77d029f6a2 Implement umbrella directories for modules, which are similar to
umbrella headers in the sense that all of the headers within that
directory (and eventually its subdirectories) are considered to be
part of the module with that umbrella directory. However, unlike
umbrella headers, which are expected to include all of the headers
within their subdirectories, Clang will automatically include all of
the headers it finds in the named subdirectory.

The intent here is to allow a module map to trivially turn a
subdirectory into a module, where the module's structure can mimic the
directory structure.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146165 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 19:11:24 +00:00
Fariborz Jahanian d5c3fa29c6 More refactoring of objective-C rewriter.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146160 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 18:25:15 +00:00
Douglas Gregor 489ad43b77 Tweak the syntax of umbrella headers, so that "umbrella" is treated as
a modifier for a header declarartion, e.g.,

  umbrella header "headername"

Collapse the umbrella-handling code in the parser into the
header-handling code, so we don't duplicate the header-search logic.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146159 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 18:00:48 +00:00
Douglas Gregor 10694cee25 Within the module representation, generalize the notion of an umbrella
header to also support umbrella directories. The umbrella directory
for an umbrella header is the directory in which the umbrella header
resides.

No functionality change yet, but it's coming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146158 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 17:39:04 +00:00
Douglas Gregor 5e3f9223db Keep track of import dependencies between submodules within the module
that's currently being built. This is important for supporting
transitive dependencies ("export *" in the module map) completely.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146156 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 17:01:29 +00:00
David Blaikie 53a75c07db Decltype in non-pseudo (& non-dependent) dtor calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146155 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 16:13:53 +00:00
Douglas Gregor 52b1ed3685 Convert paths to native format before constructing a
directory_iterator for them.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146154 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 16:13:24 +00:00
Hans Wennborg e3ca33aba2 Only do typo correction for implicit function decls when
they are treated as errors.

Doing typo correction when these are just warnings slows down the
compilation of source which deliberately uses implicit function
declarations.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146153 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 15:56:07 +00:00
Erik Verbruggen 90ec96f302 Fix: allow @protocol forward declarations inside @implementation-s.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146147 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 09:58:43 +00:00
Francois Pichet f4e8a12ea6 Unbreak MSVC build.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146146 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 09:32:22 +00:00
Francois Pichet e1fca502e7 Remove unused parameter from the LateParsedTemplatedFunction constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146145 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 09:11:52 +00:00
Peter Collingbourne dc30967a46 Add an experimental MallocSizeofChecker, which reports inconsistencies
between the casted type of the return value of a malloc/calloc/realloc
call and the operand of any sizeof expressions contained within
its argument(s).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146144 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 08:31:14 +00:00
Hal Finkel 2e55df4992 Allow clang to find gcc libs on suse ppc64
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146142 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 05:50:03 +00:00
Rafael Espindola d85c1e9800 Add a minimal unwind.h that knows how to forward to the system one in systems
that have it in /usr/include (only OS X Lion so far).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146140 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 05:01:39 +00:00
David Blaikie b577757096 Use the real end of the decltype expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146138 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 04:53:15 +00:00
Argyrios Kyrtzidis e368a641a0 [libclang] When doing clang_findReferencesInFile, make sure we don't crash
if we come up against a null Decl.

No test case unfortunately. rdar://10457799.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146127 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 01:56:07 +00:00
Bob Wilson 4ce83eba01 Minor cleanup. Avoid redundant getTriple() calls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146122 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 01:10:19 +00:00
Argyrios Kyrtzidis bb7f5420bd [libclang] Remove IndexingContext's getScopedContext(), it's not useful
now that client containers can be set via function calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146117 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-08 00:54:07 +00:00
Daniel Dunbar 8cd0d25df9 Driver/Linux: Fix the ASAN library path to match current compiler-rt
integration.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146098 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 23:22:17 +00:00
Daniel Dunbar c24767c9dd Driver: Add a --rtlib={compiler-rt,libgcc} argument which I plan to use to allow
dual support for compiler-rt on Linux, during bringup.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146094 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 23:03:15 +00:00
Douglas Gregor 23af6d58e3 Implement inference for the "Private" submodule corresponding to
private headers in a framework.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146082 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 22:05:21 +00:00
Douglas Gregor 4813442c12 Make sure we pick up module_private.map when loading a module.map file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146074 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 21:25:07 +00:00
Argyrios Kyrtzidis b1febb646b [libclang] Indexing API: provide both the semantic and the lexical container.
They are generally the same except in C++ cases like out-of-line member functions.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146069 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:44:19 +00:00
Argyrios Kyrtzidis b526a871af [libclang] Fix indexing of C++ bases in a C++ class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146068 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:44:15 +00:00
Argyrios Kyrtzidis 838d3c2320 [libclang] Introduce CXIdxEntityLanguage that indicates the language
of an indexed entity.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146067 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 20:44:12 +00:00
Anna Zaks b39c5b4ddc [analyzer] Cleanup: use the variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146056 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 19:56:13 +00:00
Daniel Dunbar 7df67e6892 runtime/Linux: Include the profile and ASAN libs on x86.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146051 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-07 19:35:10 +00:00