]> granicus.if.org Git - clang/log
clang
15 years agoEvaluate casts to complex.
Daniel Dunbar [Thu, 29 Jan 2009 06:16:07 +0000 (06:16 +0000)]
Evaluate casts to complex.
 - Lift (int,float) -> (int,float) conversion into separate routines.

 - Fix handling of, e.g., char -> _Complex int, which was producing a
   _Complex char value instead.

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

15 years agoccc: Honor -ccc-clang for generic GCC toolchain.
Daniel Dunbar [Thu, 29 Jan 2009 06:12:22 +0000 (06:12 +0000)]
ccc: Honor -ccc-clang for generic GCC toolchain.

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

15 years agoupdate the project file for headers moving
Chris Lattner [Thu, 29 Jan 2009 05:30:38 +0000 (05:30 +0000)]
update the project file for headers moving

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

15 years agoFix a wart that existed from before we had EXTWARN.
Chris Lattner [Thu, 29 Jan 2009 05:23:19 +0000 (05:23 +0000)]
Fix a wart that existed from before we had EXTWARN.

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

15 years agomove library-specific diagnostic headers into library private dirs. Reduce
Chris Lattner [Thu, 29 Jan 2009 05:15:15 +0000 (05:15 +0000)]
move library-specific diagnostic headers into library private dirs.  Reduce
redundant #includes.  Patch by Anders Johnsen!

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

15 years agofix an absolutely inscrutible gcc 4.0 error:
Chris Lattner [Thu, 29 Jan 2009 05:10:57 +0000 (05:10 +0000)]
fix an absolutely inscrutible gcc 4.0 error:

llvm[0]: Compiling SemaInit.cpp for Debug build
SemaInit.cpp:171: error: ‘InitListChecker’ has not been declared
SemaInit.cpp:171: error: ISO C++ forbids declaration of ‘InitListChecker’ with no type
SemaInit.cpp: In function ‘int InitListChecker(clang::Sema*, clang::InitListExpr*, clang::QualType&)’:
SemaInit.cpp:172: error: ‘hadError’ was not declared in this scope
SemaInit.cpp:173: error: ‘SemaRef’ was not declared in this scope
SemaInit.cpp:177: error: ‘FullyStructuredList’ was not declared in this scope

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

15 years agoAdd folding for complex mul and fix some major bugs in complex float
Daniel Dunbar [Thu, 29 Jan 2009 01:32:56 +0000 (01:32 +0000)]
Add folding for complex mul and fix some major bugs in complex float
evaluation (alternate part of real/imag init was being set to 3 not 0
because the wrong APFloat constructor was being called).
 - Test cases coming once some more support is in.

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

15 years agoAdd another devilish testcase for designated initializers
Douglas Gregor [Thu, 29 Jan 2009 01:10:11 +0000 (01:10 +0000)]
Add another devilish testcase for designated initializers

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

15 years agoBetter documentation for our initialization checker
Douglas Gregor [Thu, 29 Jan 2009 01:05:33 +0000 (01:05 +0000)]
Better documentation for our initialization checker

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

15 years agoMove InitListChecker out of Sema.h
Douglas Gregor [Thu, 29 Jan 2009 00:45:39 +0000 (00:45 +0000)]
Move InitListChecker out of Sema.h

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

15 years agoEliminate infinite looping in a wacky case with designated initializers. Simplifies...
Douglas Gregor [Thu, 29 Jan 2009 00:39:20 +0000 (00:39 +0000)]
Eliminate infinite looping in a wacky case with designated initializers. Simplifies (somewhat) the actually checking of the initializer expression following the designators

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

15 years agoRefactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInCon...
Steve Naroff [Thu, 29 Jan 2009 00:07:50 +0000 (00:07 +0000)]
Refactor Sema::LookupDecl() into 2 functions: LookupDeclInScope() and LookupDeclInContext().

The previous interface was very confusing. This is much more explicit, which will be easier to understand/optimize/convert.

The plan is to eventually deprecate both of these functions. For now, I'm focused on performance.

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

15 years agoRemove Expr::hasSideEffects. It doesn't work anyway
Douglas Gregor [Wed, 28 Jan 2009 23:43:32 +0000 (23:43 +0000)]
Remove Expr::hasSideEffects. It doesn't work anyway

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

15 years agoImprovements to code-generation and semantic analysis of designated
Douglas Gregor [Wed, 28 Jan 2009 23:36:17 +0000 (23:36 +0000)]
Improvements to code-generation and semantic analysis of designated
initializers.

  - We now initialize unions properly when a member other than the
    first is named by a designated initializer.
  - We now provide proper semantic analysis and code generation for
    GNU array-range designators *except* that side effects will occur
    more than once. We warn about this.

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

15 years agoAdd setter/getter methods to the list of methods
Fariborz Jahanian [Wed, 28 Jan 2009 22:46:49 +0000 (22:46 +0000)]
Add setter/getter methods to the list of methods
of class's meta-data (related to objc2 nonfragile abi).

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

15 years agoRemove '#if 0' code.
Ted Kremenek [Wed, 28 Jan 2009 22:35:55 +0000 (22:35 +0000)]
Remove '#if 0' code.

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

15 years agoRemove method 'AddNE' from the public interface of ConstraintManager.
Ted Kremenek [Wed, 28 Jan 2009 22:27:59 +0000 (22:27 +0000)]
Remove method 'AddNE' from the public interface of ConstraintManager.

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

15 years agoImplement basic _Complex integer constant folding.
Daniel Dunbar [Wed, 28 Jan 2009 22:24:07 +0000 (22:24 +0000)]
Implement basic _Complex integer constant folding.
 - Merged into single ComplexEvaluator, these share too much logic to
   be worth splitting for float/int (IMHO). Will split on request.

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

15 years agoproperty metadata for objc2's nonfragile abi
Fariborz Jahanian [Wed, 28 Jan 2009 22:18:42 +0000 (22:18 +0000)]
property metadata for objc2's nonfragile abi

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

15 years agoAdd some comments to GRStateManager. No functionality change.
Ted Kremenek [Wed, 28 Jan 2009 22:11:38 +0000 (22:11 +0000)]
Add some comments to GRStateManager.  No functionality change.

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

15 years agoCode generation support for C99 designated initializers.
Douglas Gregor [Wed, 28 Jan 2009 21:54:33 +0000 (21:54 +0000)]
Code generation support for C99 designated initializers.

The approach I've taken in this patch is relatively straightforward,
although the code itself is non-trivial. Essentially, as we process
an initializer list we build up a fully-explicit representation of the
initializer list, where each of the subobject initializations occurs
in order. Designators serve to "fill in" subobject initializations in
a non-linear way. The fully-explicit representation makes initializer
lists (both with and without designators) easy to grok for codegen and
later semantic analyses. We keep the syntactic form of the initializer
list linked into the AST for those clients interested in exactly what
the user wrote.

Known limitations:
  - Designating a member of a union that isn't the first member may
    result in bogus initialization (we warn about this)
  - GNU array-range designators are not supported (we warn about this)

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

15 years agoretain/release checker: Always generate an "autorelease" summary for an "autorelease...
Ted Kremenek [Wed, 28 Jan 2009 21:44:40 +0000 (21:44 +0000)]
retain/release checker: Always generate an "autorelease" summary for an "autorelease" message, and have the summary processing logic treat it as a no-op in GC mode.  This change is motivated to encode more of the semantics in the summaries themselves for eventual better diagnostics.

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

15 years agoHandle complex types in ASTContext::mergeTypes
Daniel Dunbar [Wed, 28 Jan 2009 21:22:12 +0000 (21:22 +0000)]
Handle complex types in ASTContext::mergeTypes

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

15 years agoAdd autorelease test case.
Ted Kremenek [Wed, 28 Jan 2009 21:20:48 +0000 (21:20 +0000)]
Add autorelease test case.

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

15 years agoAdd more PTH diagnostics for invalid PTH files, etc.
Ted Kremenek [Wed, 28 Jan 2009 21:02:43 +0000 (21:02 +0000)]
Add more PTH diagnostics for invalid PTH files, etc.

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

15 years agoEnhance PTHManager::Create() to take an optional Diagnostic* argument that can be...
Ted Kremenek [Wed, 28 Jan 2009 20:49:33 +0000 (20:49 +0000)]
Enhance PTHManager::Create() to take an optional Diagnostic* argument that can be used to report issues such as a missing PTH file.

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

15 years agoFix TextDiagnosticPrinter::HandleDiagnostic to handle invalid FullSourceLocs that...
Ted Kremenek [Wed, 28 Jan 2009 20:47:47 +0000 (20:47 +0000)]
Fix TextDiagnosticPrinter::HandleDiagnostic to handle invalid FullSourceLocs that do not have a SourceManager.

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

15 years agoAdd method FullSourceLoc::getBufferData().
Ted Kremenek [Wed, 28 Jan 2009 20:46:26 +0000 (20:46 +0000)]
Add method FullSourceLoc::getBufferData().

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

15 years agoTweak doxygen comment. No functionality change.
Ted Kremenek [Wed, 28 Jan 2009 20:45:37 +0000 (20:45 +0000)]
Tweak doxygen comment.  No functionality change.

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

15 years agoName change (isTypeName->getTypeName).
Steve Naroff [Wed, 28 Jan 2009 19:39:02 +0000 (19:39 +0000)]
Name change (isTypeName->getTypeName).
Since it doesn't return a bool, is shouldn't be prefixed with 'is'.

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

15 years agoFix test case (for -### printing version)
Daniel Dunbar [Wed, 28 Jan 2009 19:30:43 +0000 (19:30 +0000)]
Fix test case (for -### printing version)

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

15 years agoccc: Support -v; invent a version number for ccc for now, will be
Daniel Dunbar [Wed, 28 Jan 2009 19:26:20 +0000 (19:26 +0000)]
ccc: Support -v; invent a version number for ccc for now, will be
shared with clang eventually.

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

15 years agoChange Parser::ParseFunctionDeclarator() to annotate typename tokens.
Steve Naroff [Wed, 28 Jan 2009 19:16:40 +0000 (19:16 +0000)]
Change Parser::ParseFunctionDeclarator() to annotate typename tokens.

This removes ~10% of the calls to Sema::isTypeName(), which amount to a little less than a 1% reduction in usertime (for Cocoa.h).

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

15 years agoSome refactoring of common code. No change in functionality.
Fariborz Jahanian [Wed, 28 Jan 2009 19:12:34 +0000 (19:12 +0000)]
Some refactoring of common code. No change in functionality.

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

15 years agoImplement pointer to member handling in static_cast.
Sebastian Redl [Wed, 28 Jan 2009 18:33:18 +0000 (18:33 +0000)]
Implement pointer to member handling in static_cast.
Fix a stupid mistake in UnwrapSimilarPointers that made any two member pointers compatible as long as the pointee was the same.
Make a few style corrections as suggested by Chris.

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

15 years agoComplete semantic checking for typedef redeclarations in C++. The
Douglas Gregor [Wed, 28 Jan 2009 17:15:10 +0000 (17:15 +0000)]
Complete semantic checking for typedef redeclarations in C++. The
rules are slightly different than in C, and now we handle both
dialects properly.

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

15 years agoRemove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.
Steve Naroff [Wed, 28 Jan 2009 16:09:22 +0000 (16:09 +0000)]
Remove 'NamespaceNameOnly' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.

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

15 years agoRemove 'enableLazyBuiltinCreation' argument to Sema::LookupDecl(). It is unused.
Steve Naroff [Wed, 28 Jan 2009 15:51:12 +0000 (15:51 +0000)]
Remove 'enableLazyBuiltinCreation' argument to Sema::LookupDecl(). It is unused.

Even though Sema::LookupDecl() is deprecated, it's still used all over the place. Simplifying the interface will make it easier to understand/optimize/convert.

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

15 years agoUpdated checker build.
Ted Kremenek [Wed, 28 Jan 2009 15:05:42 +0000 (15:05 +0000)]
Updated checker build.

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

15 years agoUpdate comment.
Ted Kremenek [Wed, 28 Jan 2009 07:10:33 +0000 (07:10 +0000)]
Update comment.

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

15 years agolong long and double have 64-bit alignment on x86-64.
Chris Lattner [Wed, 28 Jan 2009 06:58:19 +0000 (06:58 +0000)]
long long and double have 64-bit alignment on x86-64.

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

15 years agoadd some basic file headers
Chris Lattner [Wed, 28 Jan 2009 06:31:57 +0000 (06:31 +0000)]
add some basic file headers

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

15 years agoretain/release checker: Improve diagnostics to indicate that CF objects are not autom...
Ted Kremenek [Wed, 28 Jan 2009 06:25:48 +0000 (06:25 +0000)]
retain/release checker: Improve diagnostics to indicate that CF objects are not automatically garbage collected.

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

15 years agoretain/release checker: Indicate whether a tracked object is a Core Foundation or...
Ted Kremenek [Wed, 28 Jan 2009 06:06:36 +0000 (06:06 +0000)]
retain/release checker: Indicate whether a tracked object is a Core Foundation or Objective-C object.

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

15 years agoadd diagnostics files to xcode proj
Chris Lattner [Wed, 28 Jan 2009 06:02:52 +0000 (06:02 +0000)]
add diagnostics files to xcode proj

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

15 years agoretain/release checker: More diagnostic refactoring.
Ted Kremenek [Wed, 28 Jan 2009 06:01:42 +0000 (06:01 +0000)]
retain/release checker: More diagnostic refactoring.

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

15 years agoretain/release checker: Embed an "object type" into the RetEffect/RetVal objects...
Ted Kremenek [Wed, 28 Jan 2009 05:56:51 +0000 (05:56 +0000)]
retain/release checker: Embed an "object type" into the RetEffect/RetVal objects to help distinguish between Objective-C and Core Foundation objects (for better diagnostics).

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

15 years agofix a crash I introduced, thanks to Ted for the awesome reduced
Chris Lattner [Wed, 28 Jan 2009 05:42:38 +0000 (05:42 +0000)]
fix a crash I introduced, thanks to Ted for the awesome reduced
testcase :)

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

15 years agoretain/release checker: More cleanups (no real functionality change).
Ted Kremenek [Wed, 28 Jan 2009 05:29:13 +0000 (05:29 +0000)]
retain/release checker: More cleanups (no real functionality change).

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

15 years agoFix diagnostic truncated by my last patch.
Ted Kremenek [Wed, 28 Jan 2009 05:18:08 +0000 (05:18 +0000)]
Fix diagnostic truncated by my last patch.

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

15 years agoretain/release checker: More diagnostic refactoring.
Ted Kremenek [Wed, 28 Jan 2009 05:15:02 +0000 (05:15 +0000)]
retain/release checker: More diagnostic refactoring.

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

15 years agoretain/release checker: Output the name of the function that allocates an object.
Ted Kremenek [Wed, 28 Jan 2009 05:06:46 +0000 (05:06 +0000)]
retain/release checker: Output the name of the function that allocates an object.

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

15 years agoRefactor some diagnostic code to use raw_string_ostream. No functionality change.
Ted Kremenek [Wed, 28 Jan 2009 04:47:13 +0000 (04:47 +0000)]
Refactor some diagnostic code to use raw_string_ostream.  No functionality change.

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

15 years agoRemove '#if 0' code.
Ted Kremenek [Wed, 28 Jan 2009 04:37:52 +0000 (04:37 +0000)]
Remove '#if 0' code.

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

15 years agoPatch by Alexei Svitkine: Refactor Sema::ParseAST API to allow clients to pass as...
Ted Kremenek [Wed, 28 Jan 2009 04:29:29 +0000 (04:29 +0000)]
Patch by Alexei Svitkine: Refactor Sema::ParseAST API to allow clients to pass as an argument a TranslationUnit object whose contents live beyond the call to ParseAST.

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

15 years agoAdd a preliminary version number.
Mike Stump [Wed, 28 Jan 2009 02:43:35 +0000 (02:43 +0000)]
Add a preliminary version number.

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

15 years agoABITest: Support --test-layout option for generating
Daniel Dunbar [Wed, 28 Jan 2009 02:01:23 +0000 (02:01 +0000)]
ABITest: Support --test-layout option for generating
size/alignment/offsetof based tests of types instead of calling
convention tests.

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

15 years agoSet visibility of ivar offset symbols according to
Fariborz Jahanian [Wed, 28 Jan 2009 01:36:42 +0000 (01:36 +0000)]
Set visibility of ivar offset symbols according to
accessibility of the ivar (related to objc2's
non-fragile abi).

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

15 years agoGeneration of ivar-offset symbols in objc2's non-fragile abi.
Fariborz Jahanian [Wed, 28 Jan 2009 01:05:23 +0000 (01:05 +0000)]
Generation of ivar-offset symbols in objc2's non-fragile abi.
Changed section names for meta-data (to match current gcc).

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

15 years agoOn Windows use a BumpPtrAllocator for the UniqueFileContainer's StringMap.
Ted Kremenek [Wed, 28 Jan 2009 01:01:07 +0000 (01:01 +0000)]
On Windows use a BumpPtrAllocator for the UniqueFileContainer's StringMap.

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

15 years agoadd test for PR2502, which was already fixed some time ago
Nuno Lopes [Wed, 28 Jan 2009 00:44:33 +0000 (00:44 +0000)]
add test for PR2502, which was already fixed some time ago

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

15 years agoFileManager: Use a BumpPtrAllocator for the StringMaps DirEntries and FileEntries.
Ted Kremenek [Wed, 28 Jan 2009 00:44:12 +0000 (00:44 +0000)]
FileManager: Use a BumpPtrAllocator for the StringMaps DirEntries and FileEntries.

Performance impact (clang -fsyntax-only INPUTS/Cocoa_h.m):
  non-PTH: 0.4% improvement
  PTH: 0.8% improvement

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

15 years agofix PR3427: fix debuginfo for incomplete array types
Nuno Lopes [Wed, 28 Jan 2009 00:35:17 +0000 (00:35 +0000)]
fix PR3427: fix debuginfo for incomplete array types

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

15 years agoAdd a some comments to designate Windows-specific/Unix-specific code. No functionali...
Ted Kremenek [Wed, 28 Jan 2009 00:27:31 +0000 (00:27 +0000)]
Add a some comments to designate Windows-specific/Unix-specific code.  No functionality change.

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

15 years agoFinish making AST BumpPtrAllocation runtime configurable (based on -disable-free).
Steve Naroff [Tue, 27 Jan 2009 23:20:32 +0000 (23:20 +0000)]
Finish making AST BumpPtrAllocation runtime configurable (based on -disable-free).

snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m
0.179u 0.051s 0:00.23 95.6% 0+0k 0+0io 0pf+0w
snaroff% time ../../Release-Asserts/bin/clang INPUTS/Cocoa_h.m -disable-free
0.169u 0.052s 0:00.22 95.4% 0+0k 0+0io 0pf+0w

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

15 years agoAdd handling of member pointers to reinterpret_cast.
Sebastian Redl [Tue, 27 Jan 2009 23:18:31 +0000 (23:18 +0000)]
Add handling of member pointers to reinterpret_cast.

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

15 years agoAfter talking to our runtime guru, I added a comment.
Fariborz Jahanian [Tue, 27 Jan 2009 22:27:56 +0000 (22:27 +0000)]
After talking to our runtime guru, I added a comment.

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

15 years agoUpdated checker build.
Ted Kremenek [Tue, 27 Jan 2009 22:24:33 +0000 (22:24 +0000)]
Updated checker build.

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

15 years agoConvert types over to placement new() that takes an ASTContext.
Steve Naroff [Tue, 27 Jan 2009 22:08:43 +0000 (22:08 +0000)]
Convert types over to placement new() that takes an ASTContext.
Also changed FunctionTypeProto to be allocated with 8-byte alignment (noticed by Doug). I couldn't think of any reason to allocate on 16-byte boundaries. If anyone remembers why we were doing this, let me know!

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

15 years agoRemove many references to ASTContext::getAllocator(), replacing them with calls to...
Steve Naroff [Tue, 27 Jan 2009 21:25:57 +0000 (21:25 +0000)]
Remove many references to ASTContext::getAllocator(), replacing them with calls to the recently added placement new (which uses ASTContext's allocator for memory). Also added ASTContext::Deallocate().

This will simplify runtime replacement of ASTContext's allocator. Keeping the allocator private (and removing getAllocator() entirely) is also goodness.

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

15 years agoccc/Darwin/clang: Fix a mistranslation for the llvm-backend; llvm-gcc
Daniel Dunbar [Tue, 27 Jan 2009 20:42:58 +0000 (20:42 +0000)]
ccc/Darwin/clang: Fix a mistranslation for the llvm-backend; llvm-gcc
doesn't set the relocation model when -mdynamic-no-pic is present.

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

15 years agoIf an input constraint refers to an output constraint, it should have the same constr...
Anders Carlsson [Tue, 27 Jan 2009 20:38:24 +0000 (20:38 +0000)]
If an input constraint refers to an output constraint, it should have the same constraint info as the output constraint. Fixes PR3417

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

15 years agoivar meta-data generation for nonfragile-abi.
Fariborz Jahanian [Tue, 27 Jan 2009 19:38:51 +0000 (19:38 +0000)]
ivar meta-data generation for nonfragile-abi.
Still more work to do in this area.

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

15 years agoccc: Normalize machine name to i386 for platforms which report the
Daniel Dunbar [Tue, 27 Jan 2009 19:29:51 +0000 (19:29 +0000)]
ccc: Normalize machine name to i386 for platforms which report the
machine as x86_64.

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

15 years agoeliminate some random .ll file outputs
Chris Lattner [Tue, 27 Jan 2009 18:56:08 +0000 (18:56 +0000)]
eliminate some random .ll file outputs

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

15 years agoFixed a typo in getPreferredTypeAlign method.
Fariborz Jahanian [Tue, 27 Jan 2009 18:55:00 +0000 (18:55 +0000)]
Fixed a typo in getPreferredTypeAlign method.

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

15 years agoadd new headers
Chris Lattner [Tue, 27 Jan 2009 18:34:53 +0000 (18:34 +0000)]
add new headers

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

15 years agoAdd the new .def files
Chris Lattner [Tue, 27 Jan 2009 18:34:32 +0000 (18:34 +0000)]
Add the new .def files

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

15 years agoSplit the single monolithic DiagnosticKinds.def file into one
Chris Lattner [Tue, 27 Jan 2009 18:30:58 +0000 (18:30 +0000)]
Split the single monolithic DiagnosticKinds.def file into one
.def file for each library.  This means that adding a diagnostic
to sema doesn't require all the other libraries to be rebuilt.

Patch by Anders Johnsen!

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

15 years agoFix bug in BasicStore::getLValueElement where if the base of an array subscript expre...
Ted Kremenek [Tue, 27 Jan 2009 18:29:03 +0000 (18:29 +0000)]
Fix bug in BasicStore::getLValueElement where if the base of an array subscript expression was an ElementRegion we stacked another ElementRegion on top of that.

This fixes PR 3422.

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

15 years agoadd a new "getPreferredTypeAlign" method to return the preferred alignment
Chris Lattner [Tue, 27 Jan 2009 18:08:34 +0000 (18:08 +0000)]
add a new "getPreferredTypeAlign" method to return the preferred alignment
of a type.  The implementation is currently something of a hack, but is
sufficient for now and allows clients to be built on it.

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

15 years agoSupport CodeGen for __extension__ operator on aggregates.
Eli Friedman [Tue, 27 Jan 2009 09:03:41 +0000 (09:03 +0000)]
Support CodeGen for __extension__ operator on aggregates.

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

15 years agoFix for PR3418: make sure to handle the RHS of expressions starting with
Eli Friedman [Tue, 27 Jan 2009 08:43:38 +0000 (08:43 +0000)]
Fix for PR3418: make sure to handle the RHS of expressions starting with
__extension__.  This sort of construct shows up in the gcc source code.

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

15 years agoIntroduce a new PresumedLoc class to represent the concept of a location
Chris Lattner [Tue, 27 Jan 2009 07:57:44 +0000 (07:57 +0000)]
Introduce a new PresumedLoc class to represent the concept of a location
as reported to the user and as manipulated by #line.  This is what __FILE__,
__INCLUDE_LEVEL__, diagnostics and other things should follow (but not
dependency generation!).

This patch also includes several cleanups along the way:

- SourceLocation now has a dump method, and several other places
  that did similar things now use it.
- I cleaned up some code in AnalysisConsumer, but it should probably be
  simplified further now that NamedDecl is better.
- TextDiagnosticPrinter is now simplified and cleaned up a bit.

This patch is a prerequisite for #line, but does not actually provide
any #line functionality.

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

15 years agorename getFullFilePos -> getFileOffset.
Chris Lattner [Tue, 27 Jan 2009 06:27:13 +0000 (06:27 +0000)]
rename getFullFilePos -> getFileOffset.

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

15 years agoUse string comparison rather than '=='.
Ted Kremenek [Tue, 27 Jan 2009 05:34:28 +0000 (05:34 +0000)]
Use string comparison rather than '=='.

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

15 years agoFix a bug that I noticed by inspection.
Chris Lattner [Tue, 27 Jan 2009 05:34:03 +0000 (05:34 +0000)]
Fix a bug that I noticed by inspection.

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

15 years agomake -print-stats print stats about the amount of the SLoc
Chris Lattner [Tue, 27 Jan 2009 05:22:43 +0000 (05:22 +0000)]
make -print-stats print stats about the amount of the SLoc
address space we used up.  Some interesting data:

For c99-intconst-1.c:
6912762 SLocEntry's allocated, 25592386B of Sloc address space used.

For cocoa.h:
26469 SLocEntry's allocated, 10278752B of Sloc address space used.

For carbon.h:
27364 SLocEntry's allocated, 12398141B of Sloc address space used.

Clearly 2G of sloc address space should be enough for anyone?!

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

15 years agoimprovements for GNU objc runtime support, patch by David Chisnall!
Chris Lattner [Tue, 27 Jan 2009 05:06:01 +0000 (05:06 +0000)]
improvements for GNU objc runtime support, patch by David Chisnall!

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

15 years agox86_64: Classify __m64 and __m128 "correctly".
Daniel Dunbar [Tue, 27 Jan 2009 02:01:34 +0000 (02:01 +0000)]
x86_64: Classify __m64 and __m128 "correctly".
 - gcc appears to be classifying <1 x double> as INTEGER which is
   odd. Will investigate later.

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

15 years agoadd SparcV8 asm register info support. Patch by Ben Lickly!
Chris Lattner [Tue, 27 Jan 2009 01:58:38 +0000 (01:58 +0000)]
add SparcV8 asm register info support.  Patch by Ben Lickly!

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

15 years agoPathDiagnostics:
Ted Kremenek [Tue, 27 Jan 2009 01:53:39 +0000 (01:53 +0000)]
PathDiagnostics:
- Add the distinction between the 'bug type' and the 'bug description'

HTMLDiagnostics:
- Output the bug type field as HTML comments

scan-build:
- Use the bug type field instead of the bug description for the HTML table.
- Radar filing now automatically picks up the bug description in the title (addresses <rdar://problem/6265970>)

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

15 years agoImplement support for coercion to wider types during ABI handling.
Daniel Dunbar [Tue, 27 Jan 2009 01:36:03 +0000 (01:36 +0000)]
Implement support for coercion to wider types during ABI handling.
 - Code quality is poor, but simple.

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

15 years agoHave 'Analyzer Failures' files be named to reflect the category of problem.
Ted Kremenek [Tue, 27 Jan 2009 01:19:08 +0000 (01:19 +0000)]
Have 'Analyzer Failures' files be named to reflect the category of problem.

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

15 years agoPTH: Use Token::setLiteralData() to directly store a pointer to cached spelling data...
Ted Kremenek [Tue, 27 Jan 2009 00:01:05 +0000 (00:01 +0000)]
PTH: Use Token::setLiteralData() to directly store a pointer to cached spelling data in the PTH file.  This removes a ton of code for looking up spellings using sourcelocations in the PTH file.  This simplifies both PTH-generation and reading.

Performance impact for -fsyntax-only on Cocoa.h (with Cocoa.h in the PTH file):
- PTH generation time improves by 5%
- PTH reading improves by 0.3%.

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

15 years agoAdded a FIXME.
Fariborz Jahanian [Mon, 26 Jan 2009 23:49:05 +0000 (23:49 +0000)]
Added a FIXME.

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

15 years agoFix definition of __builtin_ia32_vec_set_v2di and de-XFAIL
Daniel Dunbar [Mon, 26 Jan 2009 23:43:02 +0000 (23:43 +0000)]
Fix definition of __builtin_ia32_vec_set_v2di and de-XFAIL
builtins-x86.c.

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

15 years agoPull EmitReturnBlock out of FinishFunction and catch unified return
Daniel Dunbar [Mon, 26 Jan 2009 23:27:52 +0000 (23:27 +0000)]
Pull EmitReturnBlock out of FinishFunction and catch unified return
case correctly.

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

15 years agoBuild method-description-list for category meta-data
Fariborz Jahanian [Mon, 26 Jan 2009 22:58:07 +0000 (22:58 +0000)]
Build method-description-list for category meta-data
as well (for nonfragile-abi).

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

15 years agoSome micro-optimizations for DISABLE_SMART_POINTERS:
Douglas Gregor [Mon, 26 Jan 2009 22:44:13 +0000 (22:44 +0000)]
Some micro-optimizations for DISABLE_SMART_POINTERS:
  - When it's safe, ActionResult uses the low bit of the pointer for
  the "invalid" flag rather than a separate "bool" value. This keeps
  GCC from generating some truly awful code, for a > 3x speedup in the
  result-passing microbenchmark.
  - When DISABLE_SMART_POINTERS is defined, store an ActionResult
  within ASTOwningResult rather than an ASTOwningPtr. Brings the
  performance benefits of the above to smart pointers with
  DISABLE_SMART_POINTERS defined.

Sadly, these micro-benchmark performance improvements don't seem to
make much of a difference on Cocoa.h right now. However, they're
harmless and might help with future optimizations.

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