]> granicus.if.org Git - clang/log
clang
13 years agoAdd missing include to clang-interpreter example, to make it work on Windows. Patch...
Eli Friedman [Thu, 6 Oct 2011 22:24:13 +0000 (22:24 +0000)]
Add missing include to clang-interpreter example, to make it work on Windows.  Patch by Dean Pavlekovic.

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

13 years ago[driver] Fix test case for Windows due to fallout from r141202+r141205.
Chad Rosier [Thu, 6 Oct 2011 22:05:26 +0000 (22:05 +0000)]
[driver] Fix test case for Windows due to fallout from r141202+r141205.

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

13 years agoRemove DISABLE_ARM_DARWIN_USE_MOVT ifdefs. Radar 9456730.
Bob Wilson [Thu, 6 Oct 2011 21:52:27 +0000 (21:52 +0000)]
Remove DISABLE_ARM_DARWIN_USE_MOVT ifdefs.  Radar 9456730.

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

13 years ago[static analyzer] Fix crash in LiveVariables and Environment::getSVal() when analyzin...
Ted Kremenek [Thu, 6 Oct 2011 20:53:28 +0000 (20:53 +0000)]
[static analyzer] Fix crash in LiveVariables and Environment::getSVal() when analyzing C++ pointer-to-member calls.  Fixes <rdar://problem/10243398>.

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

13 years agoAdd _mm_comige_sd to emmintrin.h, since I apparently forgot to do this in r138769.
Eli Friedman [Thu, 6 Oct 2011 20:31:50 +0000 (20:31 +0000)]
Add _mm_comige_sd to emmintrin.h, since I apparently forgot to do this in r138769.

<rdar://problem/10230751>

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

13 years agoRearrange for readability. No functional change.
Bob Wilson [Thu, 6 Oct 2011 20:27:40 +0000 (20:27 +0000)]
Rearrange for readability.  No functional change.

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

13 years agoAdd a missing check for cortex-a9.
Bob Wilson [Thu, 6 Oct 2011 20:27:38 +0000 (20:27 +0000)]
Add a missing check for cortex-a9.

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

13 years agoCUDA: IR generation support for device stubs
Peter Collingbourne [Thu, 6 Oct 2011 18:51:56 +0000 (18:51 +0000)]
CUDA: IR generation support for device stubs

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

13 years agoobjc++: For atomic properties of c++ class objec typet, appropriate
Fariborz Jahanian [Thu, 6 Oct 2011 18:38:18 +0000 (18:38 +0000)]
objc++: For atomic properties of c++ class objec typet, appropriate
operator= is called. Issue a warning for non-trivial case until
runtime support is provided. // rdar://6137845

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

13 years agoCUDA: add -fcuda-is-device flag
Peter Collingbourne [Thu, 6 Oct 2011 18:29:46 +0000 (18:29 +0000)]
CUDA: add -fcuda-is-device flag

This frontend-only flag is used by the IR generator to determine
whether to filter CUDA declarations for the host or for the device.

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

13 years agoCUDA: IR generation support for kernel call expressions
Peter Collingbourne [Thu, 6 Oct 2011 18:29:37 +0000 (18:29 +0000)]
CUDA: IR generation support for kernel call expressions

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

13 years agoCUDA: set proper calling conventions for PTX
Peter Collingbourne [Thu, 6 Oct 2011 16:49:54 +0000 (16:49 +0000)]
CUDA: set proper calling conventions for PTX

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

13 years ago[libclang] Removed accidental addition of CXCursor_AnnotateAttr.
Erik Verbruggen [Thu, 6 Oct 2011 13:12:18 +0000 (13:12 +0000)]
[libclang] Removed accidental addition of CXCursor_AnnotateAttr.

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

13 years agoAdd the Clang tblgen backends to Clang, and flip the switch to cause
Peter Collingbourne [Thu, 6 Oct 2011 13:03:08 +0000 (13:03 +0000)]
Add the Clang tblgen backends to Clang, and flip the switch to cause
the build systems to use clang-tblgen.

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

13 years ago[libclang] Fix symbol export for clang_Range_isNull so MSVC won't complain.
Erik Verbruggen [Thu, 6 Oct 2011 12:11:57 +0000 (12:11 +0000)]
[libclang] Fix symbol export for clang_Range_isNull so MSVC won't complain.

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

13 years agoFixed GCC (C90) and Clang warnings.
Erik Verbruggen [Thu, 6 Oct 2011 11:38:08 +0000 (11:38 +0000)]
Fixed GCC (C90) and Clang warnings.

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

13 years agoPR11067: A definition of a constexpr static variable doesn't need an initializer...
Richard Smith [Thu, 6 Oct 2011 09:21:12 +0000 (09:21 +0000)]
PR11067: A definition of a constexpr static variable doesn't need an initializer if the in-class declaration had one. Such a declaration must be initialized by a constant expression.

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

13 years agoAdded CXAvailability_NotAccessible to indicate that a declaration is available, but...
Erik Verbruggen [Thu, 6 Oct 2011 07:27:49 +0000 (07:27 +0000)]
Added CXAvailability_NotAccessible to indicate that a declaration is available, but not accessible from the current code completion context.

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

13 years ago[libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
Argyrios Kyrtzidis [Thu, 6 Oct 2011 07:00:54 +0000 (07:00 +0000)]
[libclang] Introduce clang_findReferencesInFile which accepts a cursor, a file,
and a callback and finds all identifier references of the cursor in the file.

rdar://7948304

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

13 years ago[libclang] Move the bulk of clang_getOverriddenCursors into
Argyrios Kyrtzidis [Thu, 6 Oct 2011 07:00:46 +0000 (07:00 +0000)]
[libclang] Move the bulk of clang_getOverriddenCursors into
a cxcursor::getOverriddenCursors C++ function, because SmallVectors
are groovier that malloc'ing buffers.

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

13 years agoUse a sidetable in ASTContext for ParmVarDecls whose index exceeds the 8 bits reserve...
Ted Kremenek [Thu, 6 Oct 2011 05:00:56 +0000 (05:00 +0000)]
Use a sidetable in ASTContext for ParmVarDecls whose index exceeds the 8 bits reserved for that value in VarDecl.  Fixes PR 10538.

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

13 years agoHoist truncation checking for ParmVarDeclBitfields::ParameterIndex into its own helpe...
Ted Kremenek [Thu, 6 Oct 2011 04:19:35 +0000 (04:19 +0000)]
Hoist truncation checking for ParmVarDeclBitfields::ParameterIndex into its own helper method.  No functionality change.

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

13 years agoOpenCL: add a non-standard extension, cl_clang_storage_class_specifiers,
Peter Collingbourne [Thu, 6 Oct 2011 03:01:00 +0000 (03:01 +0000)]
OpenCL: add a non-standard extension, cl_clang_storage_class_specifiers,
which enables support for C99 storage-class specifiers.

This extension is intended to be used by implementations to implement
OpenCL C built-in functions.

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

13 years agoOpenCL: disallow '#pragma OPENCL EXTENSION all : enable', per OpenCL 1.1 9.1
Peter Collingbourne [Thu, 6 Oct 2011 03:00:50 +0000 (03:00 +0000)]
OpenCL: disallow '#pragma OPENCL EXTENSION all : enable', per OpenCL 1.1 9.1

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

13 years agoAdd -Wlanguage-extension-token option for ext_token_used warning.
Ivan Krasin [Thu, 6 Oct 2011 02:46:34 +0000 (02:46 +0000)]
Add -Wlanguage-extension-token option for ext_token_used warning.

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

13 years agoClang-side build system infrastructure for multiple tblgens.
Peter Collingbourne [Thu, 6 Oct 2011 01:52:10 +0000 (01:52 +0000)]
Clang-side build system infrastructure for multiple tblgens.

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

13 years ago[analyzer] Remove the dependency on CheckerContext::getStmt() as well as the method...
Anna Zaks [Thu, 6 Oct 2011 00:43:15 +0000 (00:43 +0000)]
[analyzer] Remove the dependency on CheckerContext::getStmt() as well as the method itself.

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

13 years agoWhen constructing debug information for synthesized variables for the
Eric Christopher [Thu, 6 Oct 2011 00:31:18 +0000 (00:31 +0000)]
When constructing debug information for synthesized variables for the
non-fragile ABI we may not be able to lay out the type and the debugger
would ignore us even if we did put in the offset. Go ahead and just
put any value there and don't look up the offset since it may not exist.

rdar://10210157

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

13 years agoReformat comment.
Eric Christopher [Thu, 6 Oct 2011 00:30:52 +0000 (00:30 +0000)]
Reformat comment.

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

13 years agoFix major regression in RetainCountChecker. DefaultSummaries were not being used...
Ted Kremenek [Wed, 5 Oct 2011 23:54:29 +0000 (23:54 +0000)]
Fix major regression in RetainCountChecker.  DefaultSummaries were not being used when they were meant to be.  Fixes <rdar://problem/10241614>.

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

13 years ago[analyzer] Remove the last dependency on CheckerContext::getNodeBuilder() as well...
Anna Zaks [Wed, 5 Oct 2011 23:44:11 +0000 (23:44 +0000)]
[analyzer] Remove the last dependency on CheckerContext::getNodeBuilder() as well as the method itself.

Checkers should not directly access NodeBuilder, nodes can be created by calling the CheckerContext's generateNode() methods.

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

13 years ago[analyzer] OSAtomicChecker implements evalCall in a very invasive way - it essentiall...
Anna Zaks [Wed, 5 Oct 2011 23:37:30 +0000 (23:37 +0000)]
[analyzer] OSAtomicChecker implements evalCall in a very invasive way - it essentially simulates inlining of compareAndSwap() by means of setting the NodeBuilder flags and calling ExprEngine directly.

This commit introduces a new callback just for this checker to unblock checker API cleanup.

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

13 years agoDocument ObjCMethodDecl::setMethodParams.
Argyrios Kyrtzidis [Wed, 5 Oct 2011 21:34:09 +0000 (21:34 +0000)]
Document ObjCMethodDecl::setMethodParams.

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

13 years agoFix crash when using archaic protocol, rdar://10238337
Argyrios Kyrtzidis [Wed, 5 Oct 2011 21:28:06 +0000 (21:28 +0000)]
Fix crash when using archaic protocol, rdar://10238337

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

13 years agoDriver & AST: Implement support for -fpack-struct and -fpack-struct= command
Daniel Dunbar [Wed, 5 Oct 2011 21:04:55 +0000 (21:04 +0000)]
Driver & AST: Implement support for -fpack-struct and -fpack-struct= command
line options.
 - <rdar://problem/10120602>, PR9631

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

13 years agoUse APFloat::toString to print APFloats more precisely in the AST printer. Patch...
Eli Friedman [Wed, 5 Oct 2011 20:32:03 +0000 (20:32 +0000)]
Use APFloat::toString to print APFloats more precisely in the AST printer.  Patch by Olaf Krzikalla.

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

13 years ago[driver] For consistency, handle all shell special characters handled by the
Chad Rosier [Wed, 5 Oct 2011 20:09:11 +0000 (20:09 +0000)]
[driver] For consistency, handle all shell special characters handled by the
quoting code.

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

13 years ago[driver] The -v option doesn't quoted the command line arguments for historical
Chad Rosier [Wed, 5 Oct 2011 19:51:41 +0000 (19:51 +0000)]
[driver] The -v option doesn't quoted the command line arguments for historical
reasons.  However, it does seems practical to quote strings that need it.
rdar://10221951

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

13 years agoFix the rewriter, rdar://10234024.
Argyrios Kyrtzidis [Wed, 5 Oct 2011 19:37:56 +0000 (19:37 +0000)]
Fix the rewriter, rdar://10234024.

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

13 years agoExpose more statement, expression, and declaration kinds in libclang,
Douglas Gregor [Wed, 5 Oct 2011 19:00:14 +0000 (19:00 +0000)]
Expose more statement, expression, and declaration kinds in libclang,
from Manuel Holtgrewe!

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

13 years agoPTX: Set proper calling conventions for PTX in OpenCL mode.
Justin Holewinski [Wed, 5 Oct 2011 17:58:44 +0000 (17:58 +0000)]
PTX: Set proper calling conventions for PTX in OpenCL mode.

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

13 years agoSeriously ugly hack, part 2
Douglas Gregor [Wed, 5 Oct 2011 14:59:36 +0000 (14:59 +0000)]
Seriously ugly hack, part 2

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

13 years agoSeriously ugly hack to try to get the Windows builders back online
Douglas Gregor [Wed, 5 Oct 2011 14:58:46 +0000 (14:58 +0000)]
Seriously ugly hack to try to get the Windows builders back online

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

13 years agoIntroduce a simple file-based locking protocol for on-demand module
Douglas Gregor [Wed, 5 Oct 2011 14:53:30 +0000 (14:53 +0000)]
Introduce a simple file-based locking protocol for on-demand module
creation, so that only a single Clang instance will rebuild a given
module at once (and the others will wait).

We still don't clean up the lock files when we crash, which is a
rather unfortunate problem. I'll handle that next, and there is
certainly a *lot* of room for further improvements.

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

13 years agoAdded a flag to identify resolved overloaded function references.
Abramo Bagnara [Wed, 5 Oct 2011 07:56:41 +0000 (07:56 +0000)]
Added a flag to identify resolved overloaded function references.

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

13 years agoRefactor the analysis of C++ cast expressions so that even
John McCall [Wed, 5 Oct 2011 07:41:44 +0000 (07:41 +0000)]
Refactor the analysis of C++ cast expressions so that even
C-style and functional casts are built in SemaCXXCast.cpp.
Introduce a helper class to encapsulate most of the random
state being passed around, at least one level down.

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

13 years agoUse the InstalledDir correctly, and test it correctly as well. =/ Should
Chandler Carruth [Wed, 5 Oct 2011 06:38:03 +0000 (06:38 +0000)]
Use the InstalledDir correctly, and test it correctly as well. =/ Should
have noticed this previously, sorry.

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

13 years agoFix doxygen comment.
Eric Christopher [Wed, 5 Oct 2011 06:00:51 +0000 (06:00 +0000)]
Fix doxygen comment.

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

13 years agoTeach Clang to cope with GCC installations that have unusual patch
Chandler Carruth [Wed, 5 Oct 2011 03:09:51 +0000 (03:09 +0000)]
Teach Clang to cope with GCC installations that have unusual patch
"versions". Currently, these are just dropped on the floor, A concrete
version number will always win out.

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

13 years agoImplement the feature I was originally driving toward when I started
Chandler Carruth [Wed, 5 Oct 2011 01:01:57 +0000 (01:01 +0000)]
Implement the feature I was originally driving toward when I started
this saga. Teach the driver to detect a GCC installed along side Clang
using the existing InstalledDir support in the Clang driver. This makes
a lot of Clang's behavior more automatic when it is installed along side
GCC.

Also include the first test cases (more to come, honest) which test both
the install directory behavior, and the version sorting behavior to show
that we're actually searching for the best candidate GCC installation
now.

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

13 years agoc: assignment/init of a function pointer whose function(s)
Fariborz Jahanian [Wed, 5 Oct 2011 00:05:34 +0000 (00:05 +0000)]
c: assignment/init of a function pointer whose function(s)
return to one which does not return (has noreturn attribute)
should warn as it is an unsafe assignment. // rdar://10095762
c++ already handles this. This is the c version.

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

13 years agoDon't allow an rvalue reference to bind to the result of a calling a
Douglas Gregor [Tue, 4 Oct 2011 23:59:32 +0000 (23:59 +0000)]
Don't allow an rvalue reference to bind to the result of a calling a
conversion function whose result type is an lvalue reference. The
initialization code already handled this properly, but overload
resolution was allowing the binding. Fixes PR11003 /
<rdar://problem/10233078>.

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

13 years ago[analyzer] Removing more references to CheckerContext::getNodeBuilder(): ask CheckerC...
Anna Zaks [Tue, 4 Oct 2011 23:29:16 +0000 (23:29 +0000)]
[analyzer] Removing more references to CheckerContext::getNodeBuilder(): ask CheckerContext to generate the nodes.

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

13 years agoHoist the other messy part out of an inner loop and into a helper
Chandler Carruth [Tue, 4 Oct 2011 23:17:12 +0000 (23:17 +0000)]
Hoist the other messy part out of an inner loop and into a helper
function, cleaning up along the way.

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

13 years ago[analyzer] Refactor node generation to use less code.
Anna Zaks [Tue, 4 Oct 2011 23:12:04 +0000 (23:12 +0000)]
[analyzer] Refactor node generation to use less code.

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

13 years agoHoist the first chunk of this into a helper function. No functionality
Chandler Carruth [Tue, 4 Oct 2011 22:58:04 +0000 (22:58 +0000)]
Hoist the first chunk of this into a helper function. No functionality
change.

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

13 years ago[driver] Improve r141053 by only emitting the warning if the original input
Chad Rosier [Tue, 4 Oct 2011 22:35:48 +0000 (22:35 +0000)]
[driver] Improve r141053 by only emitting the warning if the original input
was assembly.  Otherwise, something like -save-temps causes the integrated
assembler to warn.

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

13 years agoFix Windows+MinGW which introduces noise into path separators.
Chandler Carruth [Tue, 4 Oct 2011 22:22:13 +0000 (22:22 +0000)]
Fix Windows+MinGW which introduces noise into path separators.

There should be a better solution to this; Michael and I are continuing
to discuss exactly what it should be. The one solution I'm very
uncomfortable with is making the FileCheck tests use a regex for each
path separator.

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

13 years agoNow that multiple prefixes are much cheaper to search for GCC
Chandler Carruth [Tue, 4 Oct 2011 21:22:42 +0000 (21:22 +0000)]
Now that multiple prefixes are much cheaper to search for GCC
installations, support them when installed directly under the system
root ('/lib/gcc/...' essentially).

With this, Clang can correctly detect and use a cross-compiling GCC
installation within a system root and use it.

Again, test cases will be coming in later commits, as I'm going to write
a few test cases that exercise nearly all of this logic.

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

13 years agoRework the search for a GCC installation still further. This combines
Chandler Carruth [Tue, 4 Oct 2011 21:22:33 +0000 (21:22 +0000)]
Rework the search for a GCC installation still further. This combines
two fundamental changes, as they ended up being interrelated.

The first is to walk from the root down through the filesystem so that
we prune subtrees which do not exist early. This greatly reduces the
filesystem traffic of this routine. We store the "best" GCC version we
encounter, and look at all of the GCC installations available.

Also, we look through GCC versions by scanning the directory rather than
using a hard-coded list of versions. This has several benefits. It makes
it much more efficient to locate a GCC installation even in the presence
of a large number of different options by simply reading the directory
once. It also future-proofs us as new GCC versions are released and
installed. We no longer have a hard coded list of version numbers, and
won't need to manually updated it. We can still filter out known-bad
versions as needed. Currently I've left in filtering for all GCC
installations prior to 4.1.1, as that was the first one supported
previously.

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

13 years agoBasic/Diagnostics: Apparently, #pragma ... diagnostic is intended to override
Daniel Dunbar [Tue, 4 Oct 2011 21:17:24 +0000 (21:17 +0000)]
Basic/Diagnostics: Apparently, #pragma ... diagnostic is intended to override
the command line options (at least according to GCC's documentation). GCC 4.2
didn't appear to actually do this, but it seems like that has been fixed in
later release, so we will follow the docs.

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

13 years ago[analyzer] Removing references to CheckerContext::getNodeBuilder(): checkers can...
Anna Zaks [Tue, 4 Oct 2011 20:43:05 +0000 (20:43 +0000)]
[analyzer] Removing references to CheckerContext::getNodeBuilder(): checkers can obtain block count directly from the Context.

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

13 years agoRemove a nonsensical bit of code from InitListChecker::getStructuredSubobjectInit...
Eli Friedman [Tue, 4 Oct 2011 20:31:48 +0000 (20:31 +0000)]
Remove a nonsensical bit of code from InitListChecker::getStructuredSubobjectInit which was increasing the reserved size for an init list past its maximum possible size. Fixes PR11056, a case where we were reserving a bunch of memory for arrays that was never actually used.

(No testcase because I don't think we have any way to actually write a testcase for this; the chosen value of NumElements has no effects on anything other than performance and memory usage.)

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

13 years agoobjc: Turn diagnostic on property type mismatch in
Fariborz Jahanian [Tue, 4 Oct 2011 18:44:26 +0000 (18:44 +0000)]
objc: Turn diagnostic on property type mismatch in
continuation class into warning. // rdar://10231514

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

13 years ago[analyzer] Remove unused methods, add comments to others.
Anna Zaks [Tue, 4 Oct 2011 18:34:40 +0000 (18:34 +0000)]
[analyzer] Remove unused methods, add comments to others.

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

13 years agoPlace diagnostic warn_atomic_property_rule under a -W flag. Fixes <rdar://problem...
Ted Kremenek [Tue, 4 Oct 2011 15:53:53 +0000 (15:53 +0000)]
Place diagnostic warn_atomic_property_rule under a -W flag.  Fixes <rdar://problem/10230631>.

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

13 years agoPlace diagnostic warn_ownin_getter_rule under a -W flag. Fixes <rdar://problem/10230...
Ted Kremenek [Tue, 4 Oct 2011 15:50:00 +0000 (15:50 +0000)]
Place diagnostic warn_ownin_getter_rule under a -W flag.  Fixes <rdar://problem/10230626>.

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

13 years agoPlace diagnostic ext_predef_outside_function under a -W flag. Fixes <rdar://problem...
Ted Kremenek [Tue, 4 Oct 2011 15:41:53 +0000 (15:41 +0000)]
Place diagnostic ext_predef_outside_function under a -W flag.  Fixes <rdar://problem/10226192>.

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

13 years agoFix include path detection on Fedora 15 with GCC 4.6.1. Patch by Arthur Haas.
Justin Holewinski [Tue, 4 Oct 2011 15:35:52 +0000 (15:35 +0000)]
Fix include path detection on Fedora 15 with GCC 4.6.1.  Patch by Arthur Haas.

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

13 years agoAdd bitmaps for strong / weak ivar layout (GNUstep runtime).
David Chisnall [Tue, 4 Oct 2011 15:35:30 +0000 (15:35 +0000)]
Add bitmaps for strong / weak ivar layout (GNUstep runtime).

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

13 years agoPlace warning warn_drv_no_debug_w_integrated_as under a -W flag.
Ted Kremenek [Tue, 4 Oct 2011 14:48:42 +0000 (14:48 +0000)]
Place warning warn_drv_no_debug_w_integrated_as under a -W flag.

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

13 years agoRevert r141060. We should NEVER add new warnings that aren't guarded by flag.
Ted Kremenek [Tue, 4 Oct 2011 14:48:38 +0000 (14:48 +0000)]
Revert r141060.  We should NEVER add new warnings that aren't guarded by flag.

This reverts commit 5383d065241b18e84232bc50d81523f2058ea62b.

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

13 years agoAdd a comment explaining that I have a better plan for implementing the
Chandler Carruth [Tue, 4 Oct 2011 09:58:21 +0000 (09:58 +0000)]
Add a comment explaining that I have a better plan for implementing the
GCC installation search that requires fewer filesystem operations.
Planning to implement that next as the current approcah while thorough
(and so far looks correct) does a very unfortunate number of filesystem
operations.

I'm motivated to fix this in no small part because I would like to
support a much larger space of triples and GCC versions, which would
explode the current algorithm.

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

13 years agoInvert the loop for detecting installed GCC trees. This make the loop
Chandler Carruth [Tue, 4 Oct 2011 09:47:17 +0000 (09:47 +0000)]
Invert the loop for detecting installed GCC trees. This make the loop
find the newest GCC available, among other goodness. It makes the entire
system much less prone to error from prefixes and/or system roots
pruning early the set of triples and GCC versions available.

Also, improve some comments and simplify the forms of some of the loops.

This causes the driver to stat directories more often than is strictly
necessary, but the alternatives which I looked at that still
accomplished this goal needed quite a bit more code and were likely not
much faster.

Test cases for this, now that our behavior here is significantly more
principled and predictable, should come tomorrow as I walk back through
VMs looking for edge cases that are missed after this.

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

13 years agoFuse the two halves of the GCC installation detection. This is
Chandler Carruth [Tue, 4 Oct 2011 08:32:14 +0000 (08:32 +0000)]
Fuse the two halves of the GCC installation detection. This is
significantly cleaner (IMO) and more principled. We now walk down each
layer of the directory hierarchy searching for the GCC install. This
change does in fact introduce a significant behavior change in theory,
although in practice I don't know of any distro that will be impacted by
it negatively, and Debian may (untested) get slightly better through it.

Specifically, the logic now looks exhaustively for patterns such as:

  /usr/lib/<triple>/gcc/<triple>

Previously, this would only be selected if there was *also*
a '/usr/lib/gcc/<triple>' directory, or if '<triple>' were the excat
DefaultHostTriple in the driver.

There is a 4-deep nested loop here, but it doesn't do terribly many
filesystem operations, as we skip at each layer of that layer's
directory doesn't exist.

There remains a significant FIXME in this logic: it would be much better
to first build up a set of candidate components for each of the four
layers with a bottom-up pruning such as this, but then select the final
installation using a top-down algorithm in order to find the newest GCC
installation available, regardless of which particular path leads to it.

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

13 years agoMark calls to objc_retainBlock that don't result from casts
John McCall [Tue, 4 Oct 2011 06:23:45 +0000 (06:23 +0000)]
Mark calls to objc_retainBlock that don't result from casts
to id so that we can still optimize them appropriately.

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

13 years agoRip out flags for controlling C++ "production mode" separately.
Bob Wilson [Tue, 4 Oct 2011 05:34:14 +0000 (05:34 +0000)]
Rip out flags for controlling C++ "production mode" separately.

This is old leftover cruft from the days when C++ was not yet ready
for prime time.

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

13 years agoSpecify -ccc-clang-archs for le32 targets which may not be supported by default.
Bob Wilson [Tue, 4 Oct 2011 05:18:19 +0000 (05:18 +0000)]
Specify -ccc-clang-archs for le32 targets which may not be supported by default.

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

13 years agoImprove location fidelity of objc decls.
Argyrios Kyrtzidis [Tue, 4 Oct 2011 04:48:02 +0000 (04:48 +0000)]
Improve location fidelity of objc decls.

-Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl.
-Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the
 class name, not the location of '@'.

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

13 years agoUpdate testcase for r141053+r141055.
Chad Rosier [Tue, 4 Oct 2011 04:42:31 +0000 (04:42 +0000)]
Update testcase for r141053+r141055.

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

13 years agoFactor the data apart from the logic of locating various GCC
Chandler Carruth [Tue, 4 Oct 2011 02:28:41 +0000 (02:28 +0000)]
Factor the data apart from the logic of locating various GCC
installations. This first selects a set of prefixes and a set of
compatible triples for the current architecture. Once selected, we drive
the search with a single piece of code.

This code isn't particularly efficient as it stands, but its only
executed once. I'm hoping as I clean up the users of this information,
it will also slowly become both cleaner and more efficient.

This also changes the behavior slightly. Previously, we had an ad-hoc
list of prefixes and triples, and we only looked for some triples
beneath specific prefixes and vice versa. This has led to lots of
one-off patches to support triple X, or support lib dir Y. Even without
going to a fully universal driver, we can do better here. This patch
makes us always look first in either 'lib32' or 'lib64' on 32- or 64-bit
hosts (resp.). However, we *always* look in 'lib'.

Currently I have one lingering problem with this strategy. We might find
a newer or better GCC version under a different (but equally compatible)
triple. Fundamentally, this loop needs to be fused with the one below.
That's my next patch.

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

13 years ago[driver] Improve r141053 by only emitting the warning if the original input
Chad Rosier [Tue, 4 Oct 2011 01:53:36 +0000 (01:53 +0000)]
[driver] Improve r141053 by only emitting the warning if the original input
was assembly.  Otherwise, something like -save-temps causes the integrated
assembler to warn.

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

13 years ago[driver] Emit a warning if the user has requested debug information and we're
Chad Rosier [Tue, 4 Oct 2011 01:01:30 +0000 (01:01 +0000)]
[driver] Emit a warning if the user has requested debug information and we're
using the integrated assembler.
rdar://10216353

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

13 years agoWhen build a module on demand, run the module-building job on a
Douglas Gregor [Tue, 4 Oct 2011 00:21:21 +0000 (00:21 +0000)]
When build a module on demand, run the module-building job on a
separate thread with the "suitably large" stack, so we don't blow the
stack when building modules recursively.

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

13 years agoMake sure SourceManager::getFileIDLoaded doesn't hang in release build because of...
Argyrios Kyrtzidis [Mon, 3 Oct 2011 23:43:01 +0000 (23:43 +0000)]
Make sure SourceManager::getFileIDLoaded doesn't hang in release build because of invalid passed parameter.
rdar://10210140

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

13 years ago[analyzer] Remove redundant state (AnalysisContext pointer for every BinaryOperator...
Anna Zaks [Mon, 3 Oct 2011 23:07:13 +0000 (23:07 +0000)]
[analyzer] Remove redundant state (AnalysisContext pointer for every BinaryOperator tracked) from IdempotentOperationChecker.

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

13 years agoobjc arc: Suppress certain arc diagnostics on unavailable
Fariborz Jahanian [Mon, 3 Oct 2011 22:11:57 +0000 (22:11 +0000)]
objc arc: Suppress certain arc diagnostics on unavailable
functions. // rdar://10186536

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

13 years ago[analyzer] In UndefBranchChecker, use a node generator which does not create an edge...
Anna Zaks [Mon, 3 Oct 2011 21:55:56 +0000 (21:55 +0000)]
[analyzer] In UndefBranchChecker, use a node generator which does not create an edge/branching. (ExprEngine should be in charge of generating edges. The checkers should examine the condition and generate PostCondition node if needed.)

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

13 years ago[analyzer] Cleanup in UndefBranchChecker:
Anna Zaks [Mon, 3 Oct 2011 21:16:32 +0000 (21:16 +0000)]
[analyzer] Cleanup in UndefBranchChecker:
  - Remove unused FindUndefExpr::ProgramStateManager.
  - The Condition parameter of the callback is the terminator of the block, no need to retrieve it again.

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

13 years agoFixed source range for template implicit instantiations.
Abramo Bagnara [Mon, 3 Oct 2011 20:34:03 +0000 (20:34 +0000)]
Fixed source range for template implicit instantiations.

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

13 years agoFixed exapnsion range for # and ##.
Abramo Bagnara [Mon, 3 Oct 2011 18:39:03 +0000 (18:39 +0000)]
Fixed exapnsion range for # and ##.

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

13 years agoRefactor the detection of a GCC installation into a helper class. This
Chandler Carruth [Mon, 3 Oct 2011 18:16:54 +0000 (18:16 +0000)]
Refactor the detection of a GCC installation into a helper class. This
is designed to allow the detection to record more rich information about
the installation than just a single path.

Mostly, the functionality remains the same. This is primarily
a factoring change. However, the new factoring immediately fixes one
issue where on ubuntu we didn't walk up enough layers to reach the
parent lib path. I'll have a test tree for that once I finish making the
Ubuntu tree work reasonably.

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

13 years agoobjc++: Accessing explicit property of reference type need
Fariborz Jahanian [Mon, 3 Oct 2011 17:58:21 +0000 (17:58 +0000)]
objc++: Accessing explicit property of reference type need
not bind to a temporary. Fixes //rdar://10188258

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

13 years agoPTX: Add some basic support for OpenCL address spaces
Justin Holewinski [Mon, 3 Oct 2011 17:28:37 +0000 (17:28 +0000)]
PTX: Add some basic support for OpenCL address spaces

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

13 years agoDon't crash when trying to emit too many fixits. Also, keep some constants in
Matt Beaumont-Gay [Mon, 3 Oct 2011 16:26:56 +0000 (16:26 +0000)]
Don't crash when trying to emit too many fixits. Also, keep some constants in
sync between DiagnosticsEngine and PartialDiagnostic.

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

13 years agoPropagate __attribute__((returns_twice)) from C to IL.
Rafael Espindola [Mon, 3 Oct 2011 14:59:42 +0000 (14:59 +0000)]
Propagate __attribute__((returns_twice)) from C to IL.

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

13 years agoTest a multilib setup on a 64-bit host. This is the far more common
Chandler Carruth [Mon, 3 Oct 2011 09:08:26 +0000 (09:08 +0000)]
Test a multilib setup on a 64-bit host. This is the far more common
configuration, although the test still stubs out more directories than
are necessary or common in order to exercise all of the lookup paths
observed with upstream GCC.

This finishes testing the distribution-independent and
GCC-installation-independent parts of the library path search logic.
More testing is still needed for the triple detection, GCC-installation
detection, and handling distributions with unusual configurations.

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

13 years agoEnable generic multilib support on 32bit hosts. Previously this was only
Chandler Carruth [Mon, 3 Oct 2011 09:00:50 +0000 (09:00 +0000)]
Enable generic multilib support on 32bit hosts. Previously this was only
enabled for debian hosts, which is quite odd. I think all restriction on
when Clang attempts to use a multilib installation should go away. Clang
is fundamentally a cross compiler. It behaves more like GCC when built
as a cross compiler, and so it should just use multilib installs when
they are present on the system. However, there is a very specific
exemption for Exherbo, which I can't test on, so I'm leaving that in
place.

With this, check in a generic test tree for multilib on a 32-bit host.
This stubs out many directories that most distributions don't use but
that uptsream GCC supports. This is intended to be an agnostic test that
the driver behaves properly compared with the GCC driver it aims for
compatibility with.

Also, fix a bug in the driver that this testing exposed (see!) where it
was incorrectly testing the target architecture rather than the host
architecture.

If anyone is having trouble with the tree-structure stubs I'm creating
to test this, let me know and I can revisit the design. I chose this
over (for example) a tar-ball in order to make tests run faster at the
small, hopefully amortized VCS cost.

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

13 years agoRelax an assertion here a bit. This doesn't really matter, as we won't
Chandler Carruth [Mon, 3 Oct 2011 08:16:09 +0000 (08:16 +0000)]
Relax an assertion here a bit. This doesn't really matter, as we won't
include *any* path on crtbegin.o unless we actually find such a file via
one of the search paths. We still strictly check the search paths right
after this, so we'll catch any issues there.

The reason for this is that the driver does some normalization of the
path on the actual object file, and this changes the textual format of
the string on Windows. It no longer matches the textual format of the
sysroot flag.

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

13 years agoTest that we include a GCC-triple-prefixed tree. While I don't know of
Chandler Carruth [Mon, 3 Oct 2011 08:09:02 +0000 (08:09 +0000)]
Test that we include a GCC-triple-prefixed tree. While I don't know of
any distros that use this, building a multilib GCC from mainline will
install linker scripts here.

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