]> granicus.if.org Git - clang/log
clang
12 years agoMove assertion to not crash tests.
Ted Kremenek [Fri, 12 Oct 2012 22:56:45 +0000 (22:56 +0000)]
Move assertion to not crash tests.

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

12 years agoSilence static analyzer issue by documenting that in this context
Ted Kremenek [Fri, 12 Oct 2012 22:56:42 +0000 (22:56 +0000)]
Silence static analyzer issue by documenting that in this context
that a DeclRefExpr can never return a null decl.  We possibly should
hoist this into getDecl() itself.

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

12 years agoSilence null dereference warnings by documenting context-specific
Ted Kremenek [Fri, 12 Oct 2012 22:56:40 +0000 (22:56 +0000)]
Silence null dereference warnings by documenting context-specific
invariants using assertions.

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

12 years agoFurther harden checking that scan-view isn't serving up pages outside
Ted Kremenek [Fri, 12 Oct 2012 22:56:38 +0000 (22:56 +0000)]
Further harden checking that scan-view isn't serving up pages outside
the server root.

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

12 years agoFix potential crash in ObjCContainersChecker by properly validating
Ted Kremenek [Fri, 12 Oct 2012 22:56:36 +0000 (22:56 +0000)]
Fix potential crash in ObjCContainersChecker by properly validating
the number of arguments.

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

12 years agoSilence dead store warning. It is conceptually possible we will
Ted Kremenek [Fri, 12 Oct 2012 22:56:33 +0000 (22:56 +0000)]
Silence dead store warning.  It is conceptually possible we will
add more code that references SourceFile, so removing the dead store
doesn't seem appropriate for the long term.

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

12 years agoFix potential null deference in CFG printer.
Ted Kremenek [Fri, 12 Oct 2012 22:56:31 +0000 (22:56 +0000)]
Fix potential null deference in CFG printer.

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

12 years agoRemove dead store.
Ted Kremenek [Fri, 12 Oct 2012 22:56:26 +0000 (22:56 +0000)]
Remove dead store.

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

12 years agoUpdate for r165833.
Chad Rosier [Fri, 12 Oct 2012 22:53:52 +0000 (22:53 +0000)]
Update for r165833.

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

12 years agoFix -ast-print for uses of operator->.
Eli Friedman [Fri, 12 Oct 2012 22:45:14 +0000 (22:45 +0000)]
Fix -ast-print for uses of operator->.

Patch by Grzegorz Jablonski.

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

12 years agoFix warnings introduced by r165826.
DeLesley Hutchins [Fri, 12 Oct 2012 21:49:04 +0000 (21:49 +0000)]
Fix warnings introduced by r165826.

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

12 years agoThread-safety analysis: support multiple thread-safety attributes on
DeLesley Hutchins [Fri, 12 Oct 2012 21:38:12 +0000 (21:38 +0000)]
Thread-safety analysis: support multiple thread-safety attributes on
declarations.

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

12 years ago[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
Chad Rosier [Fri, 12 Oct 2012 21:37:00 +0000 (21:37 +0000)]
[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs.

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

12 years agoAdd missing header from 165821
Douglas Gregor [Fri, 12 Oct 2012 21:17:34 +0000 (21:17 +0000)]
Add missing header from 165821

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

12 years agoSanitize the names of modules determined based on the names of headers
Douglas Gregor [Fri, 12 Oct 2012 21:15:50 +0000 (21:15 +0000)]
Sanitize the names of modules determined based on the names of headers
or directories, to make sure that they are identifiers that are not
keywords in any dialect. Fixes <rdar://problem/12489495>.

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

12 years agoRemove XFAIL,fix test
Bill Schmidt [Fri, 12 Oct 2012 20:16:26 +0000 (20:16 +0000)]
Remove XFAIL,fix test

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

12 years agoXFAIL pending further investigation
Bill Schmidt [Fri, 12 Oct 2012 20:07:31 +0000 (20:07 +0000)]
XFAIL pending further investigation

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

12 years agoFix typo correction of one qualified name to another.
David Blaikie [Fri, 12 Oct 2012 20:00:44 +0000 (20:00 +0000)]
Fix typo correction of one qualified name to another.

When suggesting "foo::bar" as a correction for "fob::bar" we mistakenly
replaced only "bar" with "foo::bar" producing "fob::foo::bar" which was broken.

This corrects that replacement in as many places as I could find & provides
test cases for all those cases I could find a test case for. There are a couple
that don't seem to be reachable (one looks entirely dead, the other just
doesn't seem to ever get called with a namespace to namespace change).

Review by Richard Smith ( http://llvm-reviews.chandlerc.com/D57 ).

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

12 years agoThis patch addresses PR13948.
Bill Schmidt [Fri, 12 Oct 2012 19:26:17 +0000 (19:26 +0000)]
This patch addresses PR13948.

For 64-bit PowerPC SVR4, an aggregate containing only one
floating-point field (float, double, or long double) must be passed in
a register as though just that field were present.  This patch
addresses the issue during Clang code generation by specifying in the
ABIArgInfo for the argument that the underlying type is passed
directly in a register.  The included test case verifies flat and
nested structs for the three data types.

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

12 years agoHave scan-view guard against serving up pages outside the root directory.
Ted Kremenek [Fri, 12 Oct 2012 19:16:31 +0000 (19:16 +0000)]
Have scan-view guard against serving up pages outside the root directory.

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

12 years agoChange (!ptr != 0) to (!ptr) to make the code more readable.
Richard Trieu [Fri, 12 Oct 2012 17:48:40 +0000 (17:48 +0000)]
Change (!ptr != 0) to (!ptr) to make the code more readable.
No functional change.

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

12 years agoHandle a "#pragma options align" inside a class.
Argyrios Kyrtzidis [Fri, 12 Oct 2012 17:39:59 +0000 (17:39 +0000)]
Handle a "#pragma options align" inside a class.

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

12 years agoAdd dump support for comments coming from
Fariborz Jahanian [Fri, 12 Oct 2012 17:28:36 +0000 (17:28 +0000)]
Add dump support for comments coming from
overridden symbols. OK'ed off-line by Doug.
// rdar://12378793

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

12 years agoc-index-test.c: /* Use C style comment. */
NAKAMURA Takumi [Fri, 12 Oct 2012 14:25:52 +0000 (14:25 +0000)]
c-index-test.c: /* Use C style comment. */

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

12 years agoclang/test/Index/index-module.m: Tweak expressions to fit Win32 paths.
NAKAMURA Takumi [Fri, 12 Oct 2012 14:11:32 +0000 (14:11 +0000)]
clang/test/Index/index-module.m: Tweak expressions to fit Win32 paths.

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

12 years agoRemove unused variable.
Benjamin Kramer [Fri, 12 Oct 2012 14:01:58 +0000 (14:01 +0000)]
Remove unused variable.

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

12 years ago[PCH] We only need to record C++ overridden methods once for the canonical decl.
Argyrios Kyrtzidis [Fri, 12 Oct 2012 05:31:40 +0000 (05:31 +0000)]
[PCH] We only need to record C++ overridden methods once for the canonical decl.

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

12 years agoConditionally use an integral cast for BodyFarm support for OSAtomicCompareAndSwap...
Ted Kremenek [Fri, 12 Oct 2012 00:18:19 +0000 (00:18 +0000)]
Conditionally use an integral cast for BodyFarm support for OSAtomicCompareAndSwap if the return type is not a boolean.

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

12 years agoTrack which particular submodule #undef's a macro, so that the actual
Douglas Gregor [Fri, 12 Oct 2012 00:16:50 +0000 (00:16 +0000)]
Track which particular submodule #undef's a macro, so that the actual
#undef only occurs if that submodule is imported.

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

12 years agoRemove dead code introduced in r165751.
Chad Rosier [Fri, 12 Oct 2012 00:02:48 +0000 (00:02 +0000)]
Remove dead code introduced in r165751.

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

12 years agosearch for overridden methods with comment when overriding method
Fariborz Jahanian [Thu, 11 Oct 2012 23:52:50 +0000 (23:52 +0000)]
search for overridden methods with comment when overriding method
has none of its own. Factor in Doug's comments.
// rdar://12378793

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

12 years agoRemove pointless classof()'s.
Sean Silva [Thu, 11 Oct 2012 23:31:23 +0000 (23:31 +0000)]
Remove pointless classof()'s.

Updates to llvm/Support/Casting.h have rendered these classof()'s
irrelevant.

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

12 years agoAdd missing classof().
Sean Silva [Thu, 11 Oct 2012 23:31:18 +0000 (23:31 +0000)]
Add missing classof().

Somewhat troublingly, without this implemented, the check inside
isa_impl<> would silently use the parent's `classof()` when determining
whether it was okay to downcast from the parent to the child!

Bug analysis:

A build failure after removing the parent's `classof()` initially
alerted me to the bug, after which a little bit of thinking and reading
of the code identified the root cause.

The compiler could be made to prevent this bug from happening if there
were a way to ensure that in the code

    template <typename To, typename From, typename Enabler = void>
    struct isa_impl {
      static inline bool doit(const From &Val) {
        return To::classof(&Val);
      }
    };

that `To::classof` is actually inside the class `To`, and not in a base
class. I am not aware of a way to check this in C++. If there is a means
to perform that check, please bring it up on the list and this will be
fixed.

There is a high likelihood that there are other instances of this same
bug in the codebase.

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

12 years agoProvide a fixit when taking the address of an unqualified member function.
David Blaikie [Thu, 11 Oct 2012 22:55:07 +0000 (22:55 +0000)]
Provide a fixit when taking the address of an unqualified member function.

This only applies if the type has a name. (we could potentially do something
crazy with decltype in C++11 to qualify members of unnamed types but that
seems excessive)

It might be nice to also suggest a fixit for "&this->i", "&foo->i",
and "&foo.i" but those expressions produce 'bound' member functions that have
a different AST representation & make error recovery a little trickier. Left
as future work.

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

12 years agoclang/test/Index/index-module.m: Move XFAIL. It was line-number-sensitive.
NAKAMURA Takumi [Thu, 11 Oct 2012 22:48:22 +0000 (22:48 +0000)]
clang/test/Index/index-module.m: Move XFAIL. It was line-number-sensitive.

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

12 years agoclang/test/Index/index-module.m: Mark it as XFAIL:win32 for now.
NAKAMURA Takumi [Thu, 11 Oct 2012 22:33:19 +0000 (22:33 +0000)]
clang/test/Index/index-module.m: Mark it as XFAIL:win32 for now.

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

12 years agoclang/test/Index/index-pch-with-module.m: Tweak expressions for win32 pathsep.
NAKAMURA Takumi [Thu, 11 Oct 2012 22:33:14 +0000 (22:33 +0000)]
clang/test/Index/index-pch-with-module.m: Tweak expressions for win32 pathsep.

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

12 years ago[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
Chad Rosier [Thu, 11 Oct 2012 21:44:41 +0000 (21:44 +0000)]
[ms-inline asm] Remove a bunch of parsing code from the front-end, which will be
reimplemented in the AsmParser where it belongs.

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

12 years ago[ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove the
Chad Rosier [Thu, 11 Oct 2012 21:28:29 +0000 (21:28 +0000)]
[ms-inline asm] Lookup the IdentifierInfo using the Idents table and remove the
now unused static helper function.

The test case needs to be remove temporarily until I can better filter memory
operands that aren't actual variable reference.

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

12 years agoDiagnose the expansion of ambiguous macro definitions. This can happen
Douglas Gregor [Thu, 11 Oct 2012 21:07:39 +0000 (21:07 +0000)]
Diagnose the expansion of ambiguous macro definitions. This can happen
only with modules, when two disjoint modules #define the same
identifier to different token sequences.

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

12 years agoRemove OSAtomicChecker.
Ted Kremenek [Thu, 11 Oct 2012 20:58:21 +0000 (20:58 +0000)]
Remove OSAtomicChecker.

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

12 years agoSwitch over to BodyFarm implementation of OSAtomicCompareAndSwap and
Ted Kremenek [Thu, 11 Oct 2012 20:58:18 +0000 (20:58 +0000)]
Switch over to BodyFarm implementation of OSAtomicCompareAndSwap and
objc_atomicCompareAndSwap.

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

12 years agoTeach GetBaseType() about BlockPointerTypes.
Ted Kremenek [Thu, 11 Oct 2012 20:58:14 +0000 (20:58 +0000)]
Teach GetBaseType() about BlockPointerTypes.

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

12 years agoAdd TargetTransformInfo to the clang driver.
Nadav Rotem [Thu, 11 Oct 2012 20:56:57 +0000 (20:56 +0000)]
Add TargetTransformInfo to the clang driver.

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

12 years ago[libclang] Make sure the index_data.main_filename field is initialized
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:38:23 +0000 (19:38 +0000)]
[libclang] Make sure the index_data.main_filename field is initialized
in c-index-test. index_enteredMainFile is not invoked when indexing a
module file.

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

12 years ago[libclang] Remove this test while I investigate why it is crashing on release+asserts.
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:21:21 +0000 (19:21 +0000)]
[libclang] Remove this test while I investigate why it is crashing on release+asserts.

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

12 years agoAdd null check for malformed code.
Ted Kremenek [Thu, 11 Oct 2012 19:06:43 +0000 (19:06 +0000)]
Add null check for malformed code.

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

12 years ago[libclang] Add tests for indexing modules and PCHs using modules.
Argyrios Kyrtzidis [Thu, 11 Oct 2012 19:00:44 +0000 (19:00 +0000)]
[libclang] Add tests for indexing modules and PCHs using modules.

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

12 years agoFix build failure from r165722
Derek Schuff [Thu, 11 Oct 2012 18:21:13 +0000 (18:21 +0000)]
Fix build failure from r165722

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

12 years agoIntroduce a simple "hint" scheme to eliminate the quadratic behavior
Douglas Gregor [Thu, 11 Oct 2012 17:41:54 +0000 (17:41 +0000)]
Introduce a simple "hint" scheme to eliminate the quadratic behavior
associated with deserializing macro history for an identifier.

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

12 years agoMake the deserialization of PendingMacroIDs deterministic.
Douglas Gregor [Thu, 11 Oct 2012 17:31:34 +0000 (17:31 +0000)]
Make the deserialization of PendingMacroIDs deterministic.

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

12 years agoAdd in the first iteration of support for llvm/clang/lldb to allow variable per addre...
Micah Villmow [Thu, 11 Oct 2012 17:21:41 +0000 (17:21 +0000)]
Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.

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

12 years ago-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.
Jordan Rose [Thu, 11 Oct 2012 17:02:00 +0000 (17:02 +0000)]
-Warc-repeated-use-of-weak: fix a use-of-uninitialized and add a test case.

Fix-up for r165718, should get the buildbots back online.

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

12 years agoProperly factor Native Client defines to support NaCl as an OS
Derek Schuff [Thu, 11 Oct 2012 16:55:58 +0000 (16:55 +0000)]
Properly factor Native Client defines to support NaCl as an OS
with x86/ARM architecture

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

12 years agoHandle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Rafael Espindola [Thu, 11 Oct 2012 16:32:25 +0000 (16:32 +0000)]
Handle gnu_inline in c++ in a gcc compatible way. Original patch by Tobias
Grosser.

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

12 years ago-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.
Jordan Rose [Thu, 11 Oct 2012 16:10:19 +0000 (16:10 +0000)]
-Warc-repeated-use-of-weak: Don't warn on a single read followed by writes.

This is a "safe" pattern, or at least one that cannot be helped by using
a strong local variable. However, if the single read is within a loop,
it should /always/ be treated as potentially dangerous.

<rdar://problem/12437490>

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

12 years ago-Warc-repeated-use-of-weak: Check messages to property accessors as well.
Jordan Rose [Thu, 11 Oct 2012 16:06:21 +0000 (16:06 +0000)]
-Warc-repeated-use-of-weak: Check messages to property accessors as well.

Previously, [foo weakProp] was not being treated the same as foo.weakProp.
Now, for every explicit message send, we check if it's a property access,
and if so, if the property is weak. Then for every assignment of a
message, we have to do the same thing again.

This is a potentially expensive increase because determining whether a
method is a property accessor requires searching through the methods it
overrides. However, without it -Warc-repeated-use-of-weak will miss cases
from people who prefer not to use dot syntax. If this turns out to be
too expensive, we can try caching the result somewhere, or even lose
precision by not checking superclass methods. The warning is off-by-default,
though.

<rdar://problem/12407765>

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

12 years ago[libclang] Improve AST serialization done by ASTUnit::Save().
Argyrios Kyrtzidis [Thu, 11 Oct 2012 16:05:00 +0000 (16:05 +0000)]
[libclang] Improve AST serialization done by ASTUnit::Save().

The ASTUnit needs to initialize an ASTWriter at the beginning of
parsing to fully handle serialization of a translation unit that
imports modules. Do this by introducing an option to enable it, which
corresponds to CXTranslationUnit_ForSerialization on the C API side.

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

12 years agoObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.
Jordan Rose [Thu, 11 Oct 2012 16:02:02 +0000 (16:02 +0000)]
ObjCMethodDecl::findPropertyDecl: bail out early if not an instance method.

Currently, Objective-C does not support class properties, even though it
allows calling class methods with dot syntax.

No intended functionality change; purely optimization.

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

12 years agoMake X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
Derek Schuff [Thu, 11 Oct 2012 15:52:22 +0000 (15:52 +0000)]
Make X86_64ABIInfo clean for ABIs with 32 bit pointers, such as X32
and Native Client

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

12 years agoclang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.
NAKAMURA Takumi [Thu, 11 Oct 2012 11:20:31 +0000 (11:20 +0000)]
clang/test/CodeGenCXX/microsoft-uuidof.cpp: Fix for -Asserts.

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

12 years agoAdd codegen support for __uuidof().
Nico Weber [Thu, 11 Oct 2012 10:13:44 +0000 (10:13 +0000)]
Add codegen support for __uuidof().

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

12 years agoAdd prologue text for list of potential checkers.
Ted Kremenek [Thu, 11 Oct 2012 06:26:56 +0000 (06:26 +0000)]
Add prologue text for list of potential checkers.

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

12 years agoclang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.
NAKAMURA Takumi [Thu, 11 Oct 2012 01:10:04 +0000 (01:10 +0000)]
clang/lib/Headers/CMakeLists.txt: Add f16cintrin.h.

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

12 years agoX86: add F16C support in Clang
Manman Ren [Thu, 11 Oct 2012 00:59:55 +0000 (00:59 +0000)]
X86: add F16C support in Clang

Support the following intrinsics:
  _mm_cvtph_ps, _mm256_cvtph_ps, _mm_cvtps_ph, _mm256_cvtps_ph

rdar://12407875

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

12 years agoRemove the ASTDeserializationListener's MacroVisible() callback, which
Douglas Gregor [Thu, 11 Oct 2012 00:51:27 +0000 (00:51 +0000)]
Remove the ASTDeserializationListener's MacroVisible() callback, which
is no longer necessary, as well as the little bit of infrastructure in
the AST writer that used it.

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

12 years agoRemove an unused bit from the serialized IdentifierInfo
Douglas Gregor [Thu, 11 Oct 2012 00:48:48 +0000 (00:48 +0000)]
Remove an unused bit from the serialized IdentifierInfo

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

12 years agoDeserialize macro history when we deserialize an identifier that has
Douglas Gregor [Thu, 11 Oct 2012 00:46:49 +0000 (00:46 +0000)]
Deserialize macro history when we deserialize an identifier that has
macro history.

When deserializing macro history, we arrange history such that the
macros that have definitions (that haven't been #undef'd) and are
visible come at the beginning of the list, which is what the
preprocessor and other clients of Preprocessor::getMacroInfo()
expect. If additional macro definitions become visible later, they'll
be moved toward the front of the list. Note that it's possible to have
ambiguities, but we don't diagnose them yet.

There is a partially-implemented design decision here that, if a
particular identifier has been defined or #undef'd within the
translation unit, that definition (or #undef) hides any macro
definitions that come from imported modules. There's still a little
work to do to ensure that the right #undef'ing happens.

Additionally, we'll need to scope the update records for #undefs, so
they only kick in when the submodule containing that update record
becomes visible.

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

12 years agoTeach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.
Ted Kremenek [Thu, 11 Oct 2012 00:40:41 +0000 (00:40 +0000)]
Teach set-xcode-analyzer that the new default value for ExecPath is CLANG_ANALYZER_EXEC.

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

12 years agoMinor cleanup for r165678; no functional change.
Eli Friedman [Thu, 11 Oct 2012 00:34:15 +0000 (00:34 +0000)]
Minor cleanup for r165678; no functional change.

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

12 years agoMake sure we perform the variadic method check correctly for calls to a member operat...
Eli Friedman [Thu, 11 Oct 2012 00:30:58 +0000 (00:30 +0000)]
Make sure we perform the variadic method check correctly for calls to a member operator().  PR14057.

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

12 years agoReapply "[analyzer] Treat fields of unions as having symbolic offsets."
Jordan Rose [Wed, 10 Oct 2012 23:23:21 +0000 (23:23 +0000)]
Reapply "[analyzer] Treat fields of unions as having symbolic offsets."

This time, actually uncomment the code that's supposed to fix the problem.

This reverts r165671 / 8ceb837585ed973dc36fba8dfc57ef60fc8f2735.

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

12 years agoFix a crash-on-invalid when parsing a reference to an invalid auto declaration
David Blaikie [Wed, 10 Oct 2012 23:15:05 +0000 (23:15 +0000)]
Fix a crash-on-invalid when parsing a reference to an invalid auto declaration

  auto x((unknown));
  int& y = x;

would crash because we were not flagging 'x' as an invalid declaration here.

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

12 years agoobjective-C IRgen: When sending a method to 'super'
Fariborz Jahanian [Wed, 10 Oct 2012 23:11:18 +0000 (23:11 +0000)]
objective-C IRgen: When sending a method to 'super'
in a category class method, don't read 'isa' pointer. Instead,
save the desired OBJC_METACLASS_$_ClassName in
__DATA,__objc_superrefs and read that without reading any
isa pointers. // rdar://12459358

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

12 years agoTemporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."
Eric Christopher [Wed, 10 Oct 2012 22:49:05 +0000 (22:49 +0000)]
Temporarily Revert "[analyzer] Treat fields of unions as having symbolic offsets."

Author: Jordan Rose <jordan_rose@apple.com>
Date:   Wed Oct 10 21:31:21 2012 +0000

    [analyzer] Treat fields of unions as having symbolic offsets.

    This allows only one field to be active at a time in RegionStore.
    This isn't quite the correct behavior for unions, but it at least
    would handle the case of "value goes in, value comes out" from the
    same field.

    RegionStore currently has a number of places where any access to a union
    results in UnknownVal being returned. However, it is clearly missing
    some cases, or the original issue wouldn't have occurred. It is probably
    now safe to remove those changes, but that's a potentially destabilizing
    change that should wait for more thorough testing.

    Fixes PR14054.

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

This reverts commit cf9030e480f77ab349672f00ad302e216c26c92c.

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

12 years agoRevert "[Options] make Option a value type."
Eric Christopher [Wed, 10 Oct 2012 22:34:46 +0000 (22:34 +0000)]
Revert "[Options] make Option a value type."

Author: Michael J. Spencer <bigcheesegs@gmail.com>
Date:   Wed Oct 10 21:48:26 2012 +0000

    [Options] make Option a value type.

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

This reverts commit 0464fd5e4ce2193e786e5adcab6b828f9366dae3.

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

12 years ago[Options] make Option a value type.
Michael J. Spencer [Wed, 10 Oct 2012 21:48:26 +0000 (21:48 +0000)]
[Options] make Option a value type.

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

12 years ago[analyzer] Treat fields of unions as having symbolic offsets.
Jordan Rose [Wed, 10 Oct 2012 21:31:21 +0000 (21:31 +0000)]
[analyzer] Treat fields of unions as having symbolic offsets.

This allows only one field to be active at a time in RegionStore.
This isn't quite the correct behavior for unions, but it at least
would handle the case of "value goes in, value comes out" from the
same field.

RegionStore currently has a number of places where any access to a union
results in UnknownVal being returned. However, it is clearly missing
some cases, or the original issue wouldn't have occurred. It is probably
now safe to remove those changes, but that's a potentially destabilizing
change that should wait for more thorough testing.

Fixes PR14054.

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

12 years agoMake -Wshift-op-parentheses a subgroup of -Wparentheses
David Blaikie [Wed, 10 Oct 2012 20:30:36 +0000 (20:30 +0000)]
Make -Wshift-op-parentheses a subgroup of -Wparentheses

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

12 years agotblgen: Build clang-tblgen without RTTI.
Sean Silva [Wed, 10 Oct 2012 20:25:45 +0000 (20:25 +0000)]
tblgen: Build clang-tblgen without RTTI.

clang-tblgen no longer needs RTTI!

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

12 years agotblgen: Use LLVM-style RTTI in clang-tblgen
Sean Silva [Wed, 10 Oct 2012 20:25:43 +0000 (20:25 +0000)]
tblgen: Use LLVM-style RTTI in clang-tblgen

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

12 years ago[Doc parsing] This patch searches overridden objc/c++
Fariborz Jahanian [Wed, 10 Oct 2012 18:34:52 +0000 (18:34 +0000)]
[Doc parsing] This patch searches overridden objc/c++
methods looking for documentation on a particular base
class inherited by any method that overrides the base class.
In case of redeclaration, as when objc method is defined
in the implementation, it also looks up for documentation
in class/class extension being redeclared.

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

12 years ago[analyzer] Don't run non-path-sensitive checks on system headers...
Jordan Rose [Wed, 10 Oct 2012 17:55:40 +0000 (17:55 +0000)]
[analyzer] Don't run non-path-sensitive checks on system headers...

...but do run them on user headers.

Previously, we were inconsistent here: non-path-sensitive checks on code
/bodies/ were only run in the main source file, but checks on
/declarations/ were run in /all/ headers. Neither of those is the
behavior we want.

Thanks to Sujit for pointing this out!

<rdar://problem/12454226>

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

12 years ago[analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g
Jordan Rose [Wed, 10 Oct 2012 17:55:37 +0000 (17:55 +0000)]
[analyzer] Fix typo: s/HandleDeclsGallGraph/HandleDeclsCallGraph/g

No functionality change.

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

12 years ago-Warc-repeated-use-of-weak: look through explicit casts on assigned values.
Jordan Rose [Wed, 10 Oct 2012 16:43:06 +0000 (16:43 +0000)]
-Warc-repeated-use-of-weak: look through explicit casts on assigned values.

Reading from a weak property, casting the result, and assigning to a
strong pointer should still be considered safe.

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

12 years agoMove Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.
Jordan Rose [Wed, 10 Oct 2012 16:42:54 +0000 (16:42 +0000)]
Move Sema::PropertyIfSetterOrGetter to ObjCMethodDecl::findPropertyDecl.

Then, switch users of PropertyIfSetterOrGetter and LookupPropertyDecl
(the latter by name) over to findPropertyDecl. This actually makes
-Wreceiver-is-weak a bit stronger than it was before.

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

12 years agoChange Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.
Jordan Rose [Wed, 10 Oct 2012 16:42:38 +0000 (16:42 +0000)]
Change Sema::PropertyIfSetterOrGetter to make use of isPropertyAccessor.

Old algorithm:
1. See if the name looks like a getter or setter.
2. Use the name to look up a property in the current ObjCContainer
   and all its protocols.
3. If the current container is an interface, also look in all categories
   and superclasses (and superclass categories, and so on).

New algorithm:
1. See if the method is marked as a property accessor. If so, look through
   all properties in the current container and find one that has a matching
   selector.
2. Find all overrides of the method using ObjCMethodDecl's
   getOverriddenMethods. This collects methods in superclasses and protocols
   (as well as superclass categories, which isn't really necessary), and
   checks if THEY are accessors. This part is not done recursively, since
   getOverriddenMethods is already recursive.

This lets us handle getters and setters that do not match the property
names.

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

12 years agoRename ObjCMethodDecl::isSynthesized to isPropertyAccessor.
Jordan Rose [Wed, 10 Oct 2012 16:42:25 +0000 (16:42 +0000)]
Rename ObjCMethodDecl::isSynthesized to isPropertyAccessor.

This more accurately reflects its use: this flag is set when a method
matches the getter or setter name for a property in the same class,
and does not actually specify whether or not the definition of the method
will be synthesized (either implicitly or explicitly with @synthesize).

This renames the setter and backing field as well, and changes the
(soon-to-be-obsolete?) XML dump format to use 'property_accessor'
instead of 'synthesized'.

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

12 years agoFix stack overflow when trying to create an implicit moving
Argyrios Kyrtzidis [Wed, 10 Oct 2012 16:14:06 +0000 (16:14 +0000)]
Fix stack overflow when trying to create an implicit moving
constructor with invalid code.

rdar://12240916

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

12 years ago[CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
NAKAMURA Takumi [Wed, 10 Oct 2012 13:46:18 +0000 (13:46 +0000)]
[CMake] clang/tools/extra may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.

LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR=/path/to/llvm-srcroot/tools/clang/tools/extra, by default.

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

12 years agoApply the same fundamental fix for PR14048 as was applied for PR11905.
Chandler Carruth [Wed, 10 Oct 2012 11:29:08 +0000 (11:29 +0000)]
Apply the same fundamental fix for PR14048 as was applied for PR11905.

The issue arises when coercing to/from types of different sizes. We need
to be certain that the allocation on either end has sufficient room for
the coerced type. When it doesn't, we need to make room, copy across,
and then proceed. PR11905 handled the case of storing function arguments
back into allocas in the function prolog, this patch handles the case of
setting up the function arguments in a call expression.

This is actually significantly simpler than the fix for PR11905. It ends
up being a trivial change to create a temporary alloca when the source
is too small and memcpy across. This should preserve the compile-time
fast-isel benefits of doing gep+load sequences and avoiding FCAs.

Reviewed by Benjamin and Evgeniy (who fixed PR11905).

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

12 years agoRemove the final bits of Attributes being declared in the Attribute
Bill Wendling [Wed, 10 Oct 2012 07:36:56 +0000 (07:36 +0000)]
Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.

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

12 years agoFix PR 11709: Change the definition of va_list to meet AAPCS requirement
Logan Chien [Wed, 10 Oct 2012 06:56:20 +0000 (06:56 +0000)]
Fix PR 11709: Change the definition of va_list to meet AAPCS requirement

AAPCS ABI Section 7.1.4 [1] specifies that va_list
should be defined as struct __va_list { void *__ap;};
And in C++, it is defined in namespace std.

[1] http://infocenter.arm.com/help/topic
         /com.arm.doc.ihi0042d/IHI0042D_aapcs.pdf

Patch by Weiming Zhao.

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

12 years agoPlace temporary LTO files into their own subdirectory.
Bill Wendling [Wed, 10 Oct 2012 05:30:49 +0000 (05:30 +0000)]
Place temporary LTO files into their own subdirectory.

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

12 years agoHave 'addFnAttr' take the attribute enum value. Then have it build the attribute...
Bill Wendling [Wed, 10 Oct 2012 03:13:20 +0000 (03:13 +0000)]
Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.

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

12 years agoDisable the preprocessing record when indexing a source file
Argyrios Kyrtzidis [Wed, 10 Oct 2012 02:12:50 +0000 (02:12 +0000)]
Disable the preprocessing record when indexing a source file
and modules are not enabled.

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

12 years agoWhen indexing a module file, for the ppIncludedFile callback give
Argyrios Kyrtzidis [Wed, 10 Oct 2012 02:12:47 +0000 (02:12 +0000)]
When indexing a module file, for the ppIncludedFile callback give
an invalid location if the location points to the synthetic buffer
for the module input.

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

12 years ago[modules] Consistently construct a buffer as input to build the module.
Argyrios Kyrtzidis [Wed, 10 Oct 2012 02:12:39 +0000 (02:12 +0000)]
[modules] Consistently construct a buffer as input to build the module.
This means the main file for modules will always be a virtual one.

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

12 years agoTidy up formatting.
Richard Smith [Wed, 10 Oct 2012 01:12:11 +0000 (01:12 +0000)]
Tidy up formatting.

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

12 years ago-fcatch-undefined-behavior: catch a VLA bound which evalutes to a non-positive value.
Richard Smith [Wed, 10 Oct 2012 01:11:12 +0000 (01:11 +0000)]
-fcatch-undefined-behavior: catch a VLA bound which evalutes to a non-positive value.

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