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

18974 Коммитов

Автор SHA1 Сообщение Дата
Daniel Dunbar 4914612675 CIndex: Fix diagnostic callback to not return SourceLocations with a reference to a temporary LangOptions object.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94928 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 23:31:49 +00:00
Daniel Dunbar 35b8440f61 CIndex: Fix ReportSerializedDiagnostics to honor the DiagnosticClient contract
that diagnostics with a source location should occur inside
{Begin,End}SourceFile.

Note that code completion is currently passing in an invalid LangOptions object
due to its implementation, I need to sort this out with Doug.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94927 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 23:31:40 +00:00
Anders Carlsson 966146e891 Remove the SmallVectors from AsmStmt. Fixes PR6105.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94926 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 23:19:41 +00:00
Anders Carlsson ff93dbd887 Use IdentifierInfo * instead of std::string for the AsmStmt names.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94925 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 22:25:16 +00:00
Daniel Dunbar 807b06157a ASTUnit: Ensure the CompilerInvocation object used in LoadFromCommandLine is
live as long as the ASTUnit. This is useful for clients which want to maintain
pointers to the LangOptions object which ultimately lives in the
CompilerInvocation, although it would be nice to make all of this ownership
stuff more explicit and obvious.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94924 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 21:47:16 +00:00
Daniel Dunbar 6228ca0012 CompilerInstance: Change to not contain the CompilerInvocation object.
This allows clients to install their own CompilerInvocation object, which is
important for clients that may wish to create references to things like
LangOptions whose lifetime will extend past that of the CompilerInstance.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94923 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 21:47:07 +00:00
Anders Carlsson 95c9ce952d Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94922 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 20:48:08 +00:00
Anders Carlsson acb6bcb442 Even more AsmStmt cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94921 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 20:38:10 +00:00
Anders Carlsson a5a79f7d16 More asm cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94920 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 20:05:21 +00:00
Benjamin Kramer 3bb6530019 Simplify FreeBSD version parsing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94919 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 19:55:01 +00:00
Anders Carlsson fdba9c0690 Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94918 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 19:34:25 +00:00
Anders Carlsson 83c021c6d3 Yay for more StringRefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94917 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 19:12:25 +00:00
Anders Carlsson f959fb5fb8 StringRef-ize the TargetInfo::ConstraintInfo constructor.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94916 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 18:33:31 +00:00
Anders Carlsson c076c450e4 Add an assert to make sure that we don't try to mess with overridden methods for class templates.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94907 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 17:42:34 +00:00
Benjamin Kramer 7297c18c84 PCHReader doesn't implement classof so dyn_casting it will do really weird stuff. Use a static_cast instead.
I don't know if this hack is the right fix. Doug, please take a look.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94895 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 16:23:25 +00:00
Daniel Dunbar 01aefc6d20 Recognize 'q' as a format length modifier (from BSD).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94894 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 15:49:20 +00:00
Benjamin Kramer f22d1fd96d Use StringRef instead of returning a temporary std::string.
This fixes a really nasty bug in Darwin::getDarwinArchName where we were going
StringRef -> temporary std::string -> StringRef (and return the dead StringRef).
The StringRefs from Triple live as long as the Triple itself, that should be
long enough.

Hopefully 2 of 4 MSVC buildbot failures are gone now.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94892 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 15:01:47 +00:00
Benjamin Kramer e242d5f5fa We don't need to place 0 in the URL string now that we return a StringRef.
- URL can go into read only memory now.
- Compilers will fold away all the strstr calls.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94887 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 14:01:39 +00:00
Anton Korobeynikov 09f52a696e Fix alignment for msp430 integer types.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94879 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 12:55:11 +00:00
Benjamin Kramer 500f189081 Silence clang++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94878 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 12:15:41 +00:00
Anders Carlsson ca755fe38f Eliminate yet another old-school PerformCopyInitialization.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94874 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 01:56:32 +00:00
Ted Kremenek c9a89fec60 Add format string checking of 'double' arguments. Fixes <rdar://problem/6931734>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94867 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 01:02:18 +00:00
Ted Kremenek f7066acc50 Add test case for <rdar://problem/7068334> (which was fixed by r94864).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94865 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 00:56:00 +00:00
Ted Kremenek d635c5fcc4 Add basic type checking of format string conversion specifiers and their arguments. Thanks to Cristian Draghici for his help with this patch!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94864 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-30 00:49:51 +00:00
Ted Kremenek 31f8e32788 Be a little more permissive than C99: allow 'unsigned' to be used for
the field width and precision of a format specifier instead of just
'int'.  This matches GCC, and fixes <rdar://problem/6079850>.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94856 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 23:32:22 +00:00
Ted Kremenek 40888ada60 Fix spacing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94852 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 23:00:35 +00:00
Ted Kremenek 33567d2feb Per a suggestion from Cristian Draghici, add a method to FormatSpecifier that returns the expected type of the matching data argument. It isn't complete, but should handle several of the important cases.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94851 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 22:59:32 +00:00
Devang Patel d528905966 Use appropriate context for typedefs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94849 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 22:29:31 +00:00
Daniel Dunbar 4a5290e773 Driver: Don't honor -std-default for C++, this makes it hard to run the gdb test
suite with clang++ enabled.

The right fix here is PR6175, although we would still have to find a different
work around for the gdb test suite.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94838 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 21:03:02 +00:00
Ted Kremenek f88c8e02da Switch Sema over to using the new implementation of format string
checking.  It passes all existing tests, and the diagnostics have been
refined to provide better range information (we now highlight
individual format specifiers) and more precise wording in the
diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94837 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 20:55:36 +00:00
Ted Kremenek 4dcb18ff9d Enhancements to the alternate (WIP) format string checking:
- Add ConversionSpecifier::consumesDataArgument() as a helper method
  to determine if a conversion specifier requires a matching argument.
- Add support for glibc-specific '%m' conversion
- Add an extra callback to HandleNull() for locations within the
  format specifier that have a null character


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94834 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 20:29:53 +00:00
Douglas Gregor e14654b3b7 PR5909 had a test case for binding of const, non-volatile references
to bitfields. Add it here.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94832 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 19:42:41 +00:00
Douglas Gregor ef06e2451c Fix reference-binding when we have a reference to const volatile type;
previously, we were allowing this to bind to a temporary. Now, we
don't; add test-cases and improve diagnostics.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94831 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 19:39:15 +00:00
Ted Kremenek c0178e9cf4 Fix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead of '='.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94830 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 19:38:24 +00:00
Douglas Gregor de4b1d86bf Fix reference binding of const lvalue references to bit-fields, which
requires a temporary. Previously, we were building an initialization
sequence that bound to the bit-field as if it were a real lvalue. Note
that we previously (and still) diagnose binding of non-const
references to bit-fields, as we should.

There's no real way to test that this code is correct, since reference
binding does not *currently* have any representation in the AST. This
fix should make it easier for that to happen, so I've verified this
fix with...

Added InitializationSequence::dump(), to print an initialization
sequence for debugging purposes.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94826 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 19:14:02 +00:00
Anders Carlsson 3faa486935 And yet another call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 18:43:53 +00:00
Anders Carlsson 38f88abead Another PerformCopyInitialization call bites the dust.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 18:37:50 +00:00
Devang Patel 188aed328a New test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94821 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 18:32:33 +00:00
Anders Carlsson c6acbc58a7 Get rid of another old PerformCopyInitialization call.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94819 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 18:30:20 +00:00
Devang Patel 3dd96a1489 Maintain a map of regions (lexical scopes) and use it to find context for a global variable.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94817 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 18:11:03 +00:00
Ted Kremenek 3c9e03bda5 Add comment to test linking it back to the original Bugzilla PR.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94816 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 18:07:41 +00:00
Douglas Gregor 86b8e09498 When naming a function template via a qualified-id (or any other way
that ADL is suppressed), we need to build an
UnresolvedLookupExpr. Fixes PR6063, which was hitting Boost headers
pretty hard.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94814 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 17:15:43 +00:00
Daniel Dunbar 3239a67361 cindex/Python: Update to support _getInstantiationLocation's new offset value.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94813 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 17:02:32 +00:00
Daniel Dunbar 1a3c1d9dcf Driver/Darwin: Fix a crash when diagnosing conflicting deployment targets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94812 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 17:02:25 +00:00
Douglas Gregor 46287c7922 Name mangling for cast expressions, from Matthias Schiffer! Fixes PR5876.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94811 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 16:37:09 +00:00
Benjamin Kramer ddc6b664e4 Fix typo found by clang++. Yay for -Wuninitialized.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94810 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 15:58:21 +00:00
Chandler Carruth e89d1d5be4 Bring driver link order in CMake into alignment with the order in the Makefile.
This includes the fix in r94797 to reflect the new dependency of Sema on
Analysis.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94806 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 10:03:42 +00:00
Anders Carlsson 4e1c181e2b Add getters.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94803 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 06:34:33 +00:00
Anders Carlsson 9cfe0ec4de Use EmitLValueForFieldInitialization when synthesizing the copy ctor as well.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94800 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 05:41:25 +00:00
Anders Carlsson 06a2970e94 Add a new EmitLValueForFieldInitialization that will be used for initializing fields (and reference type fields in particular).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94799 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-29 05:24:29 +00:00