]> granicus.if.org Git - clang/log
clang
14 years agoAnd finally, revert the accidental check-in part of the previous reversion. I'm on...
Sebastian Redl [Fri, 7 May 2010 09:11:09 +0000 (09:11 +0000)]
And finally, revert the accidental check-in part of the previous reversion. I'm on a roll.

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

14 years agoRevert 103247, it causes lots of test failures.
Sebastian Redl [Fri, 7 May 2010 09:09:23 +0000 (09:09 +0000)]
Revert 103247, it causes lots of test failures.

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

14 years agoPass the correct type to BuildMemberReferenceExpr. Fixes bug 6466.
Sebastian Redl [Fri, 7 May 2010 09:06:26 +0000 (09:06 +0000)]
Pass the correct type to BuildMemberReferenceExpr. Fixes bug 6466.

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

14 years agoreimplement the guts of SourceManager::isBeforeInTranslationUnit
Chris Lattner [Fri, 7 May 2010 05:51:13 +0000 (05:51 +0000)]
reimplement the guts of SourceManager::isBeforeInTranslationUnit
to be algorithmically faster and avoid an std::map.  This routine
basically boils down to finding the nearest common ancestor in a
tree, and we (implicitly) have information about nesting depth,
use it!

This wraps up rdar://7948633 - SourceManager::isBeforeInTranslationUnit has poor performance

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

14 years agoChange Evaluate* in the constant evaluator to enforce being given an argument of
John McCall [Fri, 7 May 2010 05:46:35 +0000 (05:46 +0000)]
Change Evaluate* in the constant evaluator to enforce being given an argument of
the right type.  It turns out that the code was already doing this.

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

14 years agoMove CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
John McCall [Fri, 7 May 2010 05:32:02 +0000 (05:32 +0000)]
Move CheckICE and isIntegerConstantExpr to ExprConstant.cpp because it seemed
like a good idea at the time.

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

14 years agostart using the caching now that it appears to work!
Chris Lattner [Fri, 7 May 2010 05:10:46 +0000 (05:10 +0000)]
start using the caching now that it appears to work!

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

14 years agoreimplement the caching in the SourceManager::isBeforeInTranslationUnit()
Chris Lattner [Fri, 7 May 2010 01:17:07 +0000 (01:17 +0000)]
reimplement the caching in the SourceManager::isBeforeInTranslationUnit()
method to be correct.  Right now it correctly computes the cache, then
goes ahead and computes the result the hard way, then asserts that they
match.  Next I'll actually turn it on.

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

14 years agoAdd initial USR support for mangling in the types of C++ functions and methods.
Ted Kremenek [Fri, 7 May 2010 01:04:32 +0000 (01:04 +0000)]
Add initial USR support for mangling in the types of C++ functions and methods.

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

14 years agoAdd CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').
Ted Kremenek [Fri, 7 May 2010 01:04:29 +0000 (01:04 +0000)]
Add CXCursor support for LinkageSpecDecl (e.g., 'extern "C"').

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

14 years agoAdd USR test case for C++ operator methods.
Ted Kremenek [Fri, 7 May 2010 01:04:23 +0000 (01:04 +0000)]
Add USR test case for C++ operator methods.

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

14 years agoReverted r103214.
mike-m [Fri, 7 May 2010 00:42:33 +0000 (00:42 +0000)]
Reverted r103214.

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

14 years agoImplement encoding of methods which have instantiated
Fariborz Jahanian [Fri, 7 May 2010 00:28:49 +0000 (00:28 +0000)]
Implement encoding of methods which have instantiated
template arguments.

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

14 years agoWhen determining whether the two types involved in reference binding
Douglas Gregor [Fri, 7 May 2010 00:28:31 +0000 (00:28 +0000)]
When determining whether the two types involved in reference binding
are reference-compatible, reference-related, etc., do not complete the
type of the reference itself because it is not necessary to determine
well-formedness of the program. Complete the type that we are binding
to, since that can affect whether we know about a derived-to-base
conversion.

Fixes PR7080.

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

14 years agoAfter some discussion, conservatively extend our sentinel check to discard
John McCall [Thu, 6 May 2010 23:53:00 +0000 (23:53 +0000)]
After some discussion, conservatively extend our sentinel check to discard
casts, but still require the (casted) type to be a pointer.  Fixes PR5685.

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

14 years ago2nd part of: Overhauled llvm/clang docs builds.
mike-m [Thu, 6 May 2010 23:46:27 +0000 (23:46 +0000)]
2nd part of: Overhauled llvm/clang docs builds.

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

14 years agoAdd USR support for C++ namespaces, and unify mangling of location information in...
Ted Kremenek [Thu, 6 May 2010 23:38:28 +0000 (23:38 +0000)]
Add USR support for C++ namespaces, and unify mangling of location information in USRs
for anonymous symbols.

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

14 years agoAdd CXCursor support for C++ namespaces.
Ted Kremenek [Thu, 6 May 2010 23:38:21 +0000 (23:38 +0000)]
Add CXCursor support for C++ namespaces.

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

14 years agoIt turns out that we should be allowing redeclarations within function
Douglas Gregor [Thu, 6 May 2010 23:31:27 +0000 (23:31 +0000)]
It turns out that we should be allowing redeclarations within function
scope. Thanks to Steven Watanabe for correcting me.

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

14 years agoDo not give implicitly-defined virtual members functions
Douglas Gregor [Thu, 6 May 2010 23:13:35 +0000 (23:13 +0000)]
Do not give implicitly-defined virtual members functions
available_externally linkage, since they may not have been given a
strong definition in another translation unit. Without this patch, the
following test case fails to link with a GCC-compiled libstdc++:

  #include <sstream>
  int main() { std::basic_stringbuf<char> bs; }

Fixes the last problem with the Boost.IO library.

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

14 years agoFix typo in comment; 80 col violation
Douglas Gregor [Thu, 6 May 2010 22:33:50 +0000 (22:33 +0000)]
Fix typo in comment; 80 col violation

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

14 years agoThe global variable for the VTT might not have external linkage; allow
Douglas Gregor [Thu, 6 May 2010 22:18:21 +0000 (22:18 +0000)]
The global variable for the VTT might not have external linkage; allow
us to find local variables, too. Fixes the last remaining
Boost.Rational failure.

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

14 years agomention that cmake works on unix too. PR7061
Chris Lattner [Thu, 6 May 2010 21:57:57 +0000 (21:57 +0000)]
mention that cmake works on unix too.  PR7061

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

14 years agoignore *.orig when installing, patch by Brooks Davis!
Chris Lattner [Thu, 6 May 2010 21:49:51 +0000 (21:49 +0000)]
ignore *.orig when installing, patch by Brooks Davis!

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

14 years agoFixed DISABLE_SMART_POINTERS breakage
Douglas Gregor [Thu, 6 May 2010 21:39:56 +0000 (21:39 +0000)]
Fixed DISABLE_SMART_POINTERS breakage

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

14 years agoHandle -ffunction-sections and -fdata-sections in the driver.
Rafael Espindola [Thu, 6 May 2010 21:06:04 +0000 (21:06 +0000)]
Handle -ffunction-sections and -fdata-sections in the driver.

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

14 years agoBasic: Update getClangRepositoryPath for my change to integration branch layout.
Daniel Dunbar [Thu, 6 May 2010 18:39:38 +0000 (18:39 +0000)]
Basic: Update getClangRepositoryPath for my change to integration branch layout.

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

14 years agoDiagnose deprecated/unavailable functions selected by overload resolution.
John McCall [Thu, 6 May 2010 18:15:07 +0000 (18:15 +0000)]
Diagnose deprecated/unavailable functions selected by overload resolution.
Fixes rdar://problem/4232969, or at least the clang parts of it.

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

14 years agoTry to work around a Visual C++ bug with copy-assignment.
Douglas Gregor [Thu, 6 May 2010 18:05:52 +0000 (18:05 +0000)]
Try to work around a Visual C++ bug with copy-assignment.

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

14 years agoRework our handling of temporary objects within the conditions of
Douglas Gregor [Thu, 6 May 2010 17:25:47 +0000 (17:25 +0000)]
Rework our handling of temporary objects within the conditions of
if/switch/while/do/for statements. Previously, we would end up either:

  (1) Forgetting to destroy temporaries created in the condition (!),
  (2) Destroying the temporaries created in the condition *before*
  converting the condition to a boolean value (or, in the case of a
  switch statement, to an integral or enumeral value), or
  (3) In a for statement, destroying the condition's temporaries at
  the end of the increment expression (!).

We now destroy temporaries in conditions at the right times. This
required some tweaking of the Parse/Sema interaction, since the parser
was building full expressions too early in many places.

Fixes PR7067.

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

14 years agoCode Gen support for Getter/Setter synthesis of
Fariborz Jahanian [Thu, 6 May 2010 15:45:36 +0000 (15:45 +0000)]
Code Gen support for Getter/Setter synthesis of
C++ object properties. (still radar 7468090).

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

14 years agoReverted part of r103177 (repositioning of clang-builtin include/)
mike-m [Thu, 6 May 2010 15:23:52 +0000 (15:23 +0000)]
Reverted part of r103177 (repositioning of clang-builtin include/)
which breaks clang-i686-xp-msvc9 test-clang.

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

14 years agoReposition clang-builtin include/ to immediately precede /usr/include/,
mike-m [Thu, 6 May 2010 14:11:13 +0000 (14:11 +0000)]
Reposition clang-builtin include/ to immediately precede /usr/include/,
matching gcc compiler. Fixes #include_next <...> shenanigans that lead to
file-not-found failures with <cstddef> on libstdc++ 4.3.[012].

Updated C++ include header search paths for various Debian/Ubuntu and Fedora
linux distros.

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

14 years agoPush TypeSourceInfo::getTypeLoc() into a header file so that it's
John McCall [Thu, 6 May 2010 09:25:57 +0000 (09:25 +0000)]
Push TypeSourceInfo::getTypeLoc() into a header file so that it's
inlineable.  That header file has to be TypeLoc.h, which means that
TypeLoc.h needs to depend on Decl.h because TypeSourceInfo doesn't
have its own header.  That could be remedied, though.

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

14 years agoKill a never-defined, never-used member function. Thanks, Enea.
John McCall [Thu, 6 May 2010 09:09:08 +0000 (09:09 +0000)]
Kill a never-defined, never-used member function.  Thanks, Enea.

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

14 years agoRearchitect -Wconversion and -Wsign-compare. Instead of computing them
John McCall [Thu, 6 May 2010 08:58:33 +0000 (08:58 +0000)]
Rearchitect -Wconversion and -Wsign-compare.  Instead of computing them
"bottom-up" when implicit casts and comparisons are inserted, compute them
"top-down" when the full expression is finished.  Makes it easier to
coordinate warnings and thus implement -Wconversion for signedness
conversions without double-warning with -Wsign-compare.  Also makes it possible
to realize that a signedness conversion is okay because the context is
performing the inverse conversion.  Also simplifies some logic that was
trying to calculate the ultimate comparison/result type and getting it wrong.
Also fixes a problem with the C++ explicit casts which are often "implemented"
in the AST with a series of implicit cast expressions.

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

14 years agoRemember the number of positive and negative bits used by the enumerators of
John McCall [Thu, 6 May 2010 08:49:23 +0000 (08:49 +0000)]
Remember the number of positive and negative bits used by the enumerators of
an enum in the enum decl itself.  Use some spare bits from TagDecl for this
purpose.

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

14 years agosimplify EmitAggMemberInitializer a bit and make it work in 32-bit mode,
Chris Lattner [Thu, 6 May 2010 06:35:23 +0000 (06:35 +0000)]
simplify EmitAggMemberInitializer a bit and make it work in 32-bit mode,
fixing PR7063.

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

14 years agoadd todos for isinf_sign and isnormal, which I don't intend to implement
Chris Lattner [Thu, 6 May 2010 06:13:53 +0000 (06:13 +0000)]
add todos for isinf_sign and isnormal, which I don't intend to implement
in the near future.

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

14 years agoimplement codegen support for __builtin_isfinite, part of PR6083
Chris Lattner [Thu, 6 May 2010 06:04:13 +0000 (06:04 +0000)]
implement codegen support for __builtin_isfinite, part of PR6083

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

14 years agooptimize builtin_isnan/isinf to not do an extraneous extension from
Chris Lattner [Thu, 6 May 2010 05:50:07 +0000 (05:50 +0000)]
optimize builtin_isnan/isinf to not do an extraneous extension from
float -> double (which happens because they are modelled as int(...)
functions), and add a testcase for isinf.

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

14 years agoimplement part of PR6083: codegen support for isinf. Like isnan,
Chris Lattner [Thu, 6 May 2010 05:35:16 +0000 (05:35 +0000)]
implement part of PR6083: codegen support for isinf.  Like isnan,
this is generating correct but suboptimal (extra extend to double)
code for the float case.  Will investigate next.

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

14 years agoMark a variable as used in the absence of asserts to silence a GCC warning.
Chandler Carruth [Thu, 6 May 2010 05:28:42 +0000 (05:28 +0000)]
Mark a variable as used in the absence of asserts to silence a GCC warning.

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

14 years agoRemove a dependency on Frontend headers in the Driver library. Also saves
Chandler Carruth [Thu, 6 May 2010 04:55:18 +0000 (04:55 +0000)]
Remove a dependency on Frontend headers in the Driver library. Also saves
building and passing arguments to cc1 layer when setting values to their
defaults.

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

14 years agoTurn -analyzer-inline-call on for C functions. This also fixed a bug that
Zhongxing Xu [Thu, 6 May 2010 03:38:27 +0000 (03:38 +0000)]
Turn -analyzer-inline-call on for C functions. This also fixed a bug that
after inlining post-call checking shouldn't be done.

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

14 years agoMake -analyzer-inline-call not a separate analysis. Instead it's a boolean
Zhongxing Xu [Thu, 6 May 2010 02:59:29 +0000 (02:59 +0000)]
Make -analyzer-inline-call not a separate analysis. Instead it's a boolean
flag now, and can be used with other analyses. Only turned it on for C++
methods for now.

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

14 years agoPartial and full specializations of a class template may have a
Douglas Gregor [Thu, 6 May 2010 00:28:52 +0000 (00:28 +0000)]
Partial and full specializations of a class template may have a
different tag kind ("struct" vs. "class") than the primary template,
which has an affect on access control.

Should fix the last remaining Boost.Accumulors failure.

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

14 years agoWorkaround a really serious caching bug in SourceManager::isBeforeInTranslationUnit...
Ted Kremenek [Thu, 6 May 2010 00:22:25 +0000 (00:22 +0000)]
Workaround a really serious caching bug in SourceManager::isBeforeInTranslationUnit() where the
method will sometimes return different results for the same input SourceLocations.  I haven't
unraveled this method completely yet, so this truly is a workaround until a better fix comes
along.

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

14 years agoClean up the {} and else placement. This fixes an ambiguous else as well as
Chandler Carruth [Thu, 6 May 2010 00:20:39 +0000 (00:20 +0000)]
Clean up the {} and else placement. This fixes an ambiguous else as well as
picking a more consistent pattern.

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

14 years agoSilence a pedantic GCC warning by making the grouping of && and || explicit.
Chandler Carruth [Thu, 6 May 2010 00:15:06 +0000 (00:15 +0000)]
Silence a pedantic GCC warning by making the grouping of && and || explicit.

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

14 years agoAdd IgnoreParenImpCasts() to Expr, which is basically like IgnoreParenCasts
John McCall [Wed, 5 May 2010 22:59:52 +0000 (22:59 +0000)]
Add IgnoreParenImpCasts() to Expr, which is basically like IgnoreParenCasts
except it only skips implicit casts.

Also fix ObjCImplicitGetterSetterRefExpr's child_begin to skip the base expression
if it's actually a type reference (which you get with static property references).

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

14 years agoPass the globaldecl into GetOrCreateLLVMFunction so that llvm
Chris Lattner [Wed, 5 May 2010 22:55:13 +0000 (22:55 +0000)]
Pass the globaldecl into GetOrCreateLLVMFunction so that llvm
function attributes like byval get applied to the function
definition. This fixes PR7058 and makes i386 llvm/clang bootstrap
pass all the same tests as x86-64 bootstrap for me (the llvmc
tests still fail in both).

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

14 years agoWhen implicit definition of the copy-assignment operator fails,
Douglas Gregor [Wed, 5 May 2010 22:38:15 +0000 (22:38 +0000)]
When implicit definition of the copy-assignment operator fails,
provide a note that shows where the copy-assignment operator was
needed. We used to have this, but I broke it during refactoring.

Finishes PR6999.

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

14 years agoThis patch deals with Sema Part of Setter/Getter synthesis
Fariborz Jahanian [Wed, 5 May 2010 21:52:17 +0000 (21:52 +0000)]
This patch deals with Sema Part of Setter/Getter synthesis
of properties which are of C++ objects. Code Gen to follow
(Radar 7468090).

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

14 years agoWhen we emit a non-constant initializer for a global variable of
Douglas Gregor [Wed, 5 May 2010 20:15:55 +0000 (20:15 +0000)]
When we emit a non-constant initializer for a global variable of
reference type, make sure that the initializer we build is the
of the appropriate type for the *reference*, not for the thing that it
refers to. Fixes PR7050.

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

14 years agoTest commit.
mike-m [Wed, 5 May 2010 17:00:31 +0000 (17:00 +0000)]
Test commit.

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

14 years agoFor thread-safe static initialization of local statics with
Douglas Gregor [Wed, 5 May 2010 15:38:32 +0000 (15:38 +0000)]
For thread-safe static initialization of local statics with
destructors, place the __cxa_atexit call after the __cxa_guard_release
call, mimicking GCC/LLVM-GCC behavior. Noticed while debugging
something related.

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

14 years agoReapplying patch to change StmtNodes.def to StmtNodes.td, this time
Sean Hunt [Wed, 5 May 2010 15:24:00 +0000 (15:24 +0000)]
Reapplying patch to change StmtNodes.def to StmtNodes.td, this time
with no whitespace. This will allow statements to be referred to in
attribute TableGen files.

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

14 years agoRevert r103072; I accidentally ended up deleting a bunch of trailing
Sean Hunt [Wed, 5 May 2010 15:23:54 +0000 (15:23 +0000)]
Revert r103072; I accidentally ended up deleting a bunch of trailing
whitespace which makes this patch unreadable. Will recommit without the
whitespace.

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

14 years ago Support for 'template' as a disambiguator (PR7030)
Douglas Gregor [Wed, 5 May 2010 05:58:24 +0000 (05:58 +0000)]
Support for 'template' as a disambiguator (PR7030)

    ParseOptionalCXXScopeSpecifier() only annotates the subset of
    template-ids which are not subject to lexical ambiguity. Add support
    for the more general case in ParseUnqualifiedId() to handle cases
    such as A::template B().

    Also improve some diagnostic locations.

Fixes PR7030, from Alp Toker!

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

14 years agoadd a new --print-diagnostic-categories option, which causes the driver to
Chris Lattner [Wed, 5 May 2010 05:53:24 +0000 (05:53 +0000)]
add a new --print-diagnostic-categories option, which causes the driver to
print out all of the category numbers with their description.  This is useful
for clients that want to map the numbers produced by
--fdiagnostics-show-category=id to their human readable string form.  The
output is simple but utilitarian:

$ clang --print-diagnostic-categories
1,Format String
2,Something Else

This implements rdar://7928193

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

14 years agoReimplement code generation for copying fields in the
Douglas Gregor [Wed, 5 May 2010 05:51:00 +0000 (05:51 +0000)]
Reimplement code generation for copying fields in the
implicitly-generated copy constructor. Previously, Sema would perform
some checking and instantiation to determine which copy constructors,
etc., would be called, then CodeGen would attempt to figure out which
copy constructor to call... but would get it wrong, or poke at an
uninstantiated default argument, or fail in other ways.

The new scheme is similar to what we now do for the implicit
copy-assignment operator, where Sema performs all of the semantic
analysis and builds specific ASTs that look similar to the ASTs we'd
get from explicitly writing the copy constructor, so that CodeGen need
only do a direct translation.

However, it's not quite that simple because one cannot explicit write
elementwise copy-construction of an array. So, I've extended
CXXBaseOrMemberInitializer to contain a list of indexing variables
used to copy-construct the elements. For example, if we have:

  struct A { A(const A&); };

  struct B {
    A array[2][3];
  };

then we generate an implicit copy assignment operator for B that looks
something like this:

  B::B(const B &other) : array[i0][i1](other.array[i0][i1]) { }

CodeGen will loop over the invented variables i0 and i1 to visit all
elements in the array, so that each element in the destination array
will be copy-constructed from the corresponding element in the source
array. Of course, if we're dealing with arrays of scalars or class
types with trivial copy-assignment operators, we just generate a
memcpy rather than a loop.

Fixes PR6928, PR5989, and PR6887. Boost.Regex now compiles and passes
all of its regression tests.

Conspicuously missing from this patch is handling for the exceptional
case, where we need to destruct those objects that we have
constructed. I'll address that case separately.

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

14 years agoUse a more appropriate LLVM type for the vtable pointer.
Anders Carlsson [Wed, 5 May 2010 05:47:36 +0000 (05:47 +0000)]
Use a more appropriate LLVM type for the vtable pointer.

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

14 years agoUnbreak CMake build.
Douglas Gregor [Wed, 5 May 2010 05:41:05 +0000 (05:41 +0000)]
Unbreak CMake build.

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

14 years agofit in 80 cols
Chris Lattner [Wed, 5 May 2010 05:28:39 +0000 (05:28 +0000)]
fit in 80 cols

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

14 years agoAdd forgotten CMakeFiles.txt
Sean Hunt [Wed, 5 May 2010 04:50:38 +0000 (04:50 +0000)]
Add forgotten CMakeFiles.txt

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

14 years agoChange StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributes
Sean Hunt [Wed, 5 May 2010 04:13:52 +0000 (04:13 +0000)]
Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributes

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

14 years agodocument -fdiagnostics-show-category
Chris Lattner [Wed, 5 May 2010 01:35:28 +0000 (01:35 +0000)]
document -fdiagnostics-show-category

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

14 years agoRework clang_annotateTokens() to annotate tokens with information that more closely...
Ted Kremenek [Wed, 5 May 2010 00:55:23 +0000 (00:55 +0000)]
Rework clang_annotateTokens() to annotate tokens with information that more closely matches
clang_getCursor().  Tokens are now annotated with the cursor (for the matching AST element)
that most closely encompasses that token.

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

14 years agoMap Objective-C keywords to CXToken_Keyword.
Ted Kremenek [Wed, 5 May 2010 00:55:20 +0000 (00:55 +0000)]
Map Objective-C keywords to CXToken_Keyword.

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

14 years agoMove post-processing of token annotations to method in AnnotateTokensWorker.
Ted Kremenek [Wed, 5 May 2010 00:55:17 +0000 (00:55 +0000)]
Move post-processing of token annotations to method in AnnotateTokensWorker.

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

14 years agoRefactor visitor logic for clang_annotateTokens() into a worker class. No functional...
Ted Kremenek [Wed, 5 May 2010 00:55:15 +0000 (00:55 +0000)]
Refactor visitor logic for clang_annotateTokens() into a worker class.  No functionality change yet.

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

14 years agoadd a new -fdiagnostics-show-category=none/id/name option, giving control
Chris Lattner [Tue, 4 May 2010 21:55:25 +0000 (21:55 +0000)]
add a new -fdiagnostics-show-category=none/id/name option, giving control
over choice of:

t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,Format String]

dox to come.

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

14 years agoWhen -fdiagnostics-print-source-range-info is specified,
Chris Lattner [Tue, 4 May 2010 21:13:21 +0000 (21:13 +0000)]
When -fdiagnostics-print-source-range-info is specified,
print the diagnostic category number in the [] at the end
of the line.  For example:

$ cat t.c
#include <stdio.h>
void foo() {
 printf("%s", 4);
}
$  clang t.c -fsyntax-only -fdiagnostics-print-source-range-info
t.c:3:11:{3:10-3:12}{3:15-3:16}: warning: conversion specifies type 'char *' but the argument has type 'int' [-Wformat,1]
  printf("%s", 4);
          ~^   ~
1 warning generated.

Clients that want category information can now pick the number
out of the output, rdar://7928231.

More coming.

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

14 years agoEmit the globals, metadata, etc. associated with static variables even when
John McCall [Tue, 4 May 2010 20:45:42 +0000 (20:45 +0000)]
Emit the globals, metadata, etc. associated with static variables even when
they're unreachable.  This matters because (if they're POD, or if this is C)
the scope containing the variable might be reachable even if the variable
isn't.  Fixes PR7044.

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

14 years agoadd the ability to associate 'category' names with diagnostics
Chris Lattner [Tue, 4 May 2010 20:44:26 +0000 (20:44 +0000)]
add the ability to associate 'category' names with diagnostics
and diagnostic groups.  This allows the compiler to group
diagnostics together (e.g. "Logic Warning",
"Format String Warning", etc) like the static analyzer does.
This is not exposed through anything in the compiler yet.

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

14 years agoFixes a code gen. crash when ivar object has trivial constructor.
Fariborz Jahanian [Tue, 4 May 2010 19:29:32 +0000 (19:29 +0000)]
Fixes a code gen. crash when ivar object has trivial constructor.

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

14 years agoWhen instantiating a function that was declared via a typedef, e.g.,
Douglas Gregor [Tue, 4 May 2010 18:18:31 +0000 (18:18 +0000)]
When instantiating a function that was declared via a typedef, e.g.,

    typedef int functype(int, int);
    functype func;

also instantiate the synthesized function parameters for the resulting
function declaration.

With this change, Boost.Wave builds and passes all of its regression
tests.

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

14 years agoFixes a code gen crash when block is a reference type, etc.
Fariborz Jahanian [Tue, 4 May 2010 17:59:32 +0000 (17:59 +0000)]
Fixes a code gen crash when block is a reference type, etc.
(radar 7495203).

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

14 years agoIntroduce a limit on the depth of the macro instantiation backtrace
Douglas Gregor [Tue, 4 May 2010 17:13:42 +0000 (17:13 +0000)]
Introduce a limit on the depth of the macro instantiation backtrace
printed in a diagnostic, similar to the limit we already have on the
depth of the template instantiation backtrace. The macro instantiation
backtrace is limited to 10 "instantiated from:" diagnostics; when it's
longer than that, we'll show the first half, then say how many were
suppressed, then show the second half. The limit can be changed with
-fmacro-instantiation-limit=N, and turned off with N=0.

This eliminates a lot of note spew with libraries making use of the
Boost.Preprocess library.

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

14 years agoWhen creating a call to a base subobject's operator= in an
Douglas Gregor [Tue, 4 May 2010 15:20:55 +0000 (15:20 +0000)]
When creating a call to a base subobject's operator= in an
implicitly-defined copy assignment operator, suppress the protected
access check. This eliminates the remaining failure in the
Boost.SmartPtr library (that was a product of the copy-assignment
generation rewrite) and, presumably, the Boost.TR1 library as well.

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

14 years agoLet StmtDumper.cpp handle using declarations.
Sebastian Redl [Tue, 4 May 2010 10:20:17 +0000 (10:20 +0000)]
Let StmtDumper.cpp handle using declarations.

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

14 years agoAn access is permitted if the current template instantiates to the appropriate
John McCall [Tue, 4 May 2010 05:11:27 +0000 (05:11 +0000)]
An access is permitted if the current template instantiates to the appropriate
class.  Add some conservative support for the idea.  Fixes PR 7024.

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

14 years agoWhen inheriting a default argument expression, inherit the full expression,
John McCall [Tue, 4 May 2010 01:53:42 +0000 (01:53 +0000)]
When inheriting a default argument expression, inherit the full expression,
not just the inner expression.  This is important if the expression has any
temporaries.  Fixes PR 7028.

Basically a symptom of really tragic method names.

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

14 years agoFixes a Code Gen. Crash when calling destructor on a __block
Fariborz Jahanian [Tue, 4 May 2010 00:26:07 +0000 (00:26 +0000)]
Fixes a Code Gen. Crash when calling destructor on a __block
variabe. Blocks and their construction/destruction is
wip though.

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

14 years agoWhen computing the template arguments for the instantiation of a
Douglas Gregor [Mon, 3 May 2010 23:29:10 +0000 (23:29 +0000)]
When computing the template arguments for the instantiation of a
friend function template, be sure to adjust the computed template
argument lists based on the location of the definition of the function
template: it's possible that the definition we're instantiating with
and the template declaration that we found when creating the
specialization are in different contexts, which meant that we would
end up using the wrong template arguments for instantiation.

Fixes PR7013; all Boost.DynamicBitset tests now pass.

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

14 years agoJust bail out immediately when emitting an unreachable function-local static
John McCall [Mon, 3 May 2010 21:39:56 +0000 (21:39 +0000)]
Just bail out immediately when emitting an unreachable function-local static
variable.  Surprisingly, this does seem to be the right way to solve this.

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

14 years agoTest for my last patch.
Fariborz Jahanian [Mon, 3 May 2010 21:06:59 +0000 (21:06 +0000)]
Test for my last patch.

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

14 years agoFor the sake of Objective-c++ overload resolution,
Fariborz Jahanian [Mon, 3 May 2010 21:06:18 +0000 (21:06 +0000)]
For the sake of Objective-c++ overload resolution,
treat argument types of objective-c pointer types
which only differ in their protocol qualifiers as
the same type (radar 7925668).

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

14 years agoWhen instantiating a function-local variable definition, introduce the
Douglas Gregor [Mon, 3 May 2010 20:22:41 +0000 (20:22 +0000)]
When instantiating a function-local variable definition, introduce the
mapping from the declaration in the template to the instantiated
declaration before transforming the initializer, in case some crazy
lunatic decides to use a variable in its own initializer. Fixes PR7016.

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

14 years agoWorkaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since they don...
Ted Kremenek [Mon, 3 May 2010 20:16:35 +0000 (20:16 +0000)]
Workaround: Don't add ObjCMethodDecls to the vector of TopLevelDecls since they don't go in
the DeclContext for the translation unit.  This is to workaround a fundamental issue in how
ObjC decls (within an @implementation) are parsed before the ObjCContainerDecl is available.

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

14 years agoIf we're generating code to create a pointer-to-member function
Douglas Gregor [Mon, 3 May 2010 20:00:27 +0000 (20:00 +0000)]
If we're generating code to create a pointer-to-member function
aggregate and the result of the aggregate is unused, bail out
early. Fixes PR7027.

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

14 years agoDiagnose unused exception parameters under a different warning group
Douglas Gregor [Mon, 3 May 2010 18:51:14 +0000 (18:51 +0000)]
Diagnose unused exception parameters under a different warning group
(-Wunused-exception-parameter) than normal variables, since it's more
common to name and then ignore an exception parameter. This warning is
neither enabled by default nor by -Wall. Fixes <rdar://problem/7931045>.

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

14 years agoComplain when we try to initialize an object of Objective-C class type
Douglas Gregor [Mon, 3 May 2010 18:24:37 +0000 (18:24 +0000)]
Complain when we try to initialize an object of Objective-C class type
(which is ill-formed) with an initializer list. Also, change the
fallback from an assertion to a generic error message, which is far
friendlier. Fixes <rdar://problem/7730948>.

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

14 years agoIt's okay to reference an enum in a template definition, even though
Douglas Gregor [Mon, 3 May 2010 17:48:54 +0000 (17:48 +0000)]
It's okay to reference an enum in a template definition, even though
it's ill-formed to form an enum template. Fixes <rdar://problem/7933063>.

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

14 years agoWhen computing the address of a virtual member function pointer, use the pointer...
Anders Carlsson [Mon, 3 May 2010 16:05:06 +0000 (16:05 +0000)]
When computing the address of a virtual member function pointer, use the pointer width instead of hardcoding for 64-bit.

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

14 years agoTry to unbreak clang-i686-darawin10 builder
Douglas Gregor [Mon, 3 May 2010 15:51:04 +0000 (15:51 +0000)]
Try to unbreak clang-i686-darawin10 builder

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

14 years agoDo not issue warning on unimplemented property in the class, if it
Fariborz Jahanian [Mon, 3 May 2010 15:49:20 +0000 (15:49 +0000)]
Do not issue warning on unimplemented property in the class, if it
conforms to a protocol as one of its super classes does. This is because
conforming super class will implement the property. This implements
new warning rules for unimplemented properties (radar 7884086).

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

14 years agoGet rid of virt.cpp.
Anders Carlsson [Mon, 3 May 2010 15:49:15 +0000 (15:49 +0000)]
Get rid of virt.cpp.

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

14 years agoThe array form of 'new' can never have initializers.
Anders Carlsson [Mon, 3 May 2010 15:45:23 +0000 (15:45 +0000)]
The array form of 'new' can never have initializers.

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