]> granicus.if.org Git - clang/log
clang
14 years agoAdd alternate names for x86 SIMD intrinsics. These aren't as common, but show
Chandler Carruth [Thu, 22 Jul 2010 06:47:28 +0000 (06:47 +0000)]
Add alternate names for x86 SIMD intrinsics. These aren't as common, but show
up enough to be worth supporting properly. Fixes PR7674.

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

14 years agoThis was still complaining about the length of the string. I've broken it here
Chandler Carruth [Thu, 22 Jul 2010 06:29:13 +0000 (06:29 +0000)]
This was still complaining about the length of the string. I've broken it here
to try to keep as much logical grouping as possible.

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

14 years agotests: Make FileCheck version check that preamble isn't longer than we expected.
Daniel Dunbar [Thu, 22 Jul 2010 02:22:24 +0000 (02:22 +0000)]
tests: Make FileCheck version check that preamble isn't longer than we expected.

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

14 years agoDriver/Darwin: Set -force_cpusubtype_ALL only by default on x86.
Daniel Dunbar [Thu, 22 Jul 2010 01:47:22 +0000 (01:47 +0000)]
Driver/Darwin: Set -force_cpusubtype_ALL only by default on x86.

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

14 years agobuild: Make sure arm_neon.h gets installed.
Daniel Dunbar [Thu, 22 Jul 2010 01:19:36 +0000 (01:19 +0000)]
build: Make sure arm_neon.h gets installed.

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

14 years agoDriver/Darwin: Always allow blocks on Darwin, so that users can conditionally
Daniel Dunbar [Thu, 22 Jul 2010 00:40:31 +0000 (00:40 +0000)]
Driver/Darwin: Always allow blocks on Darwin, so that users can conditionally
use blocks even when targetting older systems (using runtime checks and weak
linking).

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

14 years agoObjCId is special "struct objc_object". Make this explicit in debug info.
Devang Patel [Wed, 21 Jul 2010 22:41:25 +0000 (22:41 +0000)]
ObjCId is special "struct objc_object". Make this explicit in debug info.
This is tested by objc-rbreak.exp in gdb testsuite.

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

14 years agoAllow loading macros from any file in the chain. WIP
Sebastian Redl [Wed, 21 Jul 2010 22:31:37 +0000 (22:31 +0000)]
Allow loading macros from any file in the chain. WIP

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

14 years agotests: XFAIL this test on win32, someone else can hunt this one down.
Daniel Dunbar [Wed, 21 Jul 2010 22:09:09 +0000 (22:09 +0000)]
tests: XFAIL this test on win32, someone else can hunt this one down.

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

14 years agoUpgrade "'X' is unavailable" from a warning to an error. This matches GCC's behavior...
Ted Kremenek [Wed, 21 Jul 2010 20:43:11 +0000 (20:43 +0000)]
Upgrade "'X' is unavailable" from a warning to an error.  This matches GCC's behavior.  Note that
GCC emits a warning instead of an error when using an unavailable Objective-C protocol, so now
Clang's behavior is more strict in this case, but more consistent.  We will need to see how much
this fires on real code and determine whether this case should be downgraded to a warning.

Fixes <rdar://problem/8213093>.

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

14 years agoPromote some macro-related stuff to per-file data. Fix a cache-inefficient nested...
Sebastian Redl [Wed, 21 Jul 2010 20:07:32 +0000 (20:07 +0000)]
Promote some macro-related stuff to per-file data. Fix a cache-inefficient nested loop by inverting the nesting. Store the size of each file in the chain; will need this later for statement offsets.

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

14 years agotests: Use FileCheck instead of external input; I think this test was failing on
Daniel Dunbar [Wed, 21 Jul 2010 19:40:01 +0000 (19:40 +0000)]
tests: Use FileCheck instead of external input; I think this test was failing on
Win32 because of line ending differences.

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

14 years agoIntroduce a new C API function, clang_parseTranslationUnit(), which
Douglas Gregor [Wed, 21 Jul 2010 18:52:53 +0000 (18:52 +0000)]
Introduce a new C API function, clang_parseTranslationUnit(), which
will eventually replace
clang_createTranslationUnitFromSourceFile(). The only addition in
clang_parseTranslationUnit() is a set of flags that can control how
the translation unit is loaded. More interesting flags will be coming.

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

14 years agoAdded extra check when looking for location of '=' in
Fariborz Jahanian [Wed, 21 Jul 2010 18:40:47 +0000 (18:40 +0000)]
Added extra check when looking for location of '=' in
a copy initialization.

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

14 years agoFix source location of the initializer in
Fariborz Jahanian [Wed, 21 Jul 2010 18:31:47 +0000 (18:31 +0000)]
Fix source location of the initializer in
a copy initialization. Back out hack in objc rewriter.
fixes radar 8213998.

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

14 years agoCatch thinko that Daniel Dunbar found.
Nate Begeman [Wed, 21 Jul 2010 18:11:42 +0000 (18:11 +0000)]
Catch thinko that Daniel Dunbar found.

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

14 years agoFix regression caused by r108911.
Devang Patel [Wed, 21 Jul 2010 18:08:50 +0000 (18:08 +0000)]
Fix regression caused by r108911.
Do not override known debug loc with unknown debug loc.
This is tested by sections.exp in gdb testsuite.

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

14 years agoFix a rewriter bug which originates in SemaInit involving
Fariborz Jahanian [Wed, 21 Jul 2010 17:36:39 +0000 (17:36 +0000)]
Fix a rewriter bug which originates in SemaInit involving
Constructor Initialization which computes Source Location
differently now. Fixes radar 8213998.

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

14 years agoDon't crash when sending a message inside a block with the non-fragile ABI (GNU runtime).
David Chisnall [Wed, 21 Jul 2010 15:28:28 +0000 (15:28 +0000)]
Don't crash when sending a message inside a block with the non-fragile ABI (GNU runtime).

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

14 years agoMark the load after calling objc_msg_lookup_sender() so that it doesn't get optimised...
David Chisnall [Wed, 21 Jul 2010 12:55:25 +0000 (12:55 +0000)]
Mark the load after calling objc_msg_lookup_sender() so that it doesn't get optimised away (GNU runtime).

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

14 years agoRename LazyCleanup -> Cleanup. No functionality change for these last three
John McCall [Wed, 21 Jul 2010 07:22:38 +0000 (07:22 +0000)]
Rename LazyCleanup -> Cleanup.  No functionality change for these last three
commits.

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

14 years agoRip out EHCleanupScope.
John McCall [Wed, 21 Jul 2010 07:11:21 +0000 (07:11 +0000)]
Rip out EHCleanupScope.

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

14 years agoKill the CleanupBlock API.
John McCall [Wed, 21 Jul 2010 07:04:01 +0000 (07:04 +0000)]
Kill the CleanupBlock API.

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

14 years agoSwitch the fragile-ABI @finally/@synchronized cleanup over to using a lazy
John McCall [Wed, 21 Jul 2010 06:59:36 +0000 (06:59 +0000)]
Switch the fragile-ABI @finally/@synchronized cleanup over to using a lazy
cleanup.

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

14 years agoCode simplification.
John McCall [Wed, 21 Jul 2010 06:45:54 +0000 (06:45 +0000)]
Code simplification.

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

14 years agoSwitch the main possibly-conditional temporary cleanup over to being lazy.
John McCall [Wed, 21 Jul 2010 06:44:28 +0000 (06:44 +0000)]
Switch the main possibly-conditional temporary cleanup over to being lazy.

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

14 years agoSwitch the destructor for a temporary arising from a reference binding over to
John McCall [Wed, 21 Jul 2010 06:29:51 +0000 (06:29 +0000)]
Switch the destructor for a temporary arising from a reference binding over to
using a lazy cleanup.

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

14 years agoSwitch the __cxa_guard_abort cleanup to being a lazy cleanup.
John McCall [Wed, 21 Jul 2010 06:20:50 +0000 (06:20 +0000)]
Switch the __cxa_guard_abort cleanup to being a lazy cleanup.

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

14 years agoSwitch some random local-decl cleanups over to using lazy cleanups. Turn on
John McCall [Wed, 21 Jul 2010 06:13:08 +0000 (06:13 +0000)]
Switch some random local-decl cleanups over to using lazy cleanups.  Turn on
the block-release unwind cleanup:  we're never going to test it if we don't turn
it on.

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

14 years agoSwitch finally cleanups over to being lazy cleanups. We get basically nothing
John McCall [Wed, 21 Jul 2010 05:47:49 +0000 (05:47 +0000)]
Switch finally cleanups over to being lazy cleanups.  We get basically nothing
from the laziness features here except better block ordering, but it removes yet
another CleanupBlock use.

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

14 years agoImplement proper base/member destructor EH chaining.
John McCall [Wed, 21 Jul 2010 05:30:47 +0000 (05:30 +0000)]
Implement proper base/member destructor EH chaining.

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

14 years agoMove some methods inline.
Zhongxing Xu [Wed, 21 Jul 2010 05:21:41 +0000 (05:21 +0000)]
Move some methods inline.

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

14 years agoFix win64 compilation of constants like 0xFFFFFFFFFFFFFFFFULL
Nate Begeman [Wed, 21 Jul 2010 02:02:56 +0000 (02:02 +0000)]
Fix win64 compilation of constants like 0xFFFFFFFFFFFFFFFFULL

intmax_t is __int64 (long long to clang), per VS 2010 stdint.h

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

14 years agoChange PushDestructorCleanup to use lazy cleanups.
John McCall [Wed, 21 Jul 2010 01:41:18 +0000 (01:41 +0000)]
Change PushDestructorCleanup to use lazy cleanups.

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

14 years agoConvert the EH cleanups for base and member destructors in a constructor into
John McCall [Wed, 21 Jul 2010 01:23:41 +0000 (01:23 +0000)]
Convert the EH cleanups for base and member destructors in a constructor into
lazy cleanups.

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

14 years agoImplement zero-initialization for array new when there is an
Douglas Gregor [Wed, 21 Jul 2010 01:10:17 +0000 (01:10 +0000)]
Implement zero-initialization for array new when there is an
initializer of (). Make sure to use a simple memset() when we can, or
fall back to generating a loop when a simple memset will not
suffice. Fixes <rdar://problem/8212208>, a regression due to my work
in r107857.

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

14 years agoConvert the end-catch call for finally blocks to a lazy cleanup. This kills off
John McCall [Wed, 21 Jul 2010 00:52:03 +0000 (00:52 +0000)]
Convert the end-catch call for finally blocks to a lazy cleanup.  This kills off
the last of the shared-code cleanups.

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

14 years agoAllow loading identifiers from any file in the chain. WIP
Sebastian Redl [Wed, 21 Jul 2010 00:46:22 +0000 (00:46 +0000)]
Allow loading identifiers from any file in the chain. WIP

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

14 years agoConvert the ObjC @synchronized cleanups to laziness. This is not actually
John McCall [Wed, 21 Jul 2010 00:41:47 +0000 (00:41 +0000)]
Convert the ObjC @synchronized cleanups to laziness.  This is not actually
a big deal, except that I want to eliminate the shared-code EH cleanups
in preparation for a significant algorithmic fix.

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

14 years agoAdd a little helper method which will be useful soon.
John McCall [Wed, 21 Jul 2010 00:40:03 +0000 (00:40 +0000)]
Add a little helper method which will be useful soon.

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

14 years agoApparently not every system thinks that references in pairs are as cool as I think.
Sebastian Redl [Tue, 20 Jul 2010 22:55:31 +0000 (22:55 +0000)]
Apparently not every system thinks that references in pairs are as cool as I think.

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

14 years agoAllow loading declarations from any file in the chain. WIP
Sebastian Redl [Tue, 20 Jul 2010 22:46:15 +0000 (22:46 +0000)]
Allow loading declarations from any file in the chain. WIP

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

14 years agoAllow loading types from any file in the chain. WIP
Sebastian Redl [Tue, 20 Jul 2010 22:37:49 +0000 (22:37 +0000)]
Allow loading types from any file in the chain. WIP

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

14 years agoRemove unintended code that was checked in as part of r108916.
Devang Patel [Tue, 20 Jul 2010 22:32:37 +0000 (22:32 +0000)]
Remove unintended code that was checked in as part of r108916.

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

14 years agoRemove unused argument.
Devang Patel [Tue, 20 Jul 2010 22:20:10 +0000 (22:20 +0000)]
Remove unused argument.

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

14 years agoFix the IR generation for catching pointers by references.
John McCall [Tue, 20 Jul 2010 22:17:55 +0000 (22:17 +0000)]
Fix the IR generation for catching pointers by references.
Fixes <rdar://problem/8212123>.

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

14 years agoin 'new int[4]', constant fold the 4*4=16 instead of
Chris Lattner [Tue, 20 Jul 2010 21:55:52 +0000 (21:55 +0000)]
in 'new int[4]', constant fold the 4*4=16 instead of
doing an overflow check.

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

14 years agoAllow loading source locations from any file in the chain. WIP
Sebastian Redl [Tue, 20 Jul 2010 21:50:20 +0000 (21:50 +0000)]
Allow loading source locations from any file in the chain. WIP

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

14 years agodon't demand names to be on IR.
Chris Lattner [Tue, 20 Jul 2010 21:34:36 +0000 (21:34 +0000)]
don't demand names to be on IR.

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

14 years agotemporarily disable this to fix the build bot.
Chris Lattner [Tue, 20 Jul 2010 21:32:10 +0000 (21:32 +0000)]
temporarily disable this to fix the build bot.

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

14 years agoMore work on getting PCHReader to handle multiple files. Promote SLocOffsets to per...
Sebastian Redl [Tue, 20 Jul 2010 21:20:32 +0000 (21:20 +0000)]
More work on getting PCHReader to handle multiple files. Promote SLocOffsets to per-file data. WIP

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

14 years agoFollow the implementation approach suggested by PR6687,
Chris Lattner [Tue, 20 Jul 2010 21:07:09 +0000 (21:07 +0000)]
Follow the implementation approach suggested by PR6687,
which generates more efficient and more obviously conformant
code.  We now test for overflow of the multiply then force
the result to -1 if so.  On X86, this generates nice code
like this:

__Z4testl:                              ## @_Z4testl
## BB#0:                                ## %entry
subl $12, %esp
movl $4, %eax
mull 16(%esp)
testl %edx, %edx
movl $-1, %ecx
cmovel %eax, %ecx
movl %ecx, (%esp)
call __Znam
addl $12, %esp
ret

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

14 years agoAdopt objc_assign_threadlocal() for __thread variables of GC types.
Fariborz Jahanian [Tue, 20 Jul 2010 20:30:03 +0000 (20:30 +0000)]
Adopt objc_assign_threadlocal() for __thread variables of GC types.
Implements radar 8203301.

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

14 years agoPrint template argument names for template class.
Devang Patel [Tue, 20 Jul 2010 20:24:18 +0000 (20:24 +0000)]
Print template argument names for template class.

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

14 years agoimplement rdar://5739832 - operator new should check for overflow in multiply,
Chris Lattner [Tue, 20 Jul 2010 20:19:24 +0000 (20:19 +0000)]
implement rdar://5739832 - operator new should check for overflow in multiply,
causing clang to compile this code into something that correctly throws a
length error, fixing a potential integer overflow security attack:

void *test(long N) {
  return new int[N];
}

int main() {
  test(1L << 62);
}

We do this even when exceptions are disabled, because it is better for the
code to abort than for the attack to succeed.

This is heavily based on a patch that Fariborz wrote.

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

14 years agoIntroduce a new lexer function to compute the "preamble" of a file,
Douglas Gregor [Tue, 20 Jul 2010 20:18:03 +0000 (20:18 +0000)]
Introduce a new lexer function to compute the "preamble" of a file,
which is the part of the file that contains all of the initial
comments, includes, and preprocessor directives that occur before any
of the actual code. Added a new -print-preamble cc1 action that is
only used for testing.

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

14 years agoUse getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
Dan Gohman [Tue, 20 Jul 2010 20:13:52 +0000 (20:13 +0000)]
Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.

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

14 years agoHookup checking for invalid length modifiers in scanf format strings.
Ted Kremenek [Tue, 20 Jul 2010 20:04:47 +0000 (20:04 +0000)]
Hookup checking for invalid length modifiers in scanf format strings.

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

14 years agoMove 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.
Ted Kremenek [Tue, 20 Jul 2010 20:04:42 +0000 (20:04 +0000)]
Move 'hasValidLengthModifier' from PrintfFormatSpecifier to FormatSpecifier.

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

14 years agoCleanup whitespace in switch statement. No functionality change.
Ted Kremenek [Tue, 20 Jul 2010 20:04:36 +0000 (20:04 +0000)]
Cleanup whitespace in switch statement.  No functionality change.

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

14 years agoRefactor ScanfConversionSpecifier to subclass ConversionSpecifier.
Ted Kremenek [Tue, 20 Jul 2010 20:04:32 +0000 (20:04 +0000)]
Refactor ScanfConversionSpecifier to subclass ConversionSpecifier.

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

14 years agoAdd 'ConversionSpecifier' root class in 'analyze_format_string' namespace and
Ted Kremenek [Tue, 20 Jul 2010 20:04:27 +0000 (20:04 +0000)]
Add 'ConversionSpecifier' root class in 'analyze_format_string' namespace and
derived 'PrintfConversionSpecifier' from this class.  We will do the same for
'ScanfConversionSpecifier'.

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

14 years agoTidy up analyze_printf::ConversionSpecifier::Kind declaration, prepping it to be...
Ted Kremenek [Tue, 20 Jul 2010 20:04:20 +0000 (20:04 +0000)]
Tidy up analyze_printf::ConversionSpecifier::Kind declaration, prepping it to be merged
with analyze_scanf::ConversionSpecifier::Kind.

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

14 years agoRename 'UnicodeStrArg' to 'SArg'.
Ted Kremenek [Tue, 20 Jul 2010 20:04:15 +0000 (20:04 +0000)]
Rename 'UnicodeStrArg' to 'SArg'.

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

14 years agoRename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf...
Ted Kremenek [Tue, 20 Jul 2010 20:04:10 +0000 (20:04 +0000)]
Rename 'ConsumedSoFarArg' -> 'nArg' and 'OutIntPtrArg' to 'nArg' (scanf and printf checking).

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

14 years agoRename 'VoidPtrArg' to 'pArg' in printf/scanf checking.
Ted Kremenek [Tue, 20 Jul 2010 20:04:04 +0000 (20:04 +0000)]
Rename 'VoidPtrArg' to 'pArg' in printf/scanf checking.

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

14 years agoRename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for...
Ted Kremenek [Tue, 20 Jul 2010 20:03:58 +0000 (20:03 +0000)]
Rename 'CStrArg' to 'sArg' for printf checking to match with the analagous enum for scanf checking.

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

14 years agoRename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to match
Ted Kremenek [Tue, 20 Jul 2010 20:03:49 +0000 (20:03 +0000)]
Rename analyze_printf::ConversionSpecifier::IntAsCharArg to 'cArg' to match
analagous enum in analyze_scanf.  This is prep for refactoring the logic for handling
ConversionSpecifiers for both scanf and printf.

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

14 years agoRename diagnostic so that it can be reused with scanf checking. No functionality...
Ted Kremenek [Tue, 20 Jul 2010 20:03:43 +0000 (20:03 +0000)]
Rename diagnostic so that it can be reused with scanf checking.  No functionality change.

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

14 years agodelete a loop that just generates dead code. In an example
Chris Lattner [Tue, 20 Jul 2010 18:49:33 +0000 (18:49 +0000)]
delete a loop that just generates dead code.  In an example
like this:

void *test(long N) {
  return new int[N][42][42];
}

the loop generates two dead mul instructions:

  %tmp = load i64* %N.addr                        ; <i64> [#uses=2]
  %0 = mul i64 %tmp, 7056                         ; <i64> [#uses=1]
  %1 = mul i64 %tmp, 42                           ; <i64> [#uses=1]
  %2 = mul i64 %1, 42                             ; <i64> [#uses=0]
  %call = call noalias i8* @_Znam(i64 %0)         ; <i8*> [#uses=1]

The scale of these multiplies is already handled by the typesize stuff.

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

14 years agoremove the special case for constant array sizes from
Chris Lattner [Tue, 20 Jul 2010 18:45:57 +0000 (18:45 +0000)]
remove the special case for constant array sizes from
EmitCXXNewAllocSize.  This code uses IRBuilder, which does
constant folding already.

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

14 years agoRe-apply fixed version of 108749, correctly conditionalizing the new sections on
Jim Grosbach [Tue, 20 Jul 2010 16:20:26 +0000 (16:20 +0000)]
Re-apply fixed version of 108749, correctly conditionalizing the new sections on
ObjC ABI version 2 this time.

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

14 years agoSlip up long string literal
Douglas Gregor [Tue, 20 Jul 2010 14:34:35 +0000 (14:34 +0000)]
Slip up long string literal

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

14 years agoComplain when string literals are too long for the active language
Douglas Gregor [Tue, 20 Jul 2010 14:33:20 +0000 (14:33 +0000)]
Complain when string literals are too long for the active language
standard's minimum requirements.

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

14 years agoHide FunctionTemplateDecl's specializations folding set as implementation detail...
Argyrios Kyrtzidis [Tue, 20 Jul 2010 13:59:58 +0000 (13:59 +0000)]
Hide FunctionTemplateDecl's specializations folding set as implementation detail and introduce
FunctionTemplateDecl::findSpecialization.

Redeclarations of specializations will not cause the previous decl to be removed from the set,
the set will keep the canonical decl. findSpecialization will return the most recent redeclaration.

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

14 years agoWhether the specialization should be added to template's folding set when read from...
Argyrios Kyrtzidis [Tue, 20 Jul 2010 13:59:40 +0000 (13:59 +0000)]
Whether the specialization should be added to template's folding set when read from PCH,
is determined by a isCanonicalDecl check.

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

14 years agoHide the specializations folding sets of ClassTemplateDecl as an implementation detai...
Argyrios Kyrtzidis [Tue, 20 Jul 2010 13:59:28 +0000 (13:59 +0000)]
Hide the specializations folding sets of ClassTemplateDecl as an implementation detail (InsertPos
leaks though) and add methods to its interface for adding/finding specializations.

Simplifies its users a bit and we no longer need to replace specializations in the folding set with
their redeclarations. We just return the most recent redeclarations.

As a bonus, it fixes http://llvm.org/PR7670.

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

14 years agoAdd -lstdc++ to DragonFly tools.
Rafael Espindola [Tue, 20 Jul 2010 12:59:03 +0000 (12:59 +0000)]
Add -lstdc++ to DragonFly tools.
Patch by Sascha Wildner.

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

14 years agoConstify all references to Stmt* and CFGBlock* in libChecker.
Zhongxing Xu [Tue, 20 Jul 2010 06:22:24 +0000 (06:22 +0000)]
Constify all references to Stmt* and CFGBlock* in libChecker.

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

14 years agoAdd const iterator to InitListExpr.
Zhongxing Xu [Tue, 20 Jul 2010 06:15:27 +0000 (06:15 +0000)]
Add const iterator to InitListExpr.

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

14 years agoUpdate ImplicitCastExpr to be able to represent an XValue.
Sebastian Redl [Tue, 20 Jul 2010 04:20:21 +0000 (04:20 +0000)]
Update ImplicitCastExpr to be able to represent an XValue.

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

14 years agoFix test for Win32.
Daniel Dunbar [Tue, 20 Jul 2010 04:06:54 +0000 (04:06 +0000)]
Fix test for Win32.

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

14 years agoConstify.
Zhongxing Xu [Tue, 20 Jul 2010 02:56:49 +0000 (02:56 +0000)]
Constify.

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

14 years agoremove const_cast.
Zhongxing Xu [Tue, 20 Jul 2010 02:53:15 +0000 (02:53 +0000)]
remove const_cast.

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

14 years agoDriver: Switch to using a SmallVector instead of std::vector, and stop
Daniel Dunbar [Tue, 20 Jul 2010 02:47:40 +0000 (02:47 +0000)]
Driver: Switch to using a SmallVector instead of std::vector, and stop
accessing outside the range of the vector (which always asserts on Win32).

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

14 years agoconstify.
Zhongxing Xu [Tue, 20 Jul 2010 02:46:11 +0000 (02:46 +0000)]
constify.

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

14 years agoConstify.
Zhongxing Xu [Tue, 20 Jul 2010 02:41:28 +0000 (02:41 +0000)]
Constify.

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

14 years agoAdd comments.
Zhongxing Xu [Tue, 20 Jul 2010 02:14:22 +0000 (02:14 +0000)]
Add comments.

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

14 years agoCorrect line info for declarations/definitions. Radar 8063111.
Stuart Hastings [Mon, 19 Jul 2010 23:56:31 +0000 (23:56 +0000)]
Correct line info for declarations/definitions.  Radar 8063111.

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

14 years agoand revert the related tests, too
Jim Grosbach [Mon, 19 Jul 2010 22:53:57 +0000 (22:53 +0000)]
and revert the related tests, too

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

14 years agoTemporarily revert. Some odd internal breakage is likely related.
Jim Grosbach [Mon, 19 Jul 2010 22:43:34 +0000 (22:43 +0000)]
Temporarily revert. Some odd internal breakage is likely related.

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

14 years agoRemove PCHReader::getStream(), it was unused. Inline PCHReader::getDelsCursor() into...
Sebastian Redl [Mon, 19 Jul 2010 22:38:35 +0000 (22:38 +0000)]
Remove PCHReader::getStream(), it was unused. Inline PCHReader::getDelsCursor() into its sole caller and remove it. This reduces the attack surface of multiple PCH files towards code outside the PCH implementation.

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

14 years agoPromote IdentifierOffsets to per-file data.
Sebastian Redl [Mon, 19 Jul 2010 22:28:42 +0000 (22:28 +0000)]
Promote IdentifierOffsets to per-file data.

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

14 years agoPromote DeclOffsets and TypeOffsets to per-file data.
Sebastian Redl [Mon, 19 Jul 2010 22:06:55 +0000 (22:06 +0000)]
Promote DeclOffsets and TypeOffsets to per-file data.

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

14 years agoPatch to type match comparing Objective-C Classes which implement
Fariborz Jahanian [Mon, 19 Jul 2010 22:02:22 +0000 (22:02 +0000)]
Patch to type match comparing Objective-C Classes which implement
protocols (Radar 8191774).

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

14 years agoDon't warn when a '%%' or '%*d' (scanf) is used in a format string with positional...
Ted Kremenek [Mon, 19 Jul 2010 22:01:06 +0000 (22:01 +0000)]
Don't warn when a '%%' or '%*d' (scanf) is used in a format string with positional arguments, since
these don't actually consume an argument.

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

14 years agoIntroduce a new libclang API, clang_reparseTranslationUnit(), which
Douglas Gregor [Mon, 19 Jul 2010 21:46:24 +0000 (21:46 +0000)]
Introduce a new libclang API, clang_reparseTranslationUnit(), which
reparses an already-parsed translation unit. At the moment it's just a
convenience function, but we hope to use it for performance
optimizations.

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

14 years agoUpdate tests for r108749
Jim Grosbach [Mon, 19 Jul 2010 21:39:14 +0000 (21:39 +0000)]
Update tests for r108749

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

14 years agoHook up 'invalid conversion' warning for scanf format strings.
Ted Kremenek [Mon, 19 Jul 2010 21:25:57 +0000 (21:25 +0000)]
Hook up 'invalid conversion' warning for scanf format strings.

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

14 years agoPut ObjC method names, method types and class names in separate string literal
Jim Grosbach [Mon, 19 Jul 2010 20:54:43 +0000 (20:54 +0000)]
Put ObjC method names, method types and class names in separate string literal
sections. rdar://8207705

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