]> granicus.if.org Git - clang/log
clang
14 years agoSupport x86 AVX 256-bit instructions built-ins. Right now support all of them, but
Bruno Cardoso Lopes [Tue, 3 Aug 2010 01:57:18 +0000 (01:57 +0000)]
Support x86 AVX 256-bit instructions built-ins. Right now support all of them, but
as soon as we properly codegen the simple vector operations, remove the
unnecessary built-ins/intrinsics from clang and llvm. Also add tests for the new
built-ins

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

14 years agoChanged GRExprEngine to pass down a reference to itself when checkers are doing posta...
Tom Care [Tue, 3 Aug 2010 01:55:07 +0000 (01:55 +0000)]
Changed GRExprEngine to pass down a reference to itself when checkers are doing postanalysis. This allows the checker to gather information about the state of the engine when it has finished.
- Exposed the worklist and BlockAborted flag in GRCoreEngine
- Changed postanalysis checkers to use the new infrastructure

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

14 years agoAdd -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that...
Ted Kremenek [Tue, 3 Aug 2010 00:09:51 +0000 (00:09 +0000)]
Add -cc1 option '-unoptimized-cfg' to toggle using a CFG (for static analysis) that doesn't prune CFG edges.

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

14 years agoAdd 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to the...
Ted Kremenek [Mon, 2 Aug 2010 23:46:59 +0000 (23:46 +0000)]
Add 'AnalysisContext::getUnoptimizedCFG()' to allow clients to get access to the original
CFG without any edges pruned out because of trivially solvable conditions (e.g., 'if (0)').

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

14 years agoLabels (and case statement) don't create independent scope parents for the
John McCall [Mon, 2 Aug 2010 23:33:14 +0000 (23:33 +0000)]
Labels (and case statement) don't create independent scope parents for the
purposes of the jump checker.  Also extend Ted's iteration fix to labels.

Fixes PR7789.

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

14 years agoSimplify global method pool implementation in Sema. No functionality change.
Sebastian Redl [Mon, 2 Aug 2010 23:18:59 +0000 (23:18 +0000)]
Simplify global method pool implementation in Sema. No functionality change.

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

14 years agoFix another case (this time in JumpScopeChecker) where walking deeply nested CaseStmt...
Ted Kremenek [Mon, 2 Aug 2010 22:46:57 +0000 (22:46 +0000)]
Fix another case (this time in JumpScopeChecker) where walking deeply nested CaseStmts can blow out the stack.  Fixes <rdar://problem/8125165>.

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

14 years agoFix idempotent operations false positive caused by ivars not being invalidated in...
Ted Kremenek [Mon, 2 Aug 2010 21:59:12 +0000 (21:59 +0000)]
Fix idempotent operations false positive caused by ivars not being invalidated in function
calls when the enclosing object had retain/release state.  Fixes <rdar://problem/8261992>.

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

14 years agoFurther adjustments to -Wglobal-constructors; works for references and direct
John McCall [Mon, 2 Aug 2010 21:13:48 +0000 (21:13 +0000)]
Further adjustments to -Wglobal-constructors;  works for references and direct
initializations now.

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

14 years agoAdd Darwin dylib versioning support to libclang when build with CMake.
Douglas Gregor [Mon, 2 Aug 2010 20:52:32 +0000 (20:52 +0000)]
Add Darwin dylib versioning support to libclang when build with CMake.

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

14 years agoWhen using a precompiled preamble, save the diagnostics produced when
Douglas Gregor [Mon, 2 Aug 2010 20:51:39 +0000 (20:51 +0000)]
When using a precompiled preamble, save the diagnostics produced when
creating the preamble and "replay" them when reusing the
preamble. Also, fix a thinko in the copying of the preamble when
building the precompiled preamble.

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

14 years ago'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; no need...
Ted Kremenek [Mon, 2 Aug 2010 20:33:02 +0000 (20:33 +0000)]
'Assumption &A' gets default initialized to 'Possible' if it doesn't exist; no need to two
lookups in the hashtable.

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

14 years agoAdd test case for <rdar://problem/8258814>.
Ted Kremenek [Mon, 2 Aug 2010 20:33:00 +0000 (20:33 +0000)]
Add test case for <rdar://problem/8258814>.

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

14 years agoQuery only the latest version of an identifier in the PCH chain. Make sure this versi...
Sebastian Redl [Mon, 2 Aug 2010 18:30:12 +0000 (18:30 +0000)]
Query only the latest version of an identifier in the PCH chain. Make sure this version holds the entire declaration chain. This is a much saner solution than trying to merge the info from all elements, and makes redeclarations work properly. Expand the declarations test case to cover more compliated cases.

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

14 years agoRemove mutable data on TagType and InjectedClassNameType, by instead walking the...
Sebastian Redl [Mon, 2 Aug 2010 18:27:05 +0000 (18:27 +0000)]
Remove mutable data on TagType and InjectedClassNameType, by instead walking the declaration chain in search of a definition. This is necessary for a sane chained PCH implementation. No observable performance change on Carbon.h syntax-only, and bootstraps cleanly.

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

14 years agoCompute width/align of objc builtin types (id, etc)
Fariborz Jahanian [Mon, 2 Aug 2010 18:03:20 +0000 (18:03 +0000)]
Compute width/align of objc builtin types (id, etc)
for radar 8258797.

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

14 years agoUpdate UsersManual, we support '#pragma align' now.
Daniel Dunbar [Mon, 2 Aug 2010 15:36:37 +0000 (15:36 +0000)]
Update UsersManual, we support '#pragma align' now.

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

14 years agoFrontend: Change PluginASTAction::ParseArgs to take a CompilerInstance object
Daniel Dunbar [Mon, 2 Aug 2010 15:31:28 +0000 (15:31 +0000)]
Frontend: Change PluginASTAction::ParseArgs to take a CompilerInstance object
for use in reporting diagnostics.
 - We don't want to use the Action's own CompilerInstance, because that is only
   initialized during file processing and I like that invariant.

Also, if ParseArgs returns false then abandon execution.

Also, remove unused PluginASTAction::PrintHelp virtual method.

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

14 years agoYou actually have to include a header in order to use a symbol, it's so 90s..
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:46:27 +0000 (07:46 +0000)]
You actually have to include a header in order to use a symbol, it's so 90s..

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

14 years agoUse llvm_unreachable.
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:31:21 +0000 (07:31 +0000)]
Use llvm_unreachable.

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

14 years agoShut up warnings in Release build.
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:24:29 +0000 (07:24 +0000)]
Shut up warnings in Release build.

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

14 years agoRead/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them...
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:14:54 +0000 (07:14 +0000)]
Read/write in PCH Sema's StdNamespace and StdBadAlloc and use a LazyDeclPtr for them that will deserialize them when needed.

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

14 years agoRename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
Argyrios Kyrtzidis [Mon, 2 Aug 2010 07:14:39 +0000 (07:14 +0000)]
Rename getStdNamespace -> getOrCreateStdNamespace, to better reflect its functionality.
No functionality change.

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

14 years agoDriver/Darwin: Change where Darwin computes the host version, to normalize tool
Daniel Dunbar [Mon, 2 Aug 2010 05:44:07 +0000 (05:44 +0000)]
Driver/Darwin: Change where Darwin computes the host version, to normalize tool
chain construction.

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

14 years agoDriver: Have -ccc-host-triple simply override the default in the driver, for
Daniel Dunbar [Mon, 2 Aug 2010 05:44:04 +0000 (05:44 +0000)]
Driver: Have -ccc-host-triple simply override the default in the driver, for
now.

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

14 years agoDriver/Darwin: Inline some constants.
Daniel Dunbar [Mon, 2 Aug 2010 05:44:01 +0000 (05:44 +0000)]
Driver/Darwin: Inline some constants.

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

14 years agoDriver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize tool
Daniel Dunbar [Mon, 2 Aug 2010 05:43:59 +0000 (05:43 +0000)]
Driver/FreeBSD: Change how FreeBSD derives the Lib32 variable, to normalize tool
chain construction.

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

14 years agoDriver: Move HostInfo::lookupTypeForExtension to ToolChain::LookupTypeForExtension.
Daniel Dunbar [Mon, 2 Aug 2010 05:43:56 +0000 (05:43 +0000)]
Driver: Move HostInfo::lookupTypeForExtension to ToolChain::LookupTypeForExtension.

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

14 years agoDriver: Give Build{Universal,}Actions access to the default host tool chain. I
Daniel Dunbar [Mon, 2 Aug 2010 05:43:51 +0000 (05:43 +0000)]
Driver: Give Build{Universal,}Actions access to the default host tool chain. I
avoided this originally to enforce that the driver actions aren't toolchain
dependent, but it isn't worth the cumbersone additional hostinfo split.

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

14 years agoImprove flat store: MemRegion::getAsOffset() computes a region's offset within
Zhongxing Xu [Mon, 2 Aug 2010 04:56:14 +0000 (04:56 +0000)]
Improve flat store: MemRegion::getAsOffset() computes a region's offset within
the top-level object. FlatStore now can bind and retrieve element and field
regions.
PR7297 is fixed by flat store.

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

14 years agoDriver: Add Compilation::addCommand and switch tools to using it, now that we
Daniel Dunbar [Mon, 2 Aug 2010 02:38:28 +0000 (02:38 +0000)]
Driver: Add Compilation::addCommand and switch tools to using it, now that we
don't have to deal with nested jobs.

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

14 years agoDriver: Eliminate PipedJob, which is now unused.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:25 +0000 (02:38 +0000)]
Driver: Eliminate PipedJob, which is now unused.

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

14 years agoDriver: Eliminate special InputInfo kind for pipes, it is now unused.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:21 +0000 (02:38 +0000)]
Driver: Eliminate special InputInfo kind for pipes, it is now unused.

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

14 years agoDriver: Eliminate now unnecessary tool hooks for whether they accept piped input...
Daniel Dunbar [Mon, 2 Aug 2010 02:38:18 +0000 (02:38 +0000)]
Driver: Eliminate now unnecessary tool hooks for whether they accept piped input/output.

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

14 years agoDriver: Simplify.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:15 +0000 (02:38 +0000)]
Driver: Simplify.

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

14 years agoDriver: Eliminate now unused argument.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:12 +0000 (02:38 +0000)]
Driver: Eliminate now unused argument.

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

14 years agoDriver: Simplify logic for sending 'clang -E t.c' output to stdout.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:08 +0000 (02:38 +0000)]
Driver: Simplify logic for sending 'clang -E t.c' output to stdout.

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

14 years agoDriver: Never try to use piped inputs.
Daniel Dunbar [Mon, 2 Aug 2010 02:38:06 +0000 (02:38 +0000)]
Driver: Never try to use piped inputs.

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

14 years agoDriver: Start ripping out support for -pipe, which is worthless and complicates
Daniel Dunbar [Mon, 2 Aug 2010 02:38:03 +0000 (02:38 +0000)]
Driver: Start ripping out support for -pipe, which is worthless and complicates
too many other things.

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

14 years agoDriver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Daniel Dunbar [Sun, 1 Aug 2010 23:13:54 +0000 (23:13 +0000)]
Driver/OpenBSD: Update toolchain for compiler changes / C++; patch by Jonathan
Gray.

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

14 years agoDriver: Keep track of a separate "install dir", which is the path where clang
Daniel Dunbar [Sun, 1 Aug 2010 22:29:51 +0000 (22:29 +0000)]
Driver: Keep track of a separate "install dir", which is the path where clang
was invoked from (which may not be where the executable itself is).
 - This allows having e.g., /Developer/usr/bin/clang be a symlink to some other
   location, while still making sure the Driver finds 'as', 'ld', etc. relative
   to itself.

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

14 years agoSimplify.
Daniel Dunbar [Sun, 1 Aug 2010 22:29:47 +0000 (22:29 +0000)]
Simplify.

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

14 years agoPR7777: Set EnabledByDefault to something useful, instead of setting it
Eli Friedman [Sun, 1 Aug 2010 22:13:15 +0000 (22:13 +0000)]
PR7777: Set EnabledByDefault to something useful, instead of setting it
randomly.  This makes us consistently show "-pedantic" as the warning option
for a warning where appropriate.

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

14 years agoKill off RequiresGlobalConstructor in favor of isConstantInitializer.
John McCall [Sun, 1 Aug 2010 21:51:45 +0000 (21:51 +0000)]
Kill off RequiresGlobalConstructor in favor of isConstantInitializer.
Note some obvious false positives in the test case.

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

14 years agoMake a first pass at implementing -Wglobal-constructors. I'm worried that this
John McCall [Sun, 1 Aug 2010 20:20:59 +0000 (20:20 +0000)]
Make a first pass at implementing -Wglobal-constructors.  I'm worried that this
will end up bizarrely mirroring CGExprConstant, but that might be the hazard of
this feature.

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

14 years agoInstantiate attributes from the pattern record when instantiating
John McCall [Sun, 1 Aug 2010 02:01:53 +0000 (02:01 +0000)]
Instantiate attributes from the pattern record when instantiating
a class template.  Fixes rdar://problem/8243419.

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

14 years agoFix indentation.
John McCall [Sun, 1 Aug 2010 01:25:24 +0000 (01:25 +0000)]
Fix indentation.

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

14 years agoDon't consider all local variables in C++ to mandate scope-checking, just
John McCall [Sun, 1 Aug 2010 01:24:59 +0000 (01:24 +0000)]
Don't consider all local variables in C++ to mandate scope-checking, just
those with initializers.

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

14 years agoOnly run the jump-checker if there's a branch-protected scope *and* there's
John McCall [Sun, 1 Aug 2010 00:26:45 +0000 (00:26 +0000)]
Only run the jump-checker if there's a branch-protected scope *and* there's
a switch or goto somewhere in the function.  Indirect gotos trigger the
jump-checker regardless, because the conditions there are slightly more
elaborate and it's too marginal a case to be worth optimizing.

Turns off the jump-checker in a lot of cases in C++.  rdar://problem/7702918

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

14 years agoIterate typeloc's for class bases.
Nick Lewycky [Sat, 31 Jul 2010 23:26:36 +0000 (23:26 +0000)]
Iterate typeloc's for class bases.

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

14 years agoFix fragile-ABI ObjC exceptions in the presence of optimization with
John McCall [Sat, 31 Jul 2010 23:20:56 +0000 (23:20 +0000)]
Fix fragile-ABI ObjC exceptions in the presence of optimization with
the magic of inline assembly.  Essentially we use read and write hazards
on the set of local variables to force flushing locals to memory
immediately before any protected calls and to inhibit optimizing locals
across the setjmp->catch edge.  Fixes rdar://problem/8160285

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

14 years agobuild: Don't pass -avoid-version or -no-undefined on Darwin, they don't do
Daniel Dunbar [Sat, 31 Jul 2010 21:33:01 +0000 (21:33 +0000)]
build: Don't pass -avoid-version or -no-undefined on Darwin, they don't do
anything.

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

14 years agoParser: Add support for #pragma align, which is just another spelling of #pragma
Daniel Dunbar [Sat, 31 Jul 2010 19:17:07 +0000 (19:17 +0000)]
Parser: Add support for #pragma align, which is just another spelling of #pragma
options align.

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

14 years agoAfter a lengthy design discussion, add support for "ownership attributes" for malloc...
Ted Kremenek [Sat, 31 Jul 2010 01:52:11 +0000 (01:52 +0000)]
After a lengthy design discussion, add support for "ownership attributes" for malloc/free checking.  Patch by Andrew McGregor!

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

14 years agoImplement dependency analysis for the precompiled preamble. If any of
Douglas Gregor [Sat, 31 Jul 2010 00:40:00 +0000 (00:40 +0000)]
Implement dependency analysis for the precompiled preamble. If any of
the files in the precompiled preamble have changed since it was build,
force the preamble to be rebuilt.

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

14 years agoUpdate checker build.
Ted Kremenek [Fri, 30 Jul 2010 23:07:20 +0000 (23:07 +0000)]
Update checker build.

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

14 years agoTest case for PR7763.
Tom Care [Fri, 30 Jul 2010 21:42:31 +0000 (21:42 +0000)]
Test case for PR7763.

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

14 years agoUncomment unfinished work bailout in IdempotentOperationsChecker.
Tom Care [Fri, 30 Jul 2010 21:14:15 +0000 (21:14 +0000)]
Uncomment unfinished work bailout in IdempotentOperationsChecker.

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

14 years agoAdd some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING environment...
Douglas Gregor [Fri, 30 Jul 2010 20:58:08 +0000 (20:58 +0000)]
Add some timers to ASTUnit that are only enabled when the LIBCLANG_TIMING environment variable is set.

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

14 years agoCorrectly deal with using names for both functions and structs in chained PCH.
Sebastian Redl [Fri, 30 Jul 2010 17:25:10 +0000 (17:25 +0000)]
Correctly deal with using names for both functions and structs in chained PCH.

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

14 years agoAdd specialisation iterators for {Class,Function}TemplateDecl
Peter Collingbourne [Fri, 30 Jul 2010 17:09:11 +0000 (17:09 +0000)]
Add specialisation iterators for {Class,Function}TemplateDecl

This patch introduces the ClassTemplateDecl::spec_{begin,end}()
and FunctionTemplateDecl::{,partial_}spec_{begin,end}() member
functions as a public interface for iterating over the declarations'
specialisation sets.

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

14 years agoRefactor find*Specialization functions using SpecEntryTraits
Peter Collingbourne [Fri, 30 Jul 2010 17:09:04 +0000 (17:09 +0000)]
Refactor find*Specialization functions using SpecEntryTraits

This patch reimplements the find*Specialization family of member
functions of {Class,Function}TemplateDecl in terms of a common
implementation that uses SpecEntryTraits to obtain the most recent
declaration.

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

14 years agoIntroduce RedeclarableTemplateDecl::SpecEntryTraits
Peter Collingbourne [Fri, 30 Jul 2010 17:08:56 +0000 (17:08 +0000)]
Introduce RedeclarableTemplateDecl::SpecEntryTraits

SpecEntryTraits describes how to obtain the most recent declaration
of a specialisation from an entry in a specialisation FoldingSet.

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

14 years agoSafely get a data pointer for vectors that might be empty.
Sebastian Redl [Fri, 30 Jul 2010 17:03:48 +0000 (17:03 +0000)]
Safely get a data pointer for vectors that might be empty.

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

14 years agoTighten the rules when deciding if an ivar must be
Fariborz Jahanian [Fri, 30 Jul 2010 16:59:05 +0000 (16:59 +0000)]
Tighten the rules when deciding if an ivar must be
auto-synthesized (nonfragile-abi2 specific).
Fixes radar 8251648.

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

14 years agoFixed typedef inside extern "C".
Abramo Bagnara [Fri, 30 Jul 2010 16:47:02 +0000 (16:47 +0000)]
Fixed typedef inside extern "C".

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

14 years agotests: Use env instead of assuming bash.
Daniel Dunbar [Fri, 30 Jul 2010 16:40:29 +0000 (16:40 +0000)]
tests: Use env instead of assuming bash.

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

14 years agoUpdate checker build.
Ted Kremenek [Fri, 30 Jul 2010 16:27:57 +0000 (16:27 +0000)]
Update checker build.

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

14 years agoWhen we are deserializing the lexical decls of a DeclContext from PCH, notify the...
Argyrios Kyrtzidis [Fri, 30 Jul 2010 10:03:23 +0000 (10:03 +0000)]
When we are deserializing the lexical decls of a DeclContext from PCH, notify the PCHReader to hold off passing Decls
to the consumer until the DeclContext is fully prepared.

Before, due to recursive loading, we could be in a situation where we would try to deserialize the decls of a DeclContext which was already doing that, and bad things would happen. In the specific case I encountered, the lexical decls would
form a cycle and we would enter infinite loop territory.

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

14 years agoRefactor the way PCHReader tracks whether we are in recursive loading.
Argyrios Kyrtzidis [Fri, 30 Jul 2010 10:03:16 +0000 (10:03 +0000)]
Refactor the way PCHReader tracks whether we are in recursive loading.

-Replace CurrentlyLoadingTypeOrDecl with a counting scheme (NumCurrentElementsDeserializing)
-Provide outside access to the mechanism by adding methods StartedDeserializing/FinishedDeserializing
  to ExternalASTSource.

These are preparation for the next commit.

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

14 years agoImprove error recovery when presented with an ill-formed template-id
John McCall [Fri, 30 Jul 2010 06:26:29 +0000 (06:26 +0000)]
Improve error recovery when presented with an ill-formed template-id
(e.g. due to a broken template argument) following template parameters.

Fixes rdar://problem/8254267

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

14 years agoIf a TST_typename has a null type, mark the declarator invalid. Prevents
John McCall [Fri, 30 Jul 2010 05:17:22 +0000 (05:17 +0000)]
If a TST_typename has a null type, mark the declarator invalid.  Prevents
some downstream crashes, among them rdar://problem/8229840.

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

14 years agoEmit global destructors even if the destroyed object has no initializers or has
John McCall [Fri, 30 Jul 2010 04:56:58 +0000 (04:56 +0000)]
Emit global destructors even if the destroyed object has no initializers or has
an initializer requiring temporary object disposal.

Fixes rdar:://problem/8246444.

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

14 years agofix PR5179 and correctly fix PR5831 to not miscompile.
Chris Lattner [Fri, 30 Jul 2010 04:02:24 +0000 (04:02 +0000)]
fix PR5179 and correctly fix PR5831 to not miscompile.

The X86-64 ABI code didn't handle the case when a struct
would get classified and turn up as "NoClass INTEGER" for
example.  This is perfectly possible when the first slot
is all padding (e.g. due to empty base classes).  In this
situation, the first 8-byte doesn't take a register at all,
only the second 8-byte does.

This fixes this by enhancing the x86-64 abi stuff to allow
and handle this case, reverts the broken fix for PR5831,
and enhances the target independent stuff to be able to
handle an argument value in registers being accessed at an
offset from the memory value.

This is the last x86-64 calling convention related miscompile
that I'm aware of.

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

14 years agoThere is no reason for this test to invoke 'llc'.
Daniel Dunbar [Fri, 30 Jul 2010 03:30:55 +0000 (03:30 +0000)]
There is no reason for this test to invoke 'llc'.

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

14 years agoAdd test case for crash reported in <rdar://problem/8236270> (which has since been...
Ted Kremenek [Fri, 30 Jul 2010 01:10:48 +0000 (01:10 +0000)]
Add test case for crash reported in <rdar://problem/8236270> (which has since been fixed in trunk).

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

14 years agoDon't print out ivars twice in Decl::print(). Fixes <rdar://problem/8253668>.
Ted Kremenek [Fri, 30 Jul 2010 00:47:46 +0000 (00:47 +0000)]
Don't print out ivars twice in Decl::print().  Fixes <rdar://problem/8253668>.

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

14 years agoMake macro weirdness in chained PCH work. This required changing the way PCHReader...
Sebastian Redl [Fri, 30 Jul 2010 00:29:29 +0000 (00:29 +0000)]
Make macro weirdness in chained PCH work. This required changing the way PCHReader and PCHWriter are initialized to correctly pick up all initializer. On the upside, this means that there is far less repetition in the dependent PCH now.

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

14 years agoAdd clang_isPODType() for querying if the CXType is POD. Implements <rdar://problem...
Ted Kremenek [Fri, 30 Jul 2010 00:14:11 +0000 (00:14 +0000)]
Add clang_isPODType() for querying if the CXType is POD.  Implements <rdar://problem/8250669>.

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

14 years agoRevert "Re-apply fixed version of 108749, correctly conditionalizing the new
Daniel Dunbar [Thu, 29 Jul 2010 22:57:21 +0000 (22:57 +0000)]
Revert "Re-apply fixed version of 108749, correctly conditionalizing the new
sections on", this change uncovered a possible linker bug which resulted in the
wrong messages getting dispatched. Backing this out while we investigate...

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

14 years agoCMake: Clang test targets depend on the {FileCheck,not,count} tools.
Daniel Dunbar [Thu, 29 Jul 2010 22:57:17 +0000 (22:57 +0000)]
CMake: Clang test targets depend on the {FileCheck,not,count} tools.

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

14 years agoWire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.
Nate Begeman [Thu, 29 Jul 2010 22:48:34 +0000 (22:48 +0000)]
Wire up sema checking for __builtin_arm_usat and __builtin_arm_ssat immediates.

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

14 years agoTeach isIncompleteType() to look through sugar when it is dealing with
Douglas Gregor [Thu, 29 Jul 2010 22:17:04 +0000 (22:17 +0000)]
Teach isIncompleteType() to look through sugar when it is dealing with
Objective-C object and interface types. This is part of PR7741.

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

14 years agomove the last hunk of getCoerceResult into the place
Chris Lattner [Thu, 29 Jul 2010 21:42:50 +0000 (21:42 +0000)]
move the last hunk of getCoerceResult into the place
that needs it and remove getCoerceResult.

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

14 years agonow that direct and coerce are merged, getCoerceResult gets simpler.
Chris Lattner [Thu, 29 Jul 2010 21:29:53 +0000 (21:29 +0000)]
now that direct and coerce are merged, getCoerceResult gets simpler.

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

14 years agonow that GetSSETypeAtOffset handles passing SSE class values as
Chris Lattner [Thu, 29 Jul 2010 21:22:50 +0000 (21:22 +0000)]
now that GetSSETypeAtOffset handles passing SSE class values as
float, the special case hack in getCoerceResult can go away.

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

14 years agoChange the name to something less terrible; suggestion by Doug. No functionality...
Argyrios Kyrtzidis [Thu, 29 Jul 2010 20:08:05 +0000 (20:08 +0000)]
Change the name to something less terrible; suggestion by Doug. No functionality change.

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

14 years agoWeak references and variables that are not definitions are not required for early...
Argyrios Kyrtzidis [Thu, 29 Jul 2010 20:07:52 +0000 (20:07 +0000)]
Weak references and variables that are not definitions are not required for early codegen/deserialization.

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

14 years agoImplement the clang-side of detection for when to pass as
Chris Lattner [Thu, 29 Jul 2010 18:39:32 +0000 (18:39 +0000)]
Implement the clang-side of detection for when to pass as
<2 x float> instead of double.  This works but can't be turned
on until I teach codegen to pass <2 x float> as one XMM register
instead of two.

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

14 years agoLook at me, I can count!
Chris Lattner [Thu, 29 Jul 2010 18:19:50 +0000 (18:19 +0000)]
Look at me, I can count!

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

14 years agoImplement PCH support for offsetof(base-specifier).
Argyrios Kyrtzidis [Thu, 29 Jul 2010 18:16:10 +0000 (18:16 +0000)]
Implement PCH support for offsetof(base-specifier).

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

14 years agoMerge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into...
Argyrios Kyrtzidis [Thu, 29 Jul 2010 18:15:58 +0000 (18:15 +0000)]
Merge PCHWriterDecl.cpp's isRequiredDecl and CodeGenModule::MayDeferGeneration into a new function,
DeclIsRequiredFunctionOrFileScopedVar.

This is essentially a CodeGen predicate that is also needed by the PCH mechanism to determine whether a decl
needs to be deserialized during PCH loading for codegen purposes.
Since this logic is shared by CodeGen and the PCH mechanism, move it to the ASTContext,
thus CodeGenModule's GetLinkageForFunction/GetLinkageForVariable and the GVALinkage enum is moved out of CodeGen.

This fixes current (and avoids future) codegen-from-PCH bugs.

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

14 years agofix rdar://8251384, another case where we could access beyond the
Chris Lattner [Thu, 29 Jul 2010 18:13:09 +0000 (18:13 +0000)]
fix rdar://8251384, another case where we could access beyond the
end of a struct.  This improves the case when the struct being passed
contains 3 floats, either due to a struct or array of 3 things.  Before
we'd generate this IR for the testcase:

define float @bar(double %X.coerce0, double %X.coerce1) nounwind {
entry:
  %X = alloca %struct.foof, align 8               ; <%struct.foof*> [#uses=2]
  %0 = bitcast %struct.foof* %X to %1*            ; <%1*> [#uses=2]
  %1 = getelementptr %1* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %X.coerce0, double* %1
  %2 = getelementptr %1* %0, i32 0, i32 1         ; <double*> [#uses=1]
  store double %X.coerce1, double* %2
  %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
  %tmp1 = load float* %tmp                        ; <float> [#uses=1]
  ret float %tmp1
}

which compiled (with optimization) to:

_bar:                                   ## @bar
## BB#0:                                ## %entry
movd %xmm1, %rax
movd %eax, %xmm0
ret

Now we produce:

define float @bar(double %X.coerce0, float %X.coerce1) nounwind {
entry:
  %X = alloca %struct.foof, align 8               ; <%struct.foof*> [#uses=2]
  %0 = bitcast %struct.foof* %X to %0*            ; <%0*> [#uses=2]
  %1 = getelementptr %0* %0, i32 0, i32 0         ; <double*> [#uses=1]
  store double %X.coerce0, double* %1
  %2 = getelementptr %0* %0, i32 0, i32 1         ; <float*> [#uses=1]
  store float %X.coerce1, float* %2
  %tmp = getelementptr inbounds %struct.foof* %X, i32 0, i32 2 ; <float*> [#uses=1]
  %tmp1 = load float* %tmp                        ; <float> [#uses=1]
  ret float %tmp1
}

and:

_bar:                                   ## @bar
## BB#0:                                ## %entry
movaps %xmm1, %xmm0
ret

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

14 years agoAdd codegen support for ARM qadd & qsub intrinsics
Nate Begeman [Thu, 29 Jul 2010 17:57:17 +0000 (17:57 +0000)]
Add codegen support for ARM qadd & qsub intrinsics

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

14 years agostart setting up infrastructure for passing multi-floats
Chris Lattner [Thu, 29 Jul 2010 17:49:08 +0000 (17:49 +0000)]
start setting up infrastructure for passing multi-floats
as <2 x float> instead of as double.  The backend isn't ready
yet, but infrastructure in the frontend can come up.

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

14 years agoPrepare for upcoming ownership change.
Benjamin Kramer [Thu, 29 Jul 2010 17:48:03 +0000 (17:48 +0000)]
Prepare for upcoming ownership change.

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

14 years agorename Get8ByteTypeAtOffset -> GetINTEGERTypeAtOffset to
Chris Lattner [Thu, 29 Jul 2010 17:40:35 +0000 (17:40 +0000)]
rename Get8ByteTypeAtOffset -> GetINTEGERTypeAtOffset to
make it clear that this function should only return a type
that the codegen will classify the same as an INTEGER type.

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

14 years agohandle a case where we could access off the end of a function
Chris Lattner [Thu, 29 Jul 2010 17:34:39 +0000 (17:34 +0000)]
handle a case where we could access off the end of a function
that Eli pointed out, rdar://8249586

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

14 years agoin release mode, irbuilder doesn't add names to instructions,
Chris Lattner [Thu, 29 Jul 2010 17:14:05 +0000 (17:14 +0000)]
in release mode, irbuilder doesn't add names to instructions,
this will hopefully fix the osuosl clang-i686-darwin10 builder.

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

14 years agofix PR7742 / rdar://8250764, a miscompilation of struct
Chris Lattner [Thu, 29 Jul 2010 17:04:54 +0000 (17:04 +0000)]
fix PR7742 / rdar://8250764, a miscompilation of struct
return where the struct has a base but no fields.  This
was because the x86-64 abi logic was checking the wrong
predicate in one place.

This was introduced in r91874, which was a fix for PR5831,
which lacked a CHECK line, so I verified and added it.

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