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

779 Коммитов

Автор SHA1 Сообщение Дата
Nuno Lopes 68f7a24262 spread 'const' love to some variables. this considerably reduces the amount of dirty data around.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91002 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-10 00:07:02 +00:00
John McCall 842aef8d94 First pass at implementing C++ enum semantics: calculate (and store) an
"integer promotion" type associated with an enum decl, and use this type to
determine which type to promote to.  This type obeys C++ [conv.prom]p2 and
is therefore generally signed unless the range of the enumerators forces
it to be unsigned.

Kills off a lot of false positives from -Wsign-compare in C++, addressing
rdar://7455616




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90965 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 09:09:27 +00:00
Ted Kremenek 029a14ae81 Fix crash in DisplayFunction(). ObjCInterfaceDecls can also get passed to this function, but we don't want to display them.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90944 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 03:45:19 +00:00
Chris Lattner 13d555859c Neil points out that this could be simplified, do it.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-09 02:08:14 +00:00
Daniel Dunbar 90de51f1fc Increase inlining threshold at -O3, to match llvm-gcc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 23:15:55 +00:00
Benjamin Kramer e89ba59005 Twinify InitHeaderSearch::AddPath and use it in C++ include path generation.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90853 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 12:38:20 +00:00
Benjamin Kramer 9e9ddf6100 Use StringRefs in InitHeaderSearch::AddDelimitedPaths.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90852 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 12:11:06 +00:00
John McCall dbd872f273 DeclRefExpr stores a ValueDecl internally.
Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 09:08:17 +00:00
Eli Friedman 7ac1c9ef0b Small compatibility fix for -print-decl-contexts.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90838 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 06:22:37 +00:00
Jeffrey Yasskin e3fdca2ee0 Remove several .c_str() to be forward-compatible with StringRef.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90822 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-08 01:46:24 +00:00
Ted Kremenek fc576514d0 Add clang-cc option '-analyzer-opt-analyze-nested-blocks' to treat block literals as an entry point for analyzer checks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 22:06:12 +00:00
Nuno Lopes 33cc2437ae add fedora 12 include path
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 17:18:48 +00:00
John McCall a93c934af4 DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated variables,
but the results are imperfect.

For posterity, I did:

cat <<EOF > $cmdfile
s/DeclaratorInfo/TypeSourceInfo/g
s/DInfo/TInfo/g
s/TypeTypeSourceInfo/TypeSourceInfo/g
s/SourceTypeSourceInfo/TypeSourceInfo/g
EOF

find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \;
find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \;
find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \;



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 02:54:59 +00:00
Chris Lattner 807b93ee6a fix -dM with variadic macros, PR5699
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90735 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 01:58:34 +00:00
Chris Lattner f744934600 some code cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90732 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-07 01:42:56 +00:00
Steve Naroff 01aec11c8c Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=81871
http://llvm.org/viewvc/llvm-project?view=rev&revision=81936
http://llvm.org/viewvc/llvm-project?view=rev&revision=81945



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 21:14:13 +00:00
Daniel Dunbar eae18f89ed Fix an off by one in findEndOfWord, which could scan past the end of the string in a corner case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90703 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 09:56:18 +00:00
Steve Naroff c9c1e9c4b5 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=86026

Note: The 'improved debugging' changes weren't integrated (since they were later reverted, since they didn't improve debugging).



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90693 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 01:52:22 +00:00
Steve Naroff fd5b76fe99 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=82174



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90692 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 01:48:44 +00:00
Steve Naroff a851e60b7e Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=72893



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 01:33:56 +00:00
Steve Naroff d76fbda5da Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71473



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90688 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-06 01:02:14 +00:00
Benjamin Kramer b2041de2eb Don't call back() on an empty vector.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90678 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 22:16:51 +00:00
Steve Naroff b85e77af05 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71225
http://llvm.org/viewvc/llvm-project?view=rev&revision=73207
http://llvm.org/viewvc/llvm-project?view=rev&revision=73414



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90677 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 21:43:12 +00:00
Steve Naroff 3d7e7865bd Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71086
http://llvm.org/viewvc/llvm-project?view=rev&revision=71107

Note: This fixes <rdar://problem/6845623> from protocol to template.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90665 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 15:55:59 +00:00
Steve Naroff 0304c6cb7f Remove 'LangOpts' from Diagnostic (added in http://llvm.org/viewvc/llvm-project?view=rev&revision=90642).
Simply use the 'LangOpts' member already present in TextDiagnosticPrinter.

Sorry for the confusion!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90664 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 12:23:07 +00:00
Steve Naroff e0c4d895ff Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=71086

Note - This commit only includes the fix for:

<rdar://problem/6309338> slightly different error message format for Visual Studio.

The fix for <rdar://problem/6845623> from protocol to template. is separate/forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90642 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-05 02:14:08 +00:00
John McCall ed97649e95 Fix "using typename" and the instantiation of non-dependent using declarations.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90614 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 22:46:56 +00:00
Steve Naroff 17c8778db9 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70978



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90597 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:36:32 +00:00
Steve Naroff fdd6aaf162 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70926



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90596 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:29:41 +00:00
Steve Naroff e89b8e7946 Integrate the following from the 'objective-rewrite' branch:
http://llvm.org/viewvc/llvm-project?view=rev&revision=70922



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90595 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 21:18:19 +00:00
Daniel Dunbar 125bbbe648 PR5684: Fix refacto, the backend consumer was copying the Diagnostic object,
which meant that hasErrorOccurred() checks to prevent codegen-on-invalid weren't
working.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90560 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:17:40 +00:00
Daniel Dunbar f772d1e2a5 ASTUnit/CIndex: Explicitly track the top-level decls when using an ASTUnit made
from a source file.
 - This allows CIndex to avoid iterating over all the top-level decls when using
   a PCH, which means we deserialize far fewer decls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90559 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 08:17:33 +00:00
Chris Lattner 2e77aa1c2a Use PresumedLoc when emitting the 'included from' diagnostics. For a malformed
test like this:

#line 4 "foo"

#define XX ?

#if XX
#endif

We now emit:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
    ^
foo:5:12: note: instantiated from:
#define XX ?
           ^

instead of:

In file included from t.c:7:
foo:7:5: error: invalid token at start of a preprocessor expression
#if XX
    ^
./t.h:6:12: note: instantiated from:
#define XX ?
           ^

(where the note doesn't obey #line or print the include stack when needed).

This fixes PR5617



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 07:06:35 +00:00
Eli Friedman dd27a2d390 Missed change from last commit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90550 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-04 06:46:54 +00:00
Ted Kremenek f722770952 Try to make the output of PlistDiagnostics more deterministic by sorting PathDiagnostics before they are emitted. Fixes <rdar://problem/7439668>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90478 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 19:35:02 +00:00
Daniel Dunbar baac10380c Fix two more diagnostic-on-stderr instances that thought they could hide from me -- they thought wrong.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:14:12 +00:00
Daniel Dunbar e7cb7e4570 Kill a few more random stderr uses.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90441 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:14:02 +00:00
Daniel Dunbar 33671988f1 Use llvm_report_error instead of fprintf + assert + exit.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:36 +00:00
Daniel Dunbar 360435908c Fix CompilerInstance::createOutputFile to use proper diagnostics, and (try to) update all clients to be able to handle failure.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:30 +00:00
Daniel Dunbar 43adb7e9e9 Remove an unnecessary (I believe) exit() on error.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:19 +00:00
Daniel Dunbar 93ebb1ba9f Switch PCHReader::getOriginalSourceFile to use proper diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90434 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:13:06 +00:00
Daniel Dunbar 3be0d19503 Fix BackendConsumer to use proper diagnostics.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90433 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 09:12:54 +00:00
Daniel Dunbar 9b5e9ae08d clang-cc: Honor -help and -version when using new style option parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90422 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 07:01:58 +00:00
Daniel Dunbar e14b5f5237 Add clang -cc1 support for -remap-file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90414 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:11:16 +00:00
Daniel Dunbar efba227cc5 Add clang -cc1 -load option.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90413 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 05:11:05 +00:00
Daniel Dunbar 5262fda30b Fix ASTUnit to allows require a (persistent) Diagnostic object be provided; propogate and simplify.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-03 01:45:44 +00:00
Daniel Dunbar c7822dbf3c ASTUnit: Explicitly track whether the ASTUnit came from an actual AST or not.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 21:47:43 +00:00
Daniel Dunbar 68ea2ac7fd ASTUnit: Fix initialization of OnlyLocalDecls variable, and honor UseBumpAllocator.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90348 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 21:47:32 +00:00
Mike Stump de05057932 Change rtti/Rtti to RTTI, as it is an acronym.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90334 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:57:08 +00:00
Douglas Gregor 057e567f1b Extend -remap-file=from;to to permit mapping from a non-existent
file. This is accomplished by introducing the notion of a "virtual"
file into the file manager, which provides a FileEntry* for a named
file whose size and modification time are known but which may not
exist on disk.

Added a cute little test that remaps both a .c file and a .h file it
includes to alternative files.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90329 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-02 18:12:28 +00:00