]> granicus.if.org Git - clang/log
clang
12 years agoCheck that arguments to a scanf call match the format specifier,
Hans Wennborg [Sat, 10 Dec 2011 13:20:11 +0000 (13:20 +0000)]
Check that arguments to a scanf call match the format specifier,
and offer fixits when there is a mismatch.

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

12 years agotest/Sema/attr-availability.c: Add explicit -triple x86_64-apple-darwin9, for now.
NAKAMURA Takumi [Sat, 10 Dec 2011 07:50:30 +0000 (07:50 +0000)]
test/Sema/attr-availability.c: Add explicit -triple x86_64-apple-darwin9, for now.

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

12 years ago[libclang] Add defensive checks to make sure we don't try to dereference
Argyrios Kyrtzidis [Sat, 10 Dec 2011 02:36:25 +0000 (02:36 +0000)]
[libclang] Add defensive checks to make sure we don't try to dereference
a null pointer after getCursorDecl() is called. rdar://10298421.

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

12 years agoIn ContentCache::replaceBuffer, add sanity check to make sure that we do not free...
Argyrios Kyrtzidis [Sat, 10 Dec 2011 01:38:26 +0000 (01:38 +0000)]
In ContentCache::replaceBuffer, add sanity check to make sure that we do not free a buffer
and then continue using it. rdar://10359140.

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

12 years agoMake sure that we infer __strong, etc. when we instantiate variables
Douglas Gregor [Sat, 10 Dec 2011 01:22:52 +0000 (01:22 +0000)]
Make sure that we infer __strong, etc. when we instantiate variables
under ARC. Fixes <rdar://problem/10530209>.

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

12 years agoAdd a fast path to the constant evaluator for integer literals. This speeds up
Richard Smith [Sat, 10 Dec 2011 01:10:13 +0000 (01:10 +0000)]
Add a fast path to the constant evaluator for integer literals. This speeds up
compilation of some translation units of SPEC's 445.gobmk by ~4%, and does not
seem to cause a measurable slowdown in other cases.

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

12 years agoAdd a sanity check in SourceManager::getColumnNumber, make sure
Argyrios Kyrtzidis [Sat, 10 Dec 2011 00:30:38 +0000 (00:30 +0000)]
Add a sanity check in SourceManager::getColumnNumber, make sure
we don't try to access beyond the buffer.

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

12 years agoAdd ability to supply additional message to availability macros,
Fariborz Jahanian [Sat, 10 Dec 2011 00:28:41 +0000 (00:28 +0000)]
Add ability to supply additional message to availability macros,
// rdar://10095131

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

12 years agoUse the right CHECK prefix so that we actually do this checking. Miraculously, this...
Douglas Gregor [Sat, 10 Dec 2011 00:28:18 +0000 (00:28 +0000)]
Use the right CHECK prefix so that we actually do this checking. Miraculously, this hasn't broken

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

12 years agoWhen we manage to re-use an expression during tree transformation (=
Douglas Gregor [Sat, 10 Dec 2011 00:23:21 +0000 (00:23 +0000)]
When we manage to re-use an expression during tree transformation (=
template instantiation), and that expression might produce a
temporary, invoke MaybeBindToTemporary. Otherwise, we forget to
destroy objects, release objects, etc. Fixes <rdar://problem/10531073>.

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

12 years agoDriver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
Daniel Dunbar [Fri, 9 Dec 2011 23:41:18 +0000 (23:41 +0000)]
Driver: Handle -f{no-}honor-infinities, -f{no-}honor-nans, and
-ffinite-math-only.
 - No test case yet, I don't know how to construct a situation where this
   matters.

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

12 years agoFix up doxyments (\arg vs \p).
Matt Beaumont-Gay [Fri, 9 Dec 2011 23:16:01 +0000 (23:16 +0000)]
Fix up doxyments (\arg vs \p).

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

12 years agoMake array new on a pointer to data member type work correctly. PR11523.
Eli Friedman [Fri, 9 Dec 2011 23:05:37 +0000 (23:05 +0000)]
Make array new on a pointer to data member type work correctly.  PR11523.

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

12 years agoMechanically convert static_assert_fold to static_assert, now we implement the
Richard Smith [Fri, 9 Dec 2011 23:00:37 +0000 (23:00 +0000)]
Mechanically convert static_assert_fold to static_assert, now we implement the
C++11 ICE rules.

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

12 years agoC++11 constant expressions: Don't use CheckICE in C++11; instead, determine
Richard Smith [Fri, 9 Dec 2011 22:58:01 +0000 (22:58 +0000)]
C++11 constant expressions: Don't use CheckICE in C++11; instead, determine
whether an expression is a (core) constant expression as a side-effect of
evaluation. This takes us from accepting far too few expressions as ICEs to
accepting slightly too many -- fixes for the remaining cases are coming next.

The diagnostics produced when an expression is found to be non-constant are
currently quite poor (with generic wording but reasonable source locations),
and will be improved in subsequent commits.

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

12 years agoAdd clang_getDiagnosticSetFromTU() to libclang. Fixes <rdar://problem/10553081>.
Ted Kremenek [Fri, 9 Dec 2011 22:28:32 +0000 (22:28 +0000)]
Add clang_getDiagnosticSetFromTU() to libclang.  Fixes <rdar://problem/10553081>.

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

12 years agoSort exports list.
Ted Kremenek [Fri, 9 Dec 2011 22:28:29 +0000 (22:28 +0000)]
Sort exports list.

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

12 years agoAdd notes for suppressing and (if it's a zero-arg function returning bool) fixing...
David Blaikie [Fri, 9 Dec 2011 21:42:37 +0000 (21:42 +0000)]
Add notes for suppressing and (if it's a zero-arg function returning bool) fixing the function-to-bool conversion warning.

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

12 years agoobjc-arc: diagnose synthesis of a 'weak unavailable' property.
Fariborz Jahanian [Fri, 9 Dec 2011 19:55:11 +0000 (19:55 +0000)]
objc-arc: diagnose synthesis of a 'weak unavailable' property.
// rdar://10535245

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

12 years agoProvide a separate warning for weak vtables in explicit template instantiations....
David Blaikie [Fri, 9 Dec 2011 18:32:50 +0000 (18:32 +0000)]
Provide a separate warning for weak vtables in explicit template instantiations. There's no (current) way to fix such templates to emit strong symbols/vtables, but perhaps users want to know about the cost being incurred anyway.

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

12 years agoWhen performing subframework header lookup, don't search for
Douglas Gregor [Fri, 9 Dec 2011 16:48:01 +0000 (16:48 +0000)]
When performing subframework header lookup, don't search for
".framework/" in the path name, because it could be ".framework\" on
Windows. This whole function needs to be rewritten with PathV2.

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

12 years agoUse llvm::sys::fs::equivalent rather than comparing inodes, because
Douglas Gregor [Fri, 9 Dec 2011 16:22:07 +0000 (16:22 +0000)]
Use llvm::sys::fs::equivalent rather than comparing inodes, because
comparing inodes doesn't actually work on Windows.

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

12 years agoRemove unnecessary braces from my previous commit.
Hans Wennborg [Fri, 9 Dec 2011 15:57:33 +0000 (15:57 +0000)]
Remove unnecessary braces from my previous commit.

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

12 years agoMake printf warnings refer to wint_t and wchar_t by name
Hans Wennborg [Fri, 9 Dec 2011 12:22:12 +0000 (12:22 +0000)]
Make printf warnings refer to wint_t and wchar_t by name
in addition to underlying type.

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

12 years agoMove definition of ConversionSpecifier::toString() to FormatString.cpp
Hans Wennborg [Fri, 9 Dec 2011 11:11:07 +0000 (11:11 +0000)]
Move definition of ConversionSpecifier::toString() to FormatString.cpp

It's declared in FormatString.h, so it shouldn't be defined in
PrintfFormatString.cpp.

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

12 years agofix format specifier fixit for printf("%ld", "foo");
Hans Wennborg [Fri, 9 Dec 2011 10:51:29 +0000 (10:51 +0000)]
fix format specifier fixit for printf("%ld", "foo");

It should reset the length modifier (unless it's a wchar_t string).

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

12 years agoFix a blatant typo or cut/paste-o reported by users of this header.
Chandler Carruth [Fri, 9 Dec 2011 09:23:55 +0000 (09:23 +0000)]
Fix a blatant typo or cut/paste-o reported by users of this header.

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

12 years agoTeach isConstantInitializer that numeric literals are constants, rather than
Richard Smith [Fri, 9 Dec 2011 06:47:34 +0000 (06:47 +0000)]
Teach isConstantInitializer that numeric literals are constants, rather than
having it evaluate them. No change in functionality, but a speed up of about 5%
on some translation units in SPEC 445.gobmk.

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

12 years agoFix the --hash-style option when the target is MIPS as it is
Chandler Carruth [Fri, 9 Dec 2011 04:45:18 +0000 (04:45 +0000)]
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

12 years agoDocument the updated behaviour of __builtin_constant_p introduced in r146236.
Richard Smith [Fri, 9 Dec 2011 03:40:28 +0000 (03:40 +0000)]
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

12 years ago[analyzer] Fix inconsistency on when SValBuilder assumes that 2
Anna Zaks [Fri, 9 Dec 2011 03:34:02 +0000 (03:34 +0000)]
[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

12 years agoIn ExprEvaluatorBase::VisitOpaqueValueExpr() add a sanity check to avoid
Argyrios Kyrtzidis [Fri, 9 Dec 2011 02:44:48 +0000 (02:44 +0000)]
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

12 years agoReplace the implementation of __builtin_constant_p (which was based on the GCC
Richard Smith [Fri, 9 Dec 2011 02:04:48 +0000 (02:04 +0000)]
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

12 years agoImplement the notion of umbrella directories, which implicity cover
Douglas Gregor [Fri, 9 Dec 2011 02:04:43 +0000 (02:04 +0000)]
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

12 years agoMove ChainedIncludesSource into the Frontend library. This never really
Chandler Carruth [Fri, 9 Dec 2011 01:55:54 +0000 (01:55 +0000)]
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

12 years agoClean up the comments for this file now that its contents are totally
Chandler Carruth [Fri, 9 Dec 2011 01:45:42 +0000 (01:45 +0000)]
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

12 years agoMove a free function from the Frontend library into the Lex library as
Chandler Carruth [Fri, 9 Dec 2011 01:33:57 +0000 (01:33 +0000)]
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

12 years agodeprecated enum should not warn when used initializing another deprecated enumerator.
Fariborz Jahanian [Fri, 9 Dec 2011 01:15:54 +0000 (01:15 +0000)]
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

12 years agoSave category name loc in ObjCCategoryImplDecl, patch by Jason Haslam!
Argyrios Kyrtzidis [Fri, 9 Dec 2011 00:31:40 +0000 (00:31 +0000)]
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

12 years ago[libclang] Make sure we don't try to handle a CXCursor_NoDeclFound
Argyrios Kyrtzidis [Fri, 9 Dec 2011 00:17:49 +0000 (00:17 +0000)]
[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

12 years ago[arcmt] Un-XFAIL a test.
Argyrios Kyrtzidis [Fri, 9 Dec 2011 00:17:47 +0000 (00:17 +0000)]
[arcmt] Un-XFAIL a test.

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

12 years agoTeach the Makefile build about the new diagnostic file from r146207.
Chandler Carruth [Fri, 9 Dec 2011 00:09:20 +0000 (00:09 +0000)]
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

12 years agoUse default visibility in the the symbols declared in unwind.h. This matches
Rafael Espindola [Fri, 9 Dec 2011 00:08:01 +0000 (00:08 +0000)]
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

12 years agoSeparate the serialization library's diagnostics from the frontend's
Chandler Carruth [Fri, 9 Dec 2011 00:02:23 +0000 (00:02 +0000)]
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

12 years agoMisc Minix-specific changes to clang:
Eli Friedman [Thu, 8 Dec 2011 23:54:21 +0000 (23:54 +0000)]
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

12 years agoDon't get the exception obj from the slot more than once.
Bill Wendling [Thu, 8 Dec 2011 23:21:26 +0000 (23:21 +0000)]
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

12 years ago[analyzer] If memory region is tainted mark data as tainted.
Anna Zaks [Thu, 8 Dec 2011 22:38:43 +0000 (22:38 +0000)]
[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

12 years agoFix an edge case in IRGen for conditionals. PR11509.
Eli Friedman [Thu, 8 Dec 2011 22:01:56 +0000 (22:01 +0000)]
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

12 years agoadd tree test for suse on ppc64 (r146142)
Hal Finkel [Thu, 8 Dec 2011 20:36:19 +0000 (20:36 +0000)]
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

12 years agoThis patch extends thread safety analysis with support for the scoped_lockable attribute.
DeLesley Hutchins [Thu, 8 Dec 2011 20:23:06 +0000 (20:23 +0000)]
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

12 years agoAdded missing testcase from r145849. Thanks to Dave Blaikie for catching this.
Lang Hames [Thu, 8 Dec 2011 19:26:24 +0000 (19:26 +0000)]
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

12 years agoImplement umbrella directories for modules, which are similar to
Douglas Gregor [Thu, 8 Dec 2011 19:11:24 +0000 (19:11 +0000)]
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

12 years agoMore refactoring of objective-C rewriter.
Fariborz Jahanian [Thu, 8 Dec 2011 18:25:15 +0000 (18:25 +0000)]
More refactoring of objective-C rewriter.

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

12 years agoTweak the syntax of umbrella headers, so that "umbrella" is treated as
Douglas Gregor [Thu, 8 Dec 2011 18:00:48 +0000 (18:00 +0000)]
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

12 years agoWithin the module representation, generalize the notion of an umbrella
Douglas Gregor [Thu, 8 Dec 2011 17:39:04 +0000 (17:39 +0000)]
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

12 years agoKeep track of import dependencies between submodules within the module
Douglas Gregor [Thu, 8 Dec 2011 17:01:29 +0000 (17:01 +0000)]
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

12 years agoDecltype in non-pseudo (& non-dependent) dtor calls.
David Blaikie [Thu, 8 Dec 2011 16:13:53 +0000 (16:13 +0000)]
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

12 years agoConvert paths to native format before constructing a
Douglas Gregor [Thu, 8 Dec 2011 16:13:24 +0000 (16:13 +0000)]
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

12 years agoOnly do typo correction for implicit function decls when
Hans Wennborg [Thu, 8 Dec 2011 15:56:07 +0000 (15:56 +0000)]
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

12 years agoFix: allow @protocol forward declarations inside @implementation-s.
Erik Verbruggen [Thu, 8 Dec 2011 09:58:43 +0000 (09:58 +0000)]
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

12 years agoUnbreak MSVC build.
Francois Pichet [Thu, 8 Dec 2011 09:32:22 +0000 (09:32 +0000)]
Unbreak MSVC build.

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

12 years agoRemove unused parameter from the LateParsedTemplatedFunction constructor.
Francois Pichet [Thu, 8 Dec 2011 09:11:52 +0000 (09:11 +0000)]
Remove unused parameter from the LateParsedTemplatedFunction constructor.

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

12 years agoAdd an experimental MallocSizeofChecker, which reports inconsistencies
Peter Collingbourne [Thu, 8 Dec 2011 08:31:14 +0000 (08:31 +0000)]
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

12 years agoAllow clang to find gcc libs on suse ppc64
Hal Finkel [Thu, 8 Dec 2011 05:50:03 +0000 (05:50 +0000)]
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

12 years agoAdd a minimal unwind.h that knows how to forward to the system one in systems
Rafael Espindola [Thu, 8 Dec 2011 05:01:39 +0000 (05:01 +0000)]
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

12 years agoUse the real end of the decltype expression.
David Blaikie [Thu, 8 Dec 2011 04:53:15 +0000 (04:53 +0000)]
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

12 years ago[libclang] When doing clang_findReferencesInFile, make sure we don't crash
Argyrios Kyrtzidis [Thu, 8 Dec 2011 01:56:07 +0000 (01:56 +0000)]
[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

12 years agoMinor cleanup. Avoid redundant getTriple() calls.
Bob Wilson [Thu, 8 Dec 2011 01:10:19 +0000 (01:10 +0000)]
Minor cleanup.  Avoid redundant getTriple() calls.

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

12 years ago[libclang] Remove IndexingContext's getScopedContext(), it's not useful
Argyrios Kyrtzidis [Thu, 8 Dec 2011 00:54:07 +0000 (00:54 +0000)]
[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

12 years agoDriver/Linux: Fix the ASAN library path to match current compiler-rt
Daniel Dunbar [Wed, 7 Dec 2011 23:22:17 +0000 (23:22 +0000)]
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

12 years agoDriver: Add a --rtlib={compiler-rt,libgcc} argument which I plan to use to allow
Daniel Dunbar [Wed, 7 Dec 2011 23:03:15 +0000 (23:03 +0000)]
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

12 years agoImplement inference for the "Private" submodule corresponding to
Douglas Gregor [Wed, 7 Dec 2011 22:05:21 +0000 (22:05 +0000)]
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

12 years agoMake sure we pick up module_private.map when loading a module.map file.
Douglas Gregor [Wed, 7 Dec 2011 21:25:07 +0000 (21:25 +0000)]
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

12 years ago[libclang] Indexing API: provide both the semantic and the lexical container.
Argyrios Kyrtzidis [Wed, 7 Dec 2011 20:44:19 +0000 (20:44 +0000)]
[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

12 years ago[libclang] Fix indexing of C++ bases in a C++ class.
Argyrios Kyrtzidis [Wed, 7 Dec 2011 20:44:15 +0000 (20:44 +0000)]
[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

12 years ago[libclang] Introduce CXIdxEntityLanguage that indicates the language
Argyrios Kyrtzidis [Wed, 7 Dec 2011 20:44:12 +0000 (20:44 +0000)]
[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

12 years ago[analyzer] Cleanup: use the variable.
Anna Zaks [Wed, 7 Dec 2011 19:56:13 +0000 (19:56 +0000)]
[analyzer] Cleanup: use the variable.

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

12 years agoruntime/Linux: Include the profile and ASAN libs on x86.
Daniel Dunbar [Wed, 7 Dec 2011 19:35:10 +0000 (19:35 +0000)]
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

12 years ago[analyzer] More www; document ProgramState->dump().
Anna Zaks [Wed, 7 Dec 2011 19:04:27 +0000 (19:04 +0000)]
[analyzer] More www; document ProgramState->dump().

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

12 years ago[analyzer] Update the checker writer manual with explanation of SVals
Anna Zaks [Wed, 7 Dec 2011 19:04:24 +0000 (19:04 +0000)]
[analyzer] Update the checker writer manual with explanation of SVals
and the link to checker callback documentation.

SVal, SymExpr, MemRegion description is a slightly edited version of
Ted's reply to a question on cfe-dev list.

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

12 years agoRemove unused-but-set variable.
Benjamin Kramer [Wed, 7 Dec 2011 12:50:05 +0000 (12:50 +0000)]
Remove unused-but-set variable.

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

12 years agoMake printf warnings refer to intmax_t et al. by name
Hans Wennborg [Wed, 7 Dec 2011 10:33:11 +0000 (10:33 +0000)]
Make printf warnings refer to intmax_t et al. by name
in addition to underlying type.

For example, the warning for printf("%zu", 42.0);
changes from "conversion specifies type 'unsigned long'" to "conversion
specifies type 'size_t' (aka 'unsigned long')"

(This is a second attempt after r145697, which got reverted.)

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

12 years agoMake changes to SDiagsWriter to make it work in combination with the ARC migrator:
Argyrios Kyrtzidis [Wed, 7 Dec 2011 05:52:12 +0000 (05:52 +0000)]
Make changes to SDiagsWriter to make it work in combination with the ARC migrator:

-Allow it to be used with multiple BeginSourceFile/EndSourceFile calls; for this introduce
 a "finish" callback method in the DiagnosticConsumer. SDiagsWriter finishes up the serialization
 file inside this method.
-Make it independent of any particular DiagnosticsEngine; make it use the SourceManager of the
 Diagnostic object.
-Ignore null source ranges.

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

12 years ago[libclang] Index C++ namespaces.
Argyrios Kyrtzidis [Wed, 7 Dec 2011 05:52:06 +0000 (05:52 +0000)]
[libclang] Index C++ namespaces.

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

12 years agoFix multilib library paths on ppc64 Linux. Patch by Michael Kostylev. PR11472.
Eli Friedman [Wed, 7 Dec 2011 04:00:53 +0000 (04:00 +0000)]
Fix multilib library paths on ppc64 Linux.  Patch by Michael Kostylev.  PR11472.

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

12 years agowww: Update getting started to encourage people to check out compielr-rt.
Daniel Dunbar [Wed, 7 Dec 2011 03:04:42 +0000 (03:04 +0000)]
www: Update getting started to encourage people to check out compielr-rt.

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

12 years agoInitialize these values, fixing the build in cases where stack realignment
Nick Lewycky [Wed, 7 Dec 2011 02:33:23 +0000 (02:33 +0000)]
Initialize these values, fixing the build in cases where stack realignment
actually occurs.

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

12 years agoImplement basic support for private headers in frameworks. In essence,
Douglas Gregor [Wed, 7 Dec 2011 02:23:45 +0000 (02:23 +0000)]
Implement basic support for private headers in frameworks. In essence,
when we load a module map (module.map) from a directory, also load a
private module map (module_private.map) for that directory, if
present. That private module map can inject a new submodule that
captures private headers.

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

12 years agoTweak serialized diagnostics to support errors with no categories. Fixes <rdar:...
Ted Kremenek [Wed, 7 Dec 2011 02:08:00 +0000 (02:08 +0000)]
Tweak serialized diagnostics to support errors with no categories.  Fixes <rdar://problem/10538300>.

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

12 years agoMake sure we correctly zero-initialize unions containing a pointer to data member...
Eli Friedman [Wed, 7 Dec 2011 01:30:11 +0000 (01:30 +0000)]
Make sure we correctly zero-initialize unions containing a pointer to data member as the first field.  PR11487.

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

12 years ago[analyzer] Propagate taint through MemRegions.
Anna Zaks [Wed, 7 Dec 2011 01:09:52 +0000 (01:09 +0000)]
[analyzer] Propagate taint through MemRegions.
SVal can be not only a symbol, but a MemRegion. Add support for such
cases.

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

12 years agoIf we can't write the temporary module map file when compiling a
Douglas Gregor [Wed, 7 Dec 2011 00:54:14 +0000 (00:54 +0000)]
If we can't write the temporary module map file when compiling a
module, at least have the decency to complain about it.

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

12 years agoWhen folding the size of a global scope VLA to a constant, require the array
Richard Smith [Wed, 7 Dec 2011 00:43:50 +0000 (00:43 +0000)]
When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.

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

12 years agoobjc: issue deprecated/unavailable diagnostic when
Fariborz Jahanian [Wed, 7 Dec 2011 00:30:00 +0000 (00:30 +0000)]
objc: issue deprecated/unavailable diagnostic when
methods with these attributes are sent to receivers
of 'id' type too. // rdar://10459930

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

12 years agoDeadStoresChecker: when whitelisting dead initializations with constants, look
Richard Smith [Tue, 6 Dec 2011 23:25:15 +0000 (23:25 +0000)]
DeadStoresChecker: when whitelisting dead initializations with constants, look
for a foldable constant rather than an IR-level constant. This is still far too
liberal, but is a step in the right direction.

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

12 years ago[analyzer] Add comments related to symbol_iterator
Anna Zaks [Tue, 6 Dec 2011 23:12:38 +0000 (23:12 +0000)]
[analyzer] Add comments related to symbol_iterator

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

12 years ago[analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use it
Anna Zaks [Tue, 6 Dec 2011 23:12:33 +0000 (23:12 +0000)]
[analyzer] Refactor: Move symbol_iterator from SVal to SymExpr, use it
for finding dependent symbols for taint.

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

12 years ago[analyzer] Propagate taint through NonLoc to NonLoc casts.
Anna Zaks [Tue, 6 Dec 2011 23:12:27 +0000 (23:12 +0000)]
[analyzer] Propagate taint through NonLoc to NonLoc casts.

 - Created a new SymExpr type - SymbolCast.
 - SymbolCast is created when we don't know how to simplify a NonLoc to
NonLoc casts.
 - A bit of code refactoring: introduced dispatchCast to have better
code reuse, remove a goto.
 - Updated the test case to showcase the new taint flow.

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

12 years ago[analyzer] Remove an unnecessary check.
Anna Zaks [Tue, 6 Dec 2011 23:12:17 +0000 (23:12 +0000)]
[analyzer] Remove an unnecessary check.

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

12 years agoAdd a FIXME to provide a sensible error message here
Douglas Gregor [Tue, 6 Dec 2011 23:04:08 +0000 (23:04 +0000)]
Add a FIXME to provide a sensible error message here

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