]> granicus.if.org Git - clang/log
clang
14 years agoCIndex: Fix clang_equalLocations for change to ptr_data field.
Daniel Dunbar [Sat, 30 Jan 2010 23:58:27 +0000 (23:58 +0000)]
CIndex: Fix clang_equalLocations for change to ptr_data field.

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

14 years agoSimplify.
Daniel Dunbar [Sat, 30 Jan 2010 23:31:57 +0000 (23:31 +0000)]
Simplify.

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

14 years agoCIndex: Fix diagnostic callback to not return SourceLocations with a reference to...
Daniel Dunbar [Sat, 30 Jan 2010 23:31:49 +0000 (23:31 +0000)]
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

14 years agoCIndex: Fix ReportSerializedDiagnostics to honor the DiagnosticClient contract
Daniel Dunbar [Sat, 30 Jan 2010 23:31:40 +0000 (23:31 +0000)]
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

14 years agoRemove the SmallVectors from AsmStmt. Fixes PR6105.
Anders Carlsson [Sat, 30 Jan 2010 23:19:41 +0000 (23:19 +0000)]
Remove the SmallVectors from AsmStmt. Fixes PR6105.

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

14 years agoUse IdentifierInfo * instead of std::string for the AsmStmt names.
Anders Carlsson [Sat, 30 Jan 2010 22:25:16 +0000 (22:25 +0000)]
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

14 years agoASTUnit: Ensure the CompilerInvocation object used in LoadFromCommandLine is
Daniel Dunbar [Sat, 30 Jan 2010 21:47:16 +0000 (21:47 +0000)]
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

14 years agoCompilerInstance: Change to not contain the CompilerInvocation object.
Daniel Dunbar [Sat, 30 Jan 2010 21:47:07 +0000 (21:47 +0000)]
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

14 years agoFix thinko.
Anders Carlsson [Sat, 30 Jan 2010 20:48:08 +0000 (20:48 +0000)]
Fix thinko.

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

14 years agoEven more AsmStmt cleanup.
Anders Carlsson [Sat, 30 Jan 2010 20:38:10 +0000 (20:38 +0000)]
Even more AsmStmt cleanup.

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

14 years agoMore asm cleanup.
Anders Carlsson [Sat, 30 Jan 2010 20:05:21 +0000 (20:05 +0000)]
More asm cleanup.

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

14 years agoSimplify FreeBSD version parsing.
Benjamin Kramer [Sat, 30 Jan 2010 19:55:01 +0000 (19:55 +0000)]
Simplify FreeBSD version parsing.

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

14 years agoCombine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.
Anders Carlsson [Sat, 30 Jan 2010 19:34:25 +0000 (19:34 +0000)]
Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.

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

14 years agoYay for more StringRefs.
Anders Carlsson [Sat, 30 Jan 2010 19:12:25 +0000 (19:12 +0000)]
Yay for more StringRefs.

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

14 years agoStringRef-ize the TargetInfo::ConstraintInfo constructor.
Anders Carlsson [Sat, 30 Jan 2010 18:33:31 +0000 (18:33 +0000)]
StringRef-ize the TargetInfo::ConstraintInfo constructor.

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

14 years agoAdd an assert to make sure that we don't try to mess with overridden methods for...
Anders Carlsson [Sat, 30 Jan 2010 17:42:34 +0000 (17:42 +0000)]
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

14 years agoPCHReader doesn't implement classof so dyn_casting it will do really weird stuff...
Benjamin Kramer [Sat, 30 Jan 2010 16:23:25 +0000 (16:23 +0000)]
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

14 years agoRecognize 'q' as a format length modifier (from BSD).
Daniel Dunbar [Sat, 30 Jan 2010 15:49:20 +0000 (15:49 +0000)]
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

14 years agoUse StringRef instead of returning a temporary std::string.
Benjamin Kramer [Sat, 30 Jan 2010 15:01:47 +0000 (15:01 +0000)]
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

14 years agoWe don't need to place 0 in the URL string now that we return a StringRef.
Benjamin Kramer [Sat, 30 Jan 2010 14:01:39 +0000 (14:01 +0000)]
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

14 years agoFix alignment for msp430 integer types.
Anton Korobeynikov [Sat, 30 Jan 2010 12:55:11 +0000 (12:55 +0000)]
Fix alignment for msp430 integer types.

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

14 years agoSilence clang++ warning.
Benjamin Kramer [Sat, 30 Jan 2010 12:15:41 +0000 (12:15 +0000)]
Silence clang++ warning.

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

14 years agoEliminate yet another old-school PerformCopyInitialization.
Anders Carlsson [Sat, 30 Jan 2010 01:56:32 +0000 (01:56 +0000)]
Eliminate yet another old-school PerformCopyInitialization.

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

14 years agoAdd format string checking of 'double' arguments. Fixes <rdar://problem/6931734>.
Ted Kremenek [Sat, 30 Jan 2010 01:02:18 +0000 (01:02 +0000)]
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

14 years agoAdd test case for <rdar://problem/7068334> (which was fixed by r94864).
Ted Kremenek [Sat, 30 Jan 2010 00:56:00 +0000 (00:56 +0000)]
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

14 years agoAdd basic type checking of format string conversion specifiers and their arguments...
Ted Kremenek [Sat, 30 Jan 2010 00:49:51 +0000 (00:49 +0000)]
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

14 years agoBe a little more permissive than C99: allow 'unsigned' to be used for
Ted Kremenek [Fri, 29 Jan 2010 23:32:22 +0000 (23:32 +0000)]
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

14 years agoFix spacing.
Ted Kremenek [Fri, 29 Jan 2010 23:00:35 +0000 (23:00 +0000)]
Fix spacing.

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

14 years agoPer a suggestion from Cristian Draghici, add a method to FormatSpecifier that returns...
Ted Kremenek [Fri, 29 Jan 2010 22:59:32 +0000 (22:59 +0000)]
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

14 years agoUse appropriate context for typedefs.
Devang Patel [Fri, 29 Jan 2010 22:29:31 +0000 (22:29 +0000)]
Use appropriate context for typedefs.

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

14 years agoDriver: Don't honor -std-default for C++, this makes it hard to run the gdb test
Daniel Dunbar [Fri, 29 Jan 2010 21:03:02 +0000 (21:03 +0000)]
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

14 years agoSwitch Sema over to using the new implementation of format string
Ted Kremenek [Fri, 29 Jan 2010 20:55:36 +0000 (20:55 +0000)]
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

14 years agoEnhancements to the alternate (WIP) format string checking:
Ted Kremenek [Fri, 29 Jan 2010 20:29:53 +0000 (20:29 +0000)]
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

14 years agoPR5909 had a test case for binding of const, non-volatile references
Douglas Gregor [Fri, 29 Jan 2010 19:42:41 +0000 (19:42 +0000)]
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

14 years agoFix reference-binding when we have a reference to const volatile type;
Douglas Gregor [Fri, 29 Jan 2010 19:39:15 +0000 (19:39 +0000)]
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

14 years agoFix subtle bug in Preprocessor::AdvanceToTokenCharacter(): use '+=' instead of '='.
Ted Kremenek [Fri, 29 Jan 2010 19:38:24 +0000 (19:38 +0000)]
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

14 years agoFix reference binding of const lvalue references to bit-fields, which
Douglas Gregor [Fri, 29 Jan 2010 19:14:02 +0000 (19:14 +0000)]
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

14 years agoAnd yet another call.
Anders Carlsson [Fri, 29 Jan 2010 18:43:53 +0000 (18:43 +0000)]
And yet another call.

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

14 years agoAnother PerformCopyInitialization call bites the dust.
Anders Carlsson [Fri, 29 Jan 2010 18:37:50 +0000 (18:37 +0000)]
Another PerformCopyInitialization call bites the dust.

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

14 years agoNew test case.
Devang Patel [Fri, 29 Jan 2010 18:32:33 +0000 (18:32 +0000)]
New test case.

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

14 years agoGet rid of another old PerformCopyInitialization call.
Anders Carlsson [Fri, 29 Jan 2010 18:30:20 +0000 (18:30 +0000)]
Get rid of another old PerformCopyInitialization call.

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

14 years agoMaintain a map of regions (lexical scopes) and use it to find context for a global...
Devang Patel [Fri, 29 Jan 2010 18:11:03 +0000 (18:11 +0000)]
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

14 years agoAdd comment to test linking it back to the original Bugzilla PR.
Ted Kremenek [Fri, 29 Jan 2010 18:07:41 +0000 (18:07 +0000)]
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

14 years agoWhen naming a function template via a qualified-id (or any other way
Douglas Gregor [Fri, 29 Jan 2010 17:15:43 +0000 (17:15 +0000)]
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

14 years agocindex/Python: Update to support _getInstantiationLocation's new offset value.
Daniel Dunbar [Fri, 29 Jan 2010 17:02:32 +0000 (17:02 +0000)]
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

14 years agoDriver/Darwin: Fix a crash when diagnosing conflicting deployment targets.
Daniel Dunbar [Fri, 29 Jan 2010 17:02:25 +0000 (17:02 +0000)]
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

14 years agoName mangling for cast expressions, from Matthias Schiffer! Fixes PR5876.
Douglas Gregor [Fri, 29 Jan 2010 16:37:09 +0000 (16:37 +0000)]
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

14 years agoFix typo found by clang++. Yay for -Wuninitialized.
Benjamin Kramer [Fri, 29 Jan 2010 15:58:21 +0000 (15:58 +0000)]
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

14 years agoBring driver link order in CMake into alignment with the order in the Makefile.
Chandler Carruth [Fri, 29 Jan 2010 10:03:42 +0000 (10:03 +0000)]
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

14 years agoAdd getters.
Anders Carlsson [Fri, 29 Jan 2010 06:34:33 +0000 (06:34 +0000)]
Add getters.

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

14 years agoUse EmitLValueForFieldInitialization when synthesizing the copy ctor as well.
Anders Carlsson [Fri, 29 Jan 2010 05:41:25 +0000 (05:41 +0000)]
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

14 years agoAdd a new EmitLValueForFieldInitialization that will be used for initializing fields...
Anders Carlsson [Fri, 29 Jan 2010 05:24:29 +0000 (05:24 +0000)]
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

14 years agoSimplify EmitLValueForField - we can get whether the field is part of a union or...
Anders Carlsson [Fri, 29 Jan 2010 05:05:36 +0000 (05:05 +0000)]
Simplify EmitLValueForField - we can get whether the field is part of a union or not from the FieldDecl (through its DeclContext).

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

14 years agoFix linking problem on Linux.
Zhongxing Xu [Fri, 29 Jan 2010 03:25:47 +0000 (03:25 +0000)]
Fix linking problem on Linux.

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

14 years agoARM/APCS ABI: Fix some problems with bit-fields in structures. After rereading
Daniel Dunbar [Fri, 29 Jan 2010 03:22:29 +0000 (03:22 +0000)]
ARM/APCS ABI: Fix some problems with bit-fields in structures. After rereading
the ABI spec, this turns out to simplify the code. We still have some annoying
code which mismatches the spec with regard to empty structures.

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

14 years agoAlternate format string checking: issue warnings for incomplete format specifiers.
Ted Kremenek [Fri, 29 Jan 2010 03:16:21 +0000 (03:16 +0000)]
Alternate format string checking: issue warnings for incomplete format specifiers.

In addition, move ParseFormatString() and FormatStringHandler() from
the clang::analyze_printf to the clang namespace.  Hopefully this will
resolve some link errors on Linux.

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

14 years agoSimplify InitListChecker::CheckReferenceType
Anders Carlsson [Fri, 29 Jan 2010 02:47:33 +0000 (02:47 +0000)]
Simplify InitListChecker::CheckReferenceType

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

14 years agoAlternate format string checking: issue a warning for invalid conversion specifiers.
Ted Kremenek [Fri, 29 Jan 2010 02:40:24 +0000 (02:40 +0000)]
Alternate format string checking: issue a warning for invalid conversion specifiers.

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

14 years agoAdd an CXXBindReferenceExpr (not used just yet).
Anders Carlsson [Fri, 29 Jan 2010 02:39:32 +0000 (02:39 +0000)]
Add an CXXBindReferenceExpr (not used just yet).

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

14 years agoYet another attempt to make the Linux buildbots happy. Apparently there are differen...
Ted Kremenek [Fri, 29 Jan 2010 02:13:53 +0000 (02:13 +0000)]
Yet another attempt to make the Linux buildbots happy.  Apparently there are differences on how nested namespaces are handled...

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

14 years agoUpdate .xcodeproj file (Yes this is getting old and I should really switch to the...
Anders Carlsson [Fri, 29 Jan 2010 01:56:42 +0000 (01:56 +0000)]
Update .xcodeproj file (Yes this is getting old and I should really switch to the cmake based project :)

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

14 years agoFixes rewriter bug rewriting byref related API where a struct
Fariborz Jahanian [Fri, 29 Jan 2010 01:55:49 +0000 (01:55 +0000)]
Fixes rewriter bug rewriting byref related API where a struct
definition comes after where it is needed. Fixes radar 7589385.

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

14 years agoAlternate format string checking: check for excess data arguments.
Ted Kremenek [Fri, 29 Jan 2010 01:50:07 +0000 (01:50 +0000)]
Alternate format string checking: check for excess data arguments.

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

14 years agoDo a little magic and a little greasework to make it much more efficient
John McCall [Fri, 29 Jan 2010 01:45:37 +0000 (01:45 +0000)]
Do a little magic and a little greasework to make it much more efficient
to cast a DeclContext down to a specific implementation class.

There are still lots of calls to Decl::castFromDeclContext left, mostly
arising from DeclContext::getParent().

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

14 years agoAlternate format string checking: check if the number of format specifiers exceeds...
Ted Kremenek [Fri, 29 Jan 2010 01:43:31 +0000 (01:43 +0000)]
Alternate format string checking: check if the number of format specifiers exceeds the number of arguments.

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

14 years agoMove definition of FormatStringHandler::~FormatStringHandler() within namespace direc...
Ted Kremenek [Fri, 29 Jan 2010 01:37:52 +0000 (01:37 +0000)]
Move definition of FormatStringHandler::~FormatStringHandler() within namespace directives.  Hopefully this will make the Linux buildbots happy.

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

14 years agoAlternate format string checking: warn of '%n' as being potentially insecure.
Ted Kremenek [Fri, 29 Jan 2010 01:35:25 +0000 (01:35 +0000)]
Alternate format string checking: warn of '%n' as being potentially insecure.

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

14 years agoAdd precision/field width checking to AlternateCheckPrintfString().
Ted Kremenek [Fri, 29 Jan 2010 01:06:55 +0000 (01:06 +0000)]
Add precision/field width checking to AlternateCheckPrintfString().

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

14 years agoHarden the CIndex implementation a bit, so that it does not assert
Douglas Gregor [Fri, 29 Jan 2010 00:47:48 +0000 (00:47 +0000)]
Harden the CIndex implementation a bit, so that it does not assert
when given bad inputs.

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

14 years agoWhen printing diagnostics in c-index-test, also print source ranges
Douglas Gregor [Fri, 29 Jan 2010 00:41:11 +0000 (00:41 +0000)]
When printing diagnostics in c-index-test, also print source ranges
and fix-it information, so we can see everything in one place. Along
the way, fix a few bugs with deserialization and query of diagnostics
in CIndex.

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

14 years agoFix off-by-one error in ParseFormatSpecifier() when reporting the location of a null...
Ted Kremenek [Thu, 28 Jan 2010 23:56:52 +0000 (23:56 +0000)]
Fix off-by-one error in ParseFormatSpecifier() when reporting the location of a null character.

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

14 years agoStart fleshing out Sema::AlternateCheckPrintfString():
Ted Kremenek [Thu, 28 Jan 2010 23:39:18 +0000 (23:39 +0000)]
Start fleshing out Sema::AlternateCheckPrintfString():
- Add an anonymous class 'CheckPrintfHandler' which will do the
  checking of specific format specifiers
- Add checking for using the '@' conversion specifier outside
  an ObjC string literal
- Add checking for null characters within the string

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

14 years agos/CGDebugInfo::getContext/CGDebugInfo::getContextDescriptor/g to avoid confusion.
Devang Patel [Thu, 28 Jan 2010 23:15:27 +0000 (23:15 +0000)]
s/CGDebugInfo::getContext/CGDebugInfo::getContextDescriptor/g to avoid confusion.

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

14 years agoFix indentation.
Devang Patel [Thu, 28 Jan 2010 21:54:15 +0000 (21:54 +0000)]
Fix indentation.

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

14 years agoStatic methods do not need "this" pointer argument.
Devang Patel [Thu, 28 Jan 2010 21:43:50 +0000 (21:43 +0000)]
Static methods do not need "this" pointer argument.

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

14 years agoEmit base classes info first, as expected by the debugger.
Devang Patel [Thu, 28 Jan 2010 21:41:35 +0000 (21:41 +0000)]
Emit base classes info first, as expected by the debugger.

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

14 years agoFix an incorrect union layout assert. Fixes PR6164.
Anders Carlsson [Thu, 28 Jan 2010 18:22:03 +0000 (18:22 +0000)]
Fix an incorrect union layout assert. Fixes PR6164.

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

14 years agos/FunctionNames/DebugInfoNames/g
Devang Patel [Thu, 28 Jan 2010 18:21:00 +0000 (18:21 +0000)]
s/FunctionNames/DebugInfoNames/g

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

14 years agoEmit vtable info.
Devang Patel [Thu, 28 Jan 2010 18:11:52 +0000 (18:11 +0000)]
Emit vtable info.

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

14 years agoAccess control for surrogate function calls. Required a moderately gross hack
John McCall [Thu, 28 Jan 2010 07:38:46 +0000 (07:38 +0000)]
Access control for surrogate function calls.  Required a moderately gross hack
to get the access bits set properly in conversion sets.

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

14 years agoIntroduce serialization and deserialization of diagnostic information
Douglas Gregor [Thu, 28 Jan 2010 06:00:51 +0000 (06:00 +0000)]
Introduce serialization and deserialization of diagnostic information
so that CIndex can report diagnostics through the normal mechanisms
even when executing Clang in a separate process. This applies both
when performing code completion and when using ASTs as an intermediary
for clang_createTranslationUnitFromSourceFile().

The serialized format is not perfect at the moment, because it does
not encapsulate macro-instantiation information. Instead, it maps all
source locations back to the instantiation location. However, it does
maintain source-range and fix-it information. To get perfect fidelity
from the serialized format would require serializing a large chunk of
the source manager; at present, it isn't clear if this code will live
long enough for that to matter.

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

14 years agoAdd position of conversion specifier character to 'ConversionSpecifier'.
Ted Kremenek [Thu, 28 Jan 2010 02:46:17 +0000 (02:46 +0000)]
Add position of conversion specifier character to 'ConversionSpecifier'.

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

14 years agoRename namespace clang::printf to clang::analyze_printf to avoid problems where the...
Ted Kremenek [Thu, 28 Jan 2010 02:02:59 +0000 (02:02 +0000)]
Rename namespace clang::printf to clang::analyze_printf to avoid problems where the reference to 'printf' is ambiguous.

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

14 years agoAccess control for overloaded call operators. Not for surrogates yet,
John McCall [Thu, 28 Jan 2010 01:54:34 +0000 (01:54 +0000)]
Access control for overloaded call operators.  Not for surrogates yet,
mostly because we're going to want a better diagnostic for conversions.

Also this API needs to go back to sanity.

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

14 years agoAccess checking for overloaded operators.
John McCall [Thu, 28 Jan 2010 01:42:12 +0000 (01:42 +0000)]
Access checking for overloaded operators.

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

14 years agoFixes a rewrite bug rewriting nested ivars reference.
Fariborz Jahanian [Thu, 28 Jan 2010 01:41:20 +0000 (01:41 +0000)]
Fixes a rewrite bug rewriting nested ivars reference.
(Radar 7583971).

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

14 years agoAdd placeholder function in Sema for new format string checking logic.
Ted Kremenek [Thu, 28 Jan 2010 01:18:22 +0000 (01:18 +0000)]
Add placeholder function in Sema for new format string checking logic.
This function will use the format string parsing logic in libAnalysis,
and once it is shown to be better than the current implementation it
will replace AlternateCheckPrintfString() entirely.

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

14 years agoFix 80 col violation.
Ted Kremenek [Thu, 28 Jan 2010 01:04:48 +0000 (01:04 +0000)]
Fix 80 col violation.

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

14 years agoAllow HandleFormatSpecifier() to indicate that no more processing of the format strin...
Ted Kremenek [Thu, 28 Jan 2010 01:00:59 +0000 (01:00 +0000)]
Allow HandleFormatSpecifier() to indicate that no more processing of the format string is desired.

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

14 years agoSwitch the remaining diagnostic printing in CIndex over to the
Douglas Gregor [Thu, 28 Jan 2010 00:56:43 +0000 (00:56 +0000)]
Switch the remaining diagnostic printing in CIndex over to the
diagnostic callback mechanism, so all diagnostics now go through that
callback. Also, eliminate the displayDiagnostics flag to
clang_createIndex(), since it is no longer necessary: the client
determines whether to display diagnostics or not.

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

14 years agoAdd '@' conversion specifier.
Ted Kremenek [Thu, 28 Jan 2010 00:55:28 +0000 (00:55 +0000)]
Add '@' conversion specifier.

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

14 years agoWhile emitting debugging infor for a C++ class, identify the holder of class's vtable...
Devang Patel [Thu, 28 Jan 2010 00:54:21 +0000 (00:54 +0000)]
While emitting debugging infor for a C++ class, identify the holder of class's vtable, if any.

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

14 years agoInclude "this" pointer argument while emitting debug info for a C++ method.
Devang Patel [Thu, 28 Jan 2010 00:28:01 +0000 (00:28 +0000)]
Include "this" pointer argument while emitting debug info for a C++ method.

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

14 years agoImplement a diagnostics callback for the C interface to Clang, so that
Douglas Gregor [Thu, 28 Jan 2010 00:27:43 +0000 (00:27 +0000)]
Implement a diagnostics callback for the C interface to Clang, so that
clients can format diagnostics as they wish rather than having to
parse standard error. All of the important parts of the front end's
diagnostics are exposed: text, severity, location, source ranges, and
fix-its. The diagnostics callback is now available with
clang_createTranslationUnitFromSource() and
clang_createTranslationUnit().

As part of this change, CXSourceLocation and CXSourceRange got one
pointer larger, since we need to hold on to the SourceManager and
LangOptions structures in the source location. This is the minimum
amount of information needed for the functions that operate on source
locations and ranges (as implemented now). Previously we held on to
the ASTContext, but the diagnostics callback can end up with source
locations when there is no ASTContext (or preprocessor).

Still to do:
  - Code completion needs to support the diagnostics callback, once we
  have the ability to (de-)serialize diagnostics.
  - Eliminate the "displayDiagnostics" argument to createIndex; we'll
  always pass diagnostics to the callback and let it deal with display.

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

14 years agoRemove invalid conversion specifiers from format string checking.
Ted Kremenek [Thu, 28 Jan 2010 00:17:51 +0000 (00:17 +0000)]
Remove invalid conversion specifiers from format string checking.

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

14 years agoAdd a few more conversion specifiers to ParseFormatSpecifier (these appear in SemaChe...
Ted Kremenek [Thu, 28 Jan 2010 00:02:05 +0000 (00:02 +0000)]
Add a few more conversion specifiers to ParseFormatSpecifier (these appear in SemaChecking).

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

14 years agoAdd skeleton for a more structured way to analyzing pring format
Ted Kremenek [Wed, 27 Jan 2010 23:43:25 +0000 (23:43 +0000)]
Add skeleton for a more structured way to analyzing pring format
strings than what we currently have in Sema.  This is both an
experiment and a WIP.

The idea is simple: parse the format string incrementally,
constructing a well-structure representation of each format specifier.
Each format specifier is then handed back one-by-one to a client via a
callback.  Malformed format strings are also handled with callbacks.
The idea is to separate the parsing of the format string from the
emission of diagnostics.  Currently what we have in Sema for handling
format strings is a mongrel of both that is hard to follow and
difficult to modify (I can apply this label since I'm the original
author of that code).

This is in libAnalysis as it is reasonable generic and can potentially
be used both by libSema and libChecker.

Comments welcome.

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

14 years agoRemove ModuleProviders from clang after r94686 removed them from LLVM.
Jeffrey Yasskin [Wed, 27 Jan 2010 21:12:04 +0000 (21:12 +0000)]
Remove ModuleProviders from clang after r94686 removed them from LLVM.

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

14 years agoARM/APCS: Fix alignment of long double.
Daniel Dunbar [Wed, 27 Jan 2010 20:23:08 +0000 (20:23 +0000)]
ARM/APCS: Fix alignment of long double.

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

14 years agoMove more naming conventions logic out of the retain/release checker to CocoaConventi...
Ted Kremenek [Wed, 27 Jan 2010 18:00:17 +0000 (18:00 +0000)]
Move more naming conventions logic out of the retain/release checker to CocoaConventions.h.

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