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

36629 Коммитов

Автор SHA1 Сообщение Дата
Fariborz Jahanian 8b08adb279 modern objc translator: used size_t in couple
of places. // rdar://11375908


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156106 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 21:44:12 +00:00
Chad Rosier f9e156c774 Use array_lengthof instead of sizeof trickery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156104 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 21:25:34 +00:00
Douglas Gregor c968334510 Do not keep track of the set of visited Objective-C containers when
performing the search for overridden methods. We very rarely see the
same container twice, and in those rare cases we still have the
fallback of the second SmallPtrSet to eliminate duplicates. Good for
~1.5% -fsyntax-only speedup on the code in <rdar://problem/11004361>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156103 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 21:25:24 +00:00
Fariborz Jahanian 502261a673 modern objc translation. objc_getClass() and objc_getMetaClass()
prototypes should both return  `struct objc_class *`.
// rdar://11375495



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156097 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 20:23:37 +00:00
Chad Rosier 53d2409a22 [driver - crash diagnostics] Only write the failing command in the script.
Part of rdar://11285725


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156096 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 20:17:15 +00:00
Richard Smith fff4a44caa Fix typo and avoid layout issue with almost-but-not-quite-fixed-width fonts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156095 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 20:10:41 +00:00
Richard Smith 207653c37d Minor copy-edits to clang::fallthrough attribute documentation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156094 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 20:05:46 +00:00
Chad Rosier c476e924d6 Canonicalize loop.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156093 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 19:50:25 +00:00
Bob Wilson c03f2df2a2 Disable -Wformat-extra-args for arguments defined in system headers.
Some of the NSAssert macros in OS X 10.7 are implemented in a way that
adds extra arguments that trigger the -Wformat-extra-args warning.
Earlier versions of clang failed to detect those -Wformat issues, but now
that clang is reporting those problems, we need to quiet them since there's
nothing to be done to fix them.  <rdar://problem/11317765>

I don't know how to write a testcase for this.  Suggestions welcome.
Patch by Ted Kremenek!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156092 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 19:47:19 +00:00
Kaelyn Uhrain 3bb2994a7d Silence unused-variable warning when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156091 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 19:46:38 +00:00
Peter Collingbourne b0998f9b5b Honour CLANG_BUILD_EXAMPLES correctly, by setting the directory's
EXCLUDE_FROM_ALL property.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156090 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 19:11:45 +00:00
Jordy Rose 90a7126f76 [analyzer] When promoting constant integers in a comparison, use the larger width of the two to avoid truncation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156089 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 19:05:48 +00:00
Richard Smith 487eed6117 Remove diagnostic groups and DefaultIgnore from notes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156087 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 18:38:45 +00:00
Richard Smith e0d3b4cd2b Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between
cases in switch statements. Also add a [[clang::fallthrough]] attribute, which
can be used to suppress the warning in the case of intentional fallthrough.

Patch by Alexander Kornienko!

The handling of C++11 attribute namespaces in this patch is temporary, and will
be replaced with a cleaner mechanism in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156086 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 18:27:39 +00:00
Anna Zaks dd160f3ed5 [analyzer] CString Checker: Do not split the path unless the user
specifically checks for equality to null.

Enforcing this general practice, which keeps the analyzer less
noisy, in the CString Checker. This change suppresses "Assigned value is
garbage or undefined" warning in the added test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156085 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 18:21:28 +00:00
Richard Smith d39d23e610 Fix a couple of cases of (innocuous) unmarked fallthrough. At least one of these
was unintentional. Found by -Wimplicit-fallthrough, patch by Alexander Kornienko!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156082 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 17:56:49 +00:00
Argyrios Kyrtzidis 3144749f8b In StringLiteralParser::init, make sure we emit an error when
failing to lex the string, as suggested by Eli.

Part of rdar://11305263.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156081 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 17:50:32 +00:00
Chad Rosier d83217cbfc [driver crash diagnostics] Remove more flags that reference absolute paths that
aren't necessary to reproduce the clang crash.
Part of rdar://11285725


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156079 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 17:07:55 +00:00
Fariborz Jahanian 975eef6418 objective-c: warn for properties being default synthesized
under -Wobjc-missing-property-synthesis which must be
opted-in. // rdar://11295716


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156078 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 16:43:30 +00:00
David Blaikie 0cf3c0eecb Correctly constify clang::CXXMemberCallExpr::getRecordDecl()
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156074 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 16:25:49 +00:00
Simon Atanasyan c4b69f0225 Test case Clang::Driver/debug-options-as.c depends on the integrated assembler. Turn it on explicitly on all platforms by the "-integrated-as" option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156063 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 13:57:00 +00:00
Jordy Rose 14d20b1dff [analyzer] Equality ops are like relational ops in that the arguments shouldn't be converted to the result type. Fixes PR12206 and dupe PR12510.
This was probably the original intent of r133041 (also me, a year ago).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156062 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 07:34:01 +00:00
Jordy Rose 9e607dd1df [analyzer] Fix RUN line and general cleanup for additive folding tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156061 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 07:33:56 +00:00
Bob Wilson 4206c27768 Rip out old code for finding libraries in GCC's directories.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156058 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 05:23:52 +00:00
Argyrios Kyrtzidis 67835c1a7e [PCH] Clear switch case IDs when deserializing a objc method body.
Fixes rdar://11353109 & http://llvm.org/bugs/show_bug.cgi?id=12689

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156056 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 02:26:32 +00:00
Anna Zaks e55a14a025 [analyzer] Conjure a symbol to ensure we can identify pointer arithmetic
We need to identify the value of ptr as
ElementRegion (result of pointer arithmetic) in the following code.
However, before this commit '(2-x)' evaluated to Unknown value, and as
the result, 'p + (2-x)' evaluated to Unknown value as well.

int *p = malloc(sizeof(int));
ptr = p + (2-x);

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156052 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 02:13:56 +00:00
Anna Zaks da3960347a [analyzer] Do not assert on constructing SymSymExpr with diff types.
The resulting type info is stored in the SymSymExpr, so no reason not to
support construction of expression with different subexpression types.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156051 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 02:13:53 +00:00
Anna Zaks baeaa9ad12 [analyzer] Add a complexity bound on history tracking.
(Currently, this is only relevant for tainted data.)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156050 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 02:13:50 +00:00
Anna Zaks 31595e22b7 [analyzer] Revert the functional part of r155944.
The change resulted in multiple issues on the buildbot, so it's not
ready for prime time. Only enable history tracking for tainted
data(which is experimental) for now.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156049 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 02:13:46 +00:00
John McCall 92c6c90e90 Merge x86-64-abi-sret-vs-2word-struct-param.cpp into the generic
x86_64-arguments.cpp test file and be sure to test the coerced
case as well.  Thanks to Wei-Ren Chen for bringing this test
to my attention.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156047 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 01:34:46 +00:00
Richard Trieu 7b0a3e378c Fix a note without a SourceLocation.
#define TEST int y; int x = y;
void foo() {
  TEST
}

-Wuninitialized gives this warning:
invalid-loc.cc:4:3: warning: variable 'y' is uninitialized when used here
      [-Wuninitialized]
  TEST
  ^~~~
invalid-loc.cc:2:29: note: expanded from macro 'TEST'
#define TEST int y; int x = y;
                            ^
note: initialize the variable 'y' to silence this warning
1 warning generated.

The second note lacks filename, line number, and code snippet.  This change
will remove the fixit and only point to variable declaration.

invalid-loc.cc:4:3: warning: variable 'y' is uninitialized when used here
      [-Wuninitialized]
  TEST
  ^~~~
invalid-loc.cc:2:29: note: expanded from macro 'TEST'
#define TEST int y; int x = y;
                            ^
invalid-loc.cc:4:3: note: variable 'y' is declared here
  TEST
  ^
invalid-loc.cc:2:14: note: expanded from macro 'TEST'
#define TEST int y; int x = y;
             ^
1 warning generated.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156045 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 01:09:59 +00:00
Argyrios Kyrtzidis 07a0758701 In StringLiteralParser::init(), fail gracefully if the string is
not as we expect; it may be due to racing issue of a file coming from PCH
changing after the PCH is loaded.

rdar://11353109

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156043 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-03 01:01:56 +00:00
Fariborz Jahanian 13a9c02b54 modern objective-c translator: Fix destructor def.
for __NSContainer_literal.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156035 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 23:53:46 +00:00
Richard Trieu 82129e25c8 Add commas to for loop warning to separate variable names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156033 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 22:48:45 +00:00
Richard Smith a058fd4f0a Revert most of r154844, which was disabled in r155975. Keep around the
refactorings in that revision, and some of the subsequent bugfixes, which
seem to be relevant even without delayed exception specification parsing.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156031 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 22:22:32 +00:00
DeLesley Hutchins 60f2024b7d Thread safety analysis: additional support for smart pointers in lock expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156030 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 22:18:42 +00:00
David Blaikie 914edfbb07 Fix some doxycomments using \class instead of \brief.
Patches by Csaba Raduly (rcsaba@gmail.com)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156027 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 21:58:03 +00:00
Anders Waldenborg 228e5703a6 [python] Add testcase for annotation cursor
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156022 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 21:28:34 +00:00
Anders Waldenborg bbc2e09099 [python] Add Cursor.enum_value wrapping clang_getEnumConstantDeclValue
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156017 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 20:57:33 +00:00
Rafael Espindola 548d17c977 Walk the decls looking for the last one that has an attribute. We do have to walk
them, otherwise we cannot produce an error for both

struct HIDDEN test4; // canonical
struct test4;
struct DEFAULT test4;

and

struct test5; // canonical
struct HIDDEN test5;
struct DEFAULT test5;

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156016 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 20:36:57 +00:00
Anders Waldenborg 51c8bac81e [python] Add testcase for enum with specified underlaying type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156009 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 19:39:46 +00:00
Anders Waldenborg 5b82b9606d [python] Run tests for c++ with std=c++11
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156008 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 19:37:16 +00:00
Anders Waldenborg e1f61c02bf [python] Fix warning in c-code inside testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156007 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 19:35:37 +00:00
DeLesley Hutchins f26efd79d1 Thread Safety Analysis: fixed attribute handling for lock_returned attribute.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156005 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 17:38:37 +00:00
Fariborz Jahanian f5eac481ab Modern objective-c translation: Fixing couple of bugs
related to laying out ivar structs and accessing non-fragile-ivar
in more compilated cases. // rdar://11323187


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156004 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 17:34:59 +00:00
Douglas Gregor 0c19b3c38e Replace the StringSwitch in AttributeList::getKind() with a
TableGen-generated StringMatcher, for a 1.2% speedup in -fparse-only
time in <rdar://problem/11004361>. Thanks to Benjamin for pointing me
at StringMatcher!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156003 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 17:33:51 +00:00
Douglas Gregor 331d2ec7cd Introduce the notion of 'ignored' attributes, so that all attributes
we accept are not modeled somehow via Attr.td.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155998 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 16:18:45 +00:00
Douglas Gregor 3e7d31aa60 Introduce the notion of an attribute that has no direct representation
as an AST node, and fold a number of such attributes into Attr.td.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155995 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 15:56:52 +00:00
David Blaikie 0639c8b31f Fix same line doxycomments so they comment the adjacent field.
Without the '<' prefix in the doxycomment these comments were incorrectly
attached to the proceeding comment on the next line, rather than the
preceeding one.

Fixes PR12722

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155993 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 15:24:47 +00:00
Douglas Gregor 184be849fc Implement the alternate spellings of attributes aligned (as "align")
and const (as "__const") using tblgen, rather than explicitly hacking
them in.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155991 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-02 15:16:13 +00:00