]> granicus.if.org Git - clang/log
clang
15 years agoMake nonfragile-abi the default for darwin's 64bit
Fariborz Jahanian [Thu, 12 Feb 2009 17:54:33 +0000 (17:54 +0000)]
Make nonfragile-abi the default for darwin's 64bit
abi for objective-c programs.

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

15 years agoSeveral cleanups:
Steve Naroff [Thu, 12 Feb 2009 17:52:19 +0000 (17:52 +0000)]
Several cleanups:
- rename isObjCIdType/isObjCClassType -> isObjCIdStructType/isObjCClassStructType. The previous name didn't do what you would expect.
- add back isObjCIdType/isObjCClassType to do what you would expect. Not currently used, however many of the isObjCIdStructType/isObjCClassStructType clients could be converted over time.
- move static Sema function areComparableObjCInterfaces to ASTContext (renamed to areComparableObjCPointerTypes, since it now operates on pointer types).

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

15 years agoSupport __attribute__(section(<name>))
Daniel Dunbar [Thu, 12 Feb 2009 17:28:23 +0000 (17:28 +0000)]
Support __attribute__(section(<name>))

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

15 years agoTurn warning into error. Minor incompatibility with GCC (for scalar types, GCC only...
Steve Naroff [Thu, 12 Feb 2009 15:54:59 +0000 (15:54 +0000)]
Turn warning into error. Minor incompatibility with GCC (for scalar types, GCC only produces a warning).

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

15 years agoFix va_arg bug noticed by Eli, __builtin_va_arg is not an l-value
Daniel Dunbar [Thu, 12 Feb 2009 09:21:08 +0000 (09:21 +0000)]
Fix va_arg bug noticed by Eli, __builtin_va_arg is not an l-value
designating an object.

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

15 years agox86_64: Initial varargs support.
Daniel Dunbar [Thu, 12 Feb 2009 09:04:14 +0000 (09:04 +0000)]
x86_64: Initial varargs support.
 - Doesn't yet handle case where values are passed in mixed (general
   purpose & floating point) registers; otherwise largely
   functional. Code still needs some cleaning.

Fixes:
MultiSource/Applications/lua/lua
MultiSource/Applications/siod/siod
MultiSource/Applications/sqlite3/sqlite3
SingleSource/Regression/C/PR640
SingleSource/UnitTests/2003-07-09-SignedArgs
SingleSource/UnitTests/2007-03-02-VaCopy

gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes 1262
# of unexpected failures 56
# of unresolved testcases 34
# of unsupported tests 2

Compare to: http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20090209/012050.html

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

15 years agoTest case for emitting va_arg as l-value; apparently I only *thought* I had committed...
Daniel Dunbar [Thu, 12 Feb 2009 08:41:10 +0000 (08:41 +0000)]
Test case for emitting va_arg as l-value; apparently I only *thought* I had committed this.

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

15 years agoUpdate checker build.
Ted Kremenek [Thu, 12 Feb 2009 07:09:27 +0000 (07:09 +0000)]
Update checker build.

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

15 years agoRe-enable PTH stat caching. All tests pass now.
Ted Kremenek [Thu, 12 Feb 2009 03:45:39 +0000 (03:45 +0000)]
Re-enable PTH stat caching.  All tests pass now.

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

15 years agoFix bad reading of bytes in ReadUnalignedLE64() (copy-paste error).
Ted Kremenek [Thu, 12 Feb 2009 03:39:55 +0000 (03:39 +0000)]
Fix bad reading of bytes in ReadUnalignedLE64() (copy-paste error).

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

15 years agoTemporarily disable PTH stat caching as it appears to be failing on some machines.
Ted Kremenek [Thu, 12 Feb 2009 03:36:54 +0000 (03:36 +0000)]
Temporarily disable PTH stat caching as it appears to be failing on some machines.

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

15 years agoPTH: Cache stat information for files in the PTH file. Hook up FileManager
Ted Kremenek [Thu, 12 Feb 2009 03:26:59 +0000 (03:26 +0000)]
PTH: Cache stat information for files in the PTH file.  Hook up FileManager
 to use this stat information in the PTH file using a 'StatSysCallCache' object.

Performance impact (Cocoa.h, PTH):
- number of stat calls reduces from 1230 to 425
- fsyntax-only: time improves by 4.2%

We can reduce the number of stat calls to almost zero by caching negative stat
calls and directory stat calls in the PTH file as well.

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

15 years agoFileManager:
Ted Kremenek [Thu, 12 Feb 2009 03:17:57 +0000 (03:17 +0000)]
FileManager:
- set the 'StatSysCallCache' object using a setter method instead of
  FileManager's constructor. This allows the cache to be installed after the
  FileManager object is created.
- Add 'file mode' to FileEntry (useful for stat caching)

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

15 years agoAdd tags; this is documented to work, just need the wiring to enable it.
Mike Stump [Thu, 12 Feb 2009 02:25:47 +0000 (02:25 +0000)]
Add tags; this is documented to work, just need the wiring to enable it.

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

15 years agofor now, disable all debug info generation at -O1 and above. This mirrors
Chris Lattner [Thu, 12 Feb 2009 01:50:58 +0000 (01:50 +0000)]
for now, disable all debug info generation at -O1 and above.  This mirrors
similar logic in llvm-gcc and will hopefully be fixed soon.

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

15 years agosearch and replaceo?
Chris Lattner [Thu, 12 Feb 2009 01:37:35 +0000 (01:37 +0000)]
search and replaceo?

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

15 years agoAdd test for overloading with _Complex in C
Douglas Gregor [Thu, 12 Feb 2009 00:57:03 +0000 (00:57 +0000)]
Add test for overloading with _Complex in C

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

15 years agoAdd support for generating block call expressions.
Anders Carlsson [Thu, 12 Feb 2009 00:39:25 +0000 (00:39 +0000)]
Add support for generating block call expressions.

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

15 years agoAdd lightweight shim "clang::StatSysCallCache" that caches 'stat' system calls
Ted Kremenek [Thu, 12 Feb 2009 00:39:05 +0000 (00:39 +0000)]
Add lightweight shim "clang::StatSysCallCache" that caches 'stat' system calls
for use by FileManager. FileManager now takes a StatSysCallCache* in its
constructor (which defaults to NULL). This will be used for evaluating whether
or not caching 'stat' system calls in PTH is a performance win. This shim adds
no observable performance impact in the case where the 'StatSysCallCache*' is
null.

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

15 years agoExpand the definition of a complex promotion to include complex ->
Douglas Gregor [Thu, 12 Feb 2009 00:26:06 +0000 (00:26 +0000)]
Expand the definition of a complex promotion to include complex ->
complex conversions where the conversion between the real types is an
integral promotion. This is how G++ handles complex promotions for its
complex integer extension.

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

15 years agoIntroduce _Complex conversions into the function overloading
Douglas Gregor [Thu, 12 Feb 2009 00:15:05 +0000 (00:15 +0000)]
Introduce _Complex conversions into the function overloading
system. Since C99 doesn't have overloading and C++ doesn't have
_Complex, there is no specification for    this. Here's what I think
makes sense.

Complex conversions come in several flavors:

  - Complex promotions:  a complex -> complex   conversion where the
    underlying real-type conversion is a floating-point promotion. GCC
    seems to call this a promotion, EDG does something else. This is
    given "promotion" rank for determining the best viable function.
  - Complex conversions: a complex -> complex conversion that is
    not a complex promotion. This is given "conversion" rank for
    determining the best viable   function.
  - Complex-real conversions: a real -> complex or complex -> real
    conversion. This is given "conversion" rank for determining the
    best viable function.

These rules are the same for C99 (when using the "overloadable"
attribute) and C++. However, there is one difference in the handling
of floating-point promotions: in C99, float -> long double and double
-> long double are considered promotions (so we give them "promotion"
rank), while C++ considers these conversions ("conversion" rank).

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

15 years agoLast @encode'ing fix for objc2's nonfragile abi.
Fariborz Jahanian [Wed, 11 Feb 2009 23:59:18 +0000 (23:59 +0000)]
Last @encode'ing fix for objc2's nonfragile abi.
All relevant dejagnu enocding tests pass in this mode.

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

15 years agoPTH: Have meta data be at the beginning of the PTH file, not the end.
Ted Kremenek [Wed, 11 Feb 2009 23:34:32 +0000 (23:34 +0000)]
PTH: Have meta data be at the beginning of the PTH file, not the end.

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

15 years agoFix comment.
Mike Stump [Wed, 11 Feb 2009 23:03:27 +0000 (23:03 +0000)]
Fix comment.

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

15 years agoInitial implementation of function overloading in C.
Douglas Gregor [Wed, 11 Feb 2009 23:02:49 +0000 (23:02 +0000)]
Initial implementation of function overloading in C.

This commit adds a new attribute, "overloadable", that enables C++
function overloading in C. The attribute can only be added to function
declarations, e.g.,

  int *f(int) __attribute__((overloadable));

If the "overloadable" attribute exists on a function with a given
name, *all* functions with that name (and in that scope) must have the
"overloadable" attribute. Sets of overloaded functions with the
"overloadable" attribute then follow the normal C++ rules for
overloaded functions, e.g., overloads must have different
parameter-type-lists from each other.

When calling an overloaded function in C, we follow the same
overloading rules as C++, with three extensions to the set of standard
conversions:

  - A value of a given struct or union type T can be converted to the
    type T. This is just the identity conversion. (In C++, this would
    go through a copy constructor).
  - A value of pointer type T* can be converted to a value of type U*
    if T and U are compatible types. This conversion has Conversion
    rank (it's considered a pointer conversion in C).
  - A value of type T can be converted to a value of type U if T and U
    are compatible (and are not both pointer types). This conversion
    has Conversion rank (it's considered to be a new kind of
    conversion unique to C, a "compatible" conversion).

Known defects (and, therefore, next steps):
  1) The standard-conversion handling does not understand conversions
  involving _Complex or vector extensions, so it is likely to get
  these wrong. We need to add these conversions.
  2) All overloadable functions with the same name will have the same
  linkage name, which means we'll get a collision in the linker (if
  not sooner). We'll need to mangle the names of these functions.

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

15 years agoPatch to fix encoding in 64bit abi. With this patch
Fariborz Jahanian [Wed, 11 Feb 2009 22:31:45 +0000 (22:31 +0000)]
Patch to fix encoding in 64bit abi. With this patch
all but one dejagnu encoding tests for darwin
pass in nonfragile abi mode.

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

15 years agoUse EmitVAListRef instead of EmitLValue directly to handle array decay
Daniel Dunbar [Wed, 11 Feb 2009 22:25:55 +0000 (22:25 +0000)]
Use EmitVAListRef instead of EmitLValue directly to handle array decay
case on x86_64.

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

15 years agoRemove some non-ascii characters. Thanks Gabor.
Steve Naroff [Wed, 11 Feb 2009 22:01:48 +0000 (22:01 +0000)]
Remove some non-ascii characters. Thanks Gabor.

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

15 years agoPTH: Replace string identifier to persistent ID lookup with a hashtable. This is
Ted Kremenek [Wed, 11 Feb 2009 21:29:16 +0000 (21:29 +0000)]
PTH: Replace string identifier to persistent ID lookup with a hashtable. This is
actually *slightly* slower than the binary search. Since this is algorithmically
better, further performance tuning should be able to make this faster.

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

15 years agoSupport IRgen of va_arg of structure as l-value.
Daniel Dunbar [Wed, 11 Feb 2009 20:59:32 +0000 (20:59 +0000)]
Support IRgen of va_arg of structure as l-value.

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

15 years agoir-gen for objc's @selector expression in nonfragile abi mode.
Fariborz Jahanian [Wed, 11 Feb 2009 20:51:17 +0000 (20:51 +0000)]
ir-gen for objc's @selector expression in nonfragile abi mode.

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

15 years agoAppease the language lawyers
Douglas Gregor [Wed, 11 Feb 2009 20:46:19 +0000 (20:46 +0000)]
Appease the language lawyers

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

15 years agoFix <rdar://problem/6505139> [clang on growl]: need to allow unnamed selectors as...
Steve Naroff [Wed, 11 Feb 2009 20:43:13 +0000 (20:43 +0000)]
Fix <rdar://problem/6505139> [clang on growl]: need to allow unnamed selectors as the first argument

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

15 years agoFix <rdar://problem/6243503> [sema] @throw; accepted outside catch block.
Steve Naroff [Wed, 11 Feb 2009 20:05:44 +0000 (20:05 +0000)]
Fix <rdar://problem/6243503> [sema] @throw; accepted outside catch block.

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

15 years agoFinished semantic analysis of non-type template arguments, to check
Douglas Gregor [Wed, 11 Feb 2009 19:52:55 +0000 (19:52 +0000)]
Finished semantic analysis of non-type template arguments, to check
for non-external names whose address becomes the template
argument. This completes C++ [temp.arg.nontype]p1.

Note that our interpretation of C++ [temp.arg.nontype]p1b3 differs
from EDG's interpretation (we're stricter, and GCC agrees with
us). They're opening a core issue about the matter.

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

15 years agoAvoid bogus warning.
Mike Stump [Wed, 11 Feb 2009 18:58:46 +0000 (18:58 +0000)]
Avoid bogus warning.

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

15 years agoReverted r64307. Moved hasSameType and hasSameUnqualifiedType from
Douglas Gregor [Wed, 11 Feb 2009 18:22:40 +0000 (18:22 +0000)]
Reverted r64307. Moved hasSameType and hasSameUnqualifiedType from
Sema to ASTContext.

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

15 years agoAllow the use of default template arguments when forming a class
Douglas Gregor [Wed, 11 Feb 2009 18:16:40 +0000 (18:16 +0000)]
Allow the use of default template arguments when forming a class
template specialization (e.g., std::vector<int> would now be
well-formed, since it relies on a default argument for the Allocator
template parameter).

This is much less interesting than one might expect, since (1) we're
not actually using the default arguments for anything important, such
as naming an actual Decl, and (2) we'll often need to instantiate the
default arguments to check their well-formedness. The real fun will
come later.

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

15 years agoFix <rdar://problem/6206858> [sema] type check @throw statements.
Steve Naroff [Wed, 11 Feb 2009 17:45:08 +0000 (17:45 +0000)]
Fix <rdar://problem/6206858> [sema] type check @throw statements.

Added a FIXME to handle 'rethrow' check.

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

15 years agoRename Sema::hasSameType to QualType::isSameAs
Douglas Gregor [Wed, 11 Feb 2009 16:47:37 +0000 (16:47 +0000)]
Rename Sema::hasSameType to QualType::isSameAs
Rename Sema::hasSameUnqualifiedType to QualType::isSameIgnoringQalifiers

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

15 years agoSilence a warning about an unused variable in -Asserts builds
Douglas Gregor [Wed, 11 Feb 2009 16:17:49 +0000 (16:17 +0000)]
Silence a warning about an unused variable in -Asserts builds

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

15 years agoImplement semantic checking for template arguments that correspond to
Douglas Gregor [Wed, 11 Feb 2009 16:16:59 +0000 (16:16 +0000)]
Implement semantic checking for template arguments that correspond to
pointer-to-member-data non-type template parameters. Also, get
consistent about what it means to returned a bool from
CheckTemplateArgument.

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

15 years agoPTH: Don't emit the PTH offset of the IdentifierInfo string data as that data is
Ted Kremenek [Wed, 11 Feb 2009 16:06:55 +0000 (16:06 +0000)]
PTH: Don't emit the PTH offset of the IdentifierInfo string data as that data is
referenced by other tables.

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

15 years agoUpdate checker build.
Ted Kremenek [Wed, 11 Feb 2009 07:50:23 +0000 (07:50 +0000)]
Update checker build.

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

15 years agoFix rdar://6518463, increment of a bool is always true, due to
Chris Lattner [Wed, 11 Feb 2009 07:40:06 +0000 (07:40 +0000)]
Fix rdar://6518463, increment of a bool is always true, due to
subtle and non-obvious promotion rules.  We already handle +=
and +1 correctly.

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

15 years agofinish off codegen support for sub of pointer to functions,
Chris Lattner [Wed, 11 Feb 2009 07:21:43 +0000 (07:21 +0000)]
finish off codegen support for sub of pointer to functions,
finishing off rdar://6520707

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

15 years agoPer PR 3187, disable the missing -dealloc check for classes that subclass SenTestCase.
Ted Kremenek [Wed, 11 Feb 2009 07:10:07 +0000 (07:10 +0000)]
Per PR 3187, disable the missing -dealloc check for classes that subclass SenTestCase.

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

15 years agoAdd pmmintrin.h header.
Anders Carlsson [Wed, 11 Feb 2009 06:39:50 +0000 (06:39 +0000)]
Add pmmintrin.h header.

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

15 years agoFix some mistakes I made when I tried to decipher the Intel documentation of the...
Anders Carlsson [Wed, 11 Feb 2009 06:29:32 +0000 (06:29 +0000)]
Fix some mistakes I made when I tried to decipher the Intel documentation of the MXCSR register

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

15 years agotestcase for rdar://6096412 which already works.
Chris Lattner [Wed, 11 Feb 2009 06:22:30 +0000 (06:22 +0000)]
testcase for rdar://6096412 which already works.

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

15 years agoCHAR_BIT == 8
Douglas Gregor [Wed, 11 Feb 2009 04:02:22 +0000 (04:02 +0000)]
CHAR_BIT == 8

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

15 years agoAdd semantic checking for template arguments that correspond to
Douglas Gregor [Wed, 11 Feb 2009 01:18:59 +0000 (01:18 +0000)]
Add semantic checking for template arguments that correspond to
non-type template parameters that are references to functions or
pointers to member functions. Did a little bit of refactoring so that
these two cases, along with the handling of non-type template
parameters that are pointers to functions, are handled by the same
path.

Also, tweaked FixOverloadedFunctionReference to cope with member
function pointers. This is a necessary step for getting all of the fun
member pointer conversions working outside of template arguments, too.

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

15 years agoOne more tweak to account for gluing together llvm and clang into one.
Mike Stump [Wed, 11 Feb 2009 01:11:36 +0000 (01:11 +0000)]
One more tweak to account for gluing together llvm and clang into one.

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

15 years agoMore version experimentation.
Mike Stump [Wed, 11 Feb 2009 01:01:17 +0000 (01:01 +0000)]
More version experimentation.

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

15 years agoSemantic checking for template arguments that correspond to non-type
Douglas Gregor [Wed, 11 Feb 2009 00:44:29 +0000 (00:44 +0000)]
Semantic checking for template arguments that correspond to non-type
template parameters that have reference type. Effectively, we're doing
a very limited form of reference binding here.

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

15 years agoRun a little experiment with version numbers.
Mike Stump [Wed, 11 Feb 2009 00:36:04 +0000 (00:36 +0000)]
Run a little experiment with version numbers.

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

15 years agoAdd partial semantic checking of template arguments that are meant for
Douglas Gregor [Wed, 11 Feb 2009 00:19:33 +0000 (00:19 +0000)]
Add partial semantic checking of template arguments that are meant for
non-type template parameters of pointer-to-object and
pointer-to-function type. The most fun part of this is the use of
overload resolution to pick a function from the set of overloaded
functions that comes in as a template argument.

Also, fixed two minor bugs in this area:
  - We were allowing non-type template parameters of type pointer to
  void.
  - We weren't patching up an expression that refers to an overloaded
  function set via "&f" properly.

We're still not performing complete checking of the expression to be
sure that it is referring to an object or function with external
linkage (C++ [temp.arg.nontype]p1).

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

15 years agoBugReporter: Use llvm::raw_string_stream instead of std::ostringstream.
Ted Kremenek [Tue, 10 Feb 2009 23:56:07 +0000 (23:56 +0000)]
BugReporter: Use llvm::raw_string_stream instead of std::ostringstream.

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

15 years agoAdd private extern to pretty printer(s).
Mike Stump [Tue, 10 Feb 2009 23:49:50 +0000 (23:49 +0000)]
Add private extern to pretty printer(s).

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

15 years agoAdd another test case for the MissingDealloc checker.
Ted Kremenek [Tue, 10 Feb 2009 23:41:52 +0000 (23:41 +0000)]
Add another test case for the MissingDealloc checker.

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

15 years agoAdd type-checking and implicit conversions for template parameters of
Douglas Gregor [Tue, 10 Feb 2009 23:36:10 +0000 (23:36 +0000)]
Add type-checking and implicit conversions for template parameters of
integral or enumeration type.

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

15 years agoHandle the case where EmitBlock might be called multiple times for the same block...
Anders Carlsson [Tue, 10 Feb 2009 22:50:24 +0000 (22:50 +0000)]
Handle the case where EmitBlock might be called multiple times for the same block. Fixes PR3536.

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

15 years agoThis patch is all it takes to pass all objc2's fast-enumeration
Fariborz Jahanian [Tue, 10 Feb 2009 22:46:12 +0000 (22:46 +0000)]
This patch is all it takes to pass all objc2's fast-enumeration
tests in the dejagnu test suite in the nonfragile abi mode.

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

15 years agoPTH generation: Discard tokens that appear after and on the same line as '#endif'.
Ted Kremenek [Tue, 10 Feb 2009 22:43:16 +0000 (22:43 +0000)]
PTH generation: Discard tokens that appear after and on the same line as '#endif'.

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

15 years agoBump PTH version.
Ted Kremenek [Tue, 10 Feb 2009 22:37:57 +0000 (22:37 +0000)]
Bump PTH version.

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

15 years agomake -dM emit macros in a deterministic (sorted) order instead of
Chris Lattner [Tue, 10 Feb 2009 22:28:19 +0000 (22:28 +0000)]
make -dM emit macros in a deterministic (sorted) order instead of
random hash table order, I don't like non-determinstic output.

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

15 years agoPTH generation: Don't call 'EmitToken' in the loop condition. This is preparing...
Ted Kremenek [Tue, 10 Feb 2009 22:27:09 +0000 (22:27 +0000)]
PTH generation: Don't call 'EmitToken' in the loop condition.  This is preparing for other changes within the loop.

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

15 years agoPTH: Replace ad hoc 'file name' -> 'PTH data' lookup table in the PTH file with an...
Ted Kremenek [Tue, 10 Feb 2009 22:16:22 +0000 (22:16 +0000)]
PTH: Replace ad hoc 'file name' -> 'PTH data' lookup table in the PTH file with an on-disk chained hash table.  This data structure is implemented using templates, and will be used to replace similar data structures.  This change leads to no visibile performance impact on Cocoa.h, but now we only pay a price for the table on order with the number of files accessed and not the number in the PTH file.

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

15 years agouse efficient form of getSpelling, this speeds up -dM by 16%.
Chris Lattner [Tue, 10 Feb 2009 22:16:03 +0000 (22:16 +0000)]
use efficient form of getSpelling, this speeds up -dM by 16%.

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

15 years agoGNU allows structs with flexible array members to be placed inside
Douglas Gregor [Tue, 10 Feb 2009 21:49:46 +0000 (21:49 +0000)]
GNU allows structs with flexible array members to be placed inside
arrays and other structs/unions as an extension. Downgrade our error
to a warning. Fixes PR3540.

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

15 years agoPull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
Daniel Dunbar [Tue, 10 Feb 2009 21:44:36 +0000 (21:44 +0000)]
Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
 - Missed this file.

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

15 years agoPull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.
Daniel Dunbar [Tue, 10 Feb 2009 20:44:09 +0000 (20:44 +0000)]
Pull CodeGenFunction::EmitVAArg into target specific ABIInfo classes.

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

15 years agoGenerate ir for ivar offset. This will pass
Fariborz Jahanian [Tue, 10 Feb 2009 20:21:06 +0000 (20:21 +0000)]
Generate ir for ivar offset. This will pass
type-nsobject-attribute.m in the dejagnu test suite
in the nonfragile abi mode.

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

15 years agoFixup -ast-print so that:
Mike Stump [Tue, 10 Feb 2009 20:16:46 +0000 (20:16 +0000)]
Fixup -ast-print so that:

  We handle indentation of decls better.
  We Indent extern "C" { } stuff better.
  We print out structure contents more often.
  We handle pass indentation information into the statement printer, so that
  nested things come out more indented.
  We print out FieldDecls.
  We print out Vars.
  We print out namespaces.
  We indent functions better.

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

15 years agoRefactor FieldDecls to be ValueDecls instead of NamedDecls.
Mike Stump [Tue, 10 Feb 2009 20:06:48 +0000 (20:06 +0000)]
Refactor FieldDecls to be ValueDecls instead of NamedDecls.

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

15 years agoFix a problem with bogus template shadowing warnings
Douglas Gregor [Tue, 10 Feb 2009 19:52:54 +0000 (19:52 +0000)]
Fix a problem with bogus template shadowing warnings

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

15 years agoImplement parsing, semantic analysis and ASTs for default template
Douglas Gregor [Tue, 10 Feb 2009 19:49:53 +0000 (19:49 +0000)]
Implement parsing, semantic analysis and ASTs for default template
arguments. This commit covers checking and merging default template
arguments from previous declarations, but it does not cover the actual
use of default template arguments when naming class template
specializations.

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

15 years agoSome refactoring of Ivar offset code gen.
Fariborz Jahanian [Tue, 10 Feb 2009 19:02:04 +0000 (19:02 +0000)]
Some refactoring of Ivar offset code gen.
in preparation for nonfragile ivar offset work.

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

15 years agoSemantic analysis for non-type template parameter declarations.
Douglas Gregor [Tue, 10 Feb 2009 17:43:50 +0000 (17:43 +0000)]
Semantic analysis for non-type template parameter declarations.

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

15 years agoTweak x86-64 ABI to allow reuse for vararg handling.
Daniel Dunbar [Tue, 10 Feb 2009 17:06:09 +0000 (17:06 +0000)]
Tweak x86-64 ABI to allow reuse for vararg handling.

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

15 years agoUpdated checker build.
Ted Kremenek [Tue, 10 Feb 2009 07:38:50 +0000 (07:38 +0000)]
Updated checker build.

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

15 years agoFix an #ifndef that should be an #ifdef instead.
Anders Carlsson [Tue, 10 Feb 2009 06:18:19 +0000 (06:18 +0000)]
Fix an #ifndef that should be an #ifdef instead.

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

15 years agoRemove the last remnants of the Obj-C EH stack code.
Anders Carlsson [Tue, 10 Feb 2009 06:07:49 +0000 (06:07 +0000)]
Remove the last remnants of the Obj-C EH stack code.

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

15 years agoStart removing the old Obj-C EH stack now that the cleanup stack is used instead.
Anders Carlsson [Tue, 10 Feb 2009 05:52:02 +0000 (05:52 +0000)]
Start removing the old Obj-C EH stack now that the cleanup stack is used instead.

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

15 years agoFix a crash in GRSimpleVals::EvalCast due not handling transparent unions.
Ted Kremenek [Tue, 10 Feb 2009 05:42:58 +0000 (05:42 +0000)]
Fix a crash in GRSimpleVals::EvalCast due not handling transparent unions.

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

15 years agoFunction parameters for PIC16 are like local variables. So use the keyword ".auto...
Sanjiv Gupta [Tue, 10 Feb 2009 04:17:25 +0000 (04:17 +0000)]
Function parameters for PIC16 are like local variables. So use the keyword ".auto." to mangle their names. The working of PIC16AsmPrinter relies on that keyword currently.

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

15 years agoSupport va_arg on _Complex.
Daniel Dunbar [Tue, 10 Feb 2009 03:03:30 +0000 (03:03 +0000)]
Support va_arg on _Complex.

gcc compat test suite results (Darwin x86-32 & -64):
--
# of expected passes 1110
# of unexpected failures 74
# of unresolved testcases 168
# of unsupported tests 2

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

15 years agoBring in 'CHAR_BIT' for GCC 4.3.
Argyrios Kyrtzidis [Tue, 10 Feb 2009 02:14:34 +0000 (02:14 +0000)]
Bring in 'CHAR_BIT' for GCC 4.3.

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

15 years agoEnable parameter passing test for x86_64.
Daniel Dunbar [Tue, 10 Feb 2009 01:53:22 +0000 (01:53 +0000)]
Enable parameter passing test for x86_64.

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

15 years agoABI: Correctly handle load/store of values which have a different LLVM
Daniel Dunbar [Tue, 10 Feb 2009 01:51:39 +0000 (01:51 +0000)]
ABI: Correctly handle load/store of values which have a different LLVM
memory representation (e.g., bool).
 - This upgrades (downgrades) MultiSource/Applications/ClamAV/clamscan
   to a miscompile and fixes
   SingleSource/UnitTests/2003-05-31-CastToBool.

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

15 years agoRearrange code. No functionality change.
Ted Kremenek [Tue, 10 Feb 2009 01:14:45 +0000 (01:14 +0000)]
Rearrange code. No functionality change.

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

15 years agoFix potential padding error in PTH file and add stub code for emitting an on-disk...
Ted Kremenek [Tue, 10 Feb 2009 01:06:17 +0000 (01:06 +0000)]
Fix potential padding error in PTH file and add stub code for emitting an on-disk chained hash table.

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

15 years agoAdd util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversion
Daniel Dunbar [Tue, 10 Feb 2009 00:57:50 +0000 (00:57 +0000)]
Add util Emit{LoadOf,StoreTo}Scalar methods to encapsulate conversion
from LLVM memory type to/from LLVM temporary type.
 - No intended functionality change.

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

15 years agoUpdate checker build.
Ted Kremenek [Tue, 10 Feb 2009 00:53:39 +0000 (00:53 +0000)]
Update checker build.

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

15 years agoTeach the type-id/expression disambiguator about different
Douglas Gregor [Tue, 10 Feb 2009 00:53:15 +0000 (00:53 +0000)]
Teach the type-id/expression disambiguator about different
disambiguation contexts, so that we properly parse template arguments
such as

  A<int()>

as type-ids rather than as expressions. Since this can be confusing
(especially when the template parameter is a non-type template
parameter), we try to give a friendly error message.

Almost, eliminate a redundant error message (that should have been a
note) and add some ultra-basic checks for non-type template
arguments.

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

15 years agoCheck template template arguments against their corresponding template
Douglas Gregor [Tue, 10 Feb 2009 00:24:35 +0000 (00:24 +0000)]
Check template template arguments against their corresponding template
template parameters.

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

15 years agoMake sure to initialize local variables, even if they were ignored by
Daniel Dunbar [Tue, 10 Feb 2009 00:06:49 +0000 (00:06 +0000)]
Make sure to initialize local variables, even if they were ignored by
ABI.

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

15 years agoRudimentary checking of template arguments against their corresponding
Douglas Gregor [Mon, 9 Feb 2009 23:23:08 +0000 (23:23 +0000)]
Rudimentary checking of template arguments against their corresponding
template parameters when performing semantic analysis of a template-id
naming a class template specialization.

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

15 years agoid<Foo> is a POD type.
Anders Carlsson [Mon, 9 Feb 2009 21:53:01 +0000 (21:53 +0000)]
id<Foo> is a POD type.

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

15 years agoMove previously unsupported VLA test to vla.c
Anders Carlsson [Mon, 9 Feb 2009 21:48:07 +0000 (21:48 +0000)]
Move previously unsupported VLA test to vla.c

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