]> granicus.if.org Git - clang/log
clang
14 years agoWhen binding a reference to a temporary, it's important that other temporaries create...
Anders Carlsson [Sun, 18 Oct 2009 23:09:21 +0000 (23:09 +0000)]
When binding a reference to a temporary, it's important that other temporaries created as on the RHS are destroyed before emitting the dtor for the temporary.

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

14 years agoFix tyop noticed by Sean Hunt.
Anders Carlsson [Sun, 18 Oct 2009 22:10:32 +0000 (22:10 +0000)]
Fix tyop noticed by Sean Hunt.

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

14 years agoWhen building a cast argument, make sure to bind the result to a temporary.
Anders Carlsson [Sun, 18 Oct 2009 21:20:14 +0000 (21:20 +0000)]
When building a cast argument, make sure to bind the result to a temporary.

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

14 years agoPR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
Daniel Dunbar [Sun, 18 Oct 2009 21:17:35 +0000 (21:17 +0000)]
PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

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

14 years agoConvert temporaries.cpp to using FileCheck.
Anders Carlsson [Sun, 18 Oct 2009 21:11:11 +0000 (21:11 +0000)]
Convert temporaries.cpp to using FileCheck.

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

14 years agoAdd test for OpenCL vector initializer codegen
Nate Begeman [Sun, 18 Oct 2009 21:04:35 +0000 (21:04 +0000)]
Add test for OpenCL vector initializer codegen

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

14 years agoRename temp-1.cpp to temporaries.cpp.
Anders Carlsson [Sun, 18 Oct 2009 20:58:38 +0000 (20:58 +0000)]
Rename temp-1.cpp to temporaries.cpp.

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

14 years agoTwinify CGObjCMac, this simplifies the code and should reduce std::string
Daniel Dunbar [Sun, 18 Oct 2009 20:48:59 +0000 (20:48 +0000)]
Twinify CGObjCMac, this simplifies the code and should reduce std::string
trashing.

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

14 years agoUse CK_BitCast for member function pointer casts. Fixes PR5138.
Anders Carlsson [Sun, 18 Oct 2009 20:31:03 +0000 (20:31 +0000)]
Use CK_BitCast for member function pointer casts. Fixes PR5138.

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

14 years agoMove misc clients to IdentifierInfo StringRef API.
Daniel Dunbar [Sun, 18 Oct 2009 20:26:27 +0000 (20:26 +0000)]
Move misc clients to IdentifierInfo StringRef API.
 - strcmp -> ==
 - OS.write(II->getName() ...) -> OS << II->getNameStr()
 - Avoid std::string concatenation
 - Use getNameStr().str() when an std::string is really needed.

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

14 years agoMove clients to use IdentifierInfo::getNameStart() instead of getName()
Daniel Dunbar [Sun, 18 Oct 2009 20:26:12 +0000 (20:26 +0000)]
Move clients to use IdentifierInfo::getNameStart() instead of getName()

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

14 years agoAdd ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.
Daniel Dunbar [Sun, 18 Oct 2009 20:25:46 +0000 (20:25 +0000)]
Add ObjCCategoryImplDecl::getName() -> StringRef, and a FIXME.

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

14 years agoSupport IRgen of OpenCL vector initializers, ensuring the resulting IR is in a
Nate Begeman [Sun, 18 Oct 2009 20:10:40 +0000 (20:10 +0000)]
Support IRgen of OpenCL vector initializers, ensuring the resulting IR is in a
form that LLVM code generators can turn into efficient code.  For example,
int4 a, b, c;
a = (int4)(b.yzw, a.x)

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

14 years agoTry to unbreak MSVC build.
Benjamin Kramer [Sun, 18 Oct 2009 19:59:44 +0000 (19:59 +0000)]
Try to unbreak MSVC build.

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

14 years agoIt's OK for a pure virtual function to override another pure virtual function. Fixes...
Anders Carlsson [Sun, 18 Oct 2009 19:34:08 +0000 (19:34 +0000)]
It's OK for a pure virtual function to override another pure virtual function. Fixes PR5222.

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

14 years agoAdd FloatingCast to getCastKindName's list.
Benjamin Kramer [Sun, 18 Oct 2009 19:02:15 +0000 (19:02 +0000)]
Add FloatingCast to getCastKindName's list.

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

14 years agonon-POD members => make it a class (also silences MSVC warnings)
Benjamin Kramer [Sun, 18 Oct 2009 18:56:13 +0000 (18:56 +0000)]
non-POD members => make it a class (also silences MSVC warnings)

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

14 years agoAdd some more cast kinds.
Anders Carlsson [Sun, 18 Oct 2009 18:12:03 +0000 (18:12 +0000)]
Add some more cast kinds.

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

14 years agoCIndex: fix typo.
Benjamin Kramer [Sun, 18 Oct 2009 16:52:07 +0000 (16:52 +0000)]
CIndex: fix typo.

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

14 years agoMissed a paren.
Benjamin Kramer [Sun, 18 Oct 2009 16:20:58 +0000 (16:20 +0000)]
Missed a paren.

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

14 years agoCIndex: add a (untested) WIN32 codepath to get ClangPath.
Benjamin Kramer [Sun, 18 Oct 2009 16:13:48 +0000 (16:13 +0000)]
CIndex: add a (untested) WIN32 codepath to get ClangPath.

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

14 years agoCIndex: compute ClangPath lazily.
Benjamin Kramer [Sun, 18 Oct 2009 16:11:04 +0000 (16:11 +0000)]
CIndex: compute ClangPath lazily.

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

14 years agoadd support for codegening CXXZeroInitValueExprs
Nuno Lopes [Sun, 18 Oct 2009 15:18:11 +0000 (15:18 +0000)]
add support for codegening CXXZeroInitValueExprs

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

14 years agoIgnore all the test output directories that lit generates.
Sebastian Redl [Sun, 18 Oct 2009 14:56:09 +0000 (14:56 +0000)]
Ignore all the test output directories that lit generates.

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

14 years agoThe AuroraUX toolchain has conflicting wchar_t between the system stdlib.h header...
Edward O'Callaghan [Sun, 18 Oct 2009 13:33:59 +0000 (13:33 +0000)]
The AuroraUX toolchain has conflicting wchar_t between the system stdlib.h header and the clang stddef.h header where clang was defining as int where we use long.

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

14 years agoUse sys::Path::eraseFromDisk instead of unlink as suggested by Chris.
Benjamin Kramer [Sun, 18 Oct 2009 11:34:14 +0000 (11:34 +0000)]
Use sys::Path::eraseFromDisk instead of unlink as suggested by Chris.

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

14 years agoCIndex: replace fork/exec with our portable ExecuteAndWait wrapper.
Benjamin Kramer [Sun, 18 Oct 2009 11:19:36 +0000 (11:19 +0000)]
CIndex: replace fork/exec with our portable ExecuteAndWait wrapper.

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

14 years agoCIndex: avoid a dangling pointer issue.
Benjamin Kramer [Sun, 18 Oct 2009 11:10:55 +0000 (11:10 +0000)]
CIndex: avoid a dangling pointer issue.

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

14 years agoWhen performing template-substitution into a type, don't just replace the
John McCall [Sun, 18 Oct 2009 09:09:24 +0000 (09:09 +0000)]
When performing template-substitution into a type, don't just replace the
TemplateTypeParmType with the substituted type directly;  instead, replace it
with a SubstTemplateTypeParmType which will note that the type was originally
written as a template type parameter.  This makes it reasonable to preserve
source information even through template substitution.

Also define the new SubstTemplateTypeParmType class, obviously.

For consistency with current behavior, we stringize these types as if they
were the underlying type.  I'm not sure this is the right thing to do.
At any rate, I paled at adding yet another clause to the don't-desugar 'if'
statement, so I extracted a function to do it.  The new function also does
The Right Thing more often, I think:  e.g. if we have a chain of typedefs
leading to a vector type, we will now desugar all but the last one.

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

14 years agouse DenseSet instead of SmallSet.
Zhongxing Xu [Sun, 18 Oct 2009 04:15:47 +0000 (04:15 +0000)]
use DenseSet instead of SmallSet.

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

14 years agoAdd NameDecl::getName() -> StringRef.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:45 +0000 (02:09 +0000)]
Add NameDecl::getName() -> StringRef.

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

14 years agoAdd another two ExtVectorComponent FIXMEs.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:38 +0000 (02:09 +0000)]
Add another two ExtVectorComponent FIXMEs.

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

14 years agoSwitch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:31 +0000 (02:09 +0000)]
Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.
 - Really this should be simplified by the FIXME above, but I'm too deep in DFS.

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

14 years agoSimplify HandleModeAttr.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:24 +0000 (02:09 +0000)]
Simplify HandleModeAttr.

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

14 years agoSimplify HandleFormatAttr.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:17 +0000 (02:09 +0000)]
Simplify HandleFormatAttr.
 - I have this crazy dream that one day someone will invent a miraculous tool so
   that developers, instead of hand optimizing their source code to obscure its
   intent and decrease its maleability, will instead write what they mean, and
   this strange and wonderful tool -- which I imagine would be called something
   fancy sounding like "an optimizing compiler" -- will make their code fast
   *for* them. With all the saved time, developers could maybe even focus on
   making the magic "optimizing compiler" better!!

 - No intended functionality change, all though I expect the universe to mock me
   for snarkiness.

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

14 years agoAdd FIXME... maybe Nate will get bored? :)
Daniel Dunbar [Sun, 18 Oct 2009 02:09:09 +0000 (02:09 +0000)]
Add FIXME... maybe Nate will get bored? :)

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

14 years agoGrammaro.
Daniel Dunbar [Sun, 18 Oct 2009 02:09:02 +0000 (02:09 +0000)]
Grammaro.

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

14 years agoClone the full Type hierarchy into the TypeLoc hierarchy. Normalize
John McCall [Sun, 18 Oct 2009 01:05:36 +0000 (01:05 +0000)]
Clone the full Type hierarchy into the TypeLoc hierarchy.  Normalize
TypeLoc class names to be $(Type classname)Loc.  Rewrite the visitor.
Provide skeleton implementations for all the new TypeLocs.

Handle all cases in PCH.  Handle a few more cases when inserting
location information in SemaType.

It should be extremely straightforward to add new location information
to existing TypeLoc objects now.

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

14 years agoAttempt to unbreak the MSVC build.
Daniel Dunbar [Sat, 17 Oct 2009 23:53:11 +0000 (23:53 +0000)]
Attempt to unbreak the MSVC build.

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

14 years agoSimplify ExtVectorElementExpr::containsDuplicateElements().
Daniel Dunbar [Sat, 17 Oct 2009 23:53:04 +0000 (23:53 +0000)]
Simplify ExtVectorElementExpr::containsDuplicateElements().

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

14 years agoAdd FIXME.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:58 +0000 (23:52 +0000)]
Add FIXME.

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

14 years agoAvoid std::string concatenation.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:50 +0000 (23:52 +0000)]
Avoid std::string concatenation.

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

14 years agoStringRefize some parts of Diagnostic API.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:43 +0000 (23:52 +0000)]
StringRefize some parts of Diagnostic API.

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

14 years agoRemove unused BernsteinHash functions.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:36 +0000 (23:52 +0000)]
Remove unused BernsteinHash functions.

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

14 years agoSwitch to llvm::HashString.
Daniel Dunbar [Sat, 17 Oct 2009 23:52:28 +0000 (23:52 +0000)]
Switch to llvm::HashString.

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

14 years agoadd gentoo x86 2009.1 (gcc 4.3.4) include paths
Nuno Lopes [Sat, 17 Oct 2009 23:11:14 +0000 (23:11 +0000)]
add gentoo x86 2009.1 (gcc 4.3.4) include paths

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

14 years agoFix a crash with qualified member access into a non-type, from Sean Hunt!
Douglas Gregor [Sat, 17 Oct 2009 22:37:54 +0000 (22:37 +0000)]
Fix a crash with qualified member access into a non-type, from Sean Hunt!

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

14 years agoDescribe/link some of the universal driver related work.
Daniel Dunbar [Sat, 17 Oct 2009 22:08:19 +0000 (22:08 +0000)]
Describe/link some of the universal driver related work.

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

14 years agoAdd a "Universal Driver" open project, and web page.
Daniel Dunbar [Sat, 17 Oct 2009 21:50:11 +0000 (21:50 +0000)]
Add a "Universal Driver" open project, and web page.

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

14 years agoWhen type-checking a C++ "new" expression, don't type-check the actual
Douglas Gregor [Sat, 17 Oct 2009 21:40:42 +0000 (21:40 +0000)]
When type-checking a C++ "new" expression, don't type-check the actual
initialization if any of the constructor/initialization arguments are
type-dependent. Fixes PR5224.

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

14 years agoWhen resolving the address of an overloaded function or function template, mark the...
Sebastian Redl [Sat, 17 Oct 2009 21:12:09 +0000 (21:12 +0000)]
When resolving the address of an overloaded function or function template, mark the result as referenced.

The most important effect of this is that function templates only referenced by address expressions now get instantiated. This, in turn, means that Hello World compiles with the Apache stdcxx library even when using endl.

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

14 years agoDon't add implicit casts of explicit address-taking of overloaded functions.
Sebastian Redl [Sat, 17 Oct 2009 20:50:27 +0000 (20:50 +0000)]
Don't add implicit casts of explicit address-taking of overloaded functions.

Taking the address of an overloaded function with an explicit address-of operator wrapped the operator in an implicit cast that added yet another pointer level, leaving us with a corrupted AST, which crashed CodeGen in the test case I've added. Fix this by making FixOverloadedFunctionReference return whether there was an address-of operator and not adding the implicit cast in that case.

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

14 years agoAdd IdentifierTable::CreateIdentifierInfo(StringRef).
Daniel Dunbar [Sat, 17 Oct 2009 20:44:06 +0000 (20:44 +0000)]
Add IdentifierTable::CreateIdentifierInfo(StringRef).

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

14 years agoUse StringExtra's HashString instead of BernsteinHash.
Daniel Dunbar [Sat, 17 Oct 2009 20:43:58 +0000 (20:43 +0000)]
Use StringExtra's HashString instead of BernsteinHash.

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

14 years agoAdd an open project. :)
Daniel Dunbar [Sat, 17 Oct 2009 20:43:50 +0000 (20:43 +0000)]
Add an open project. :)

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

14 years agodaniel really wants this in the testsuite.
Chris Lattner [Sat, 17 Oct 2009 20:37:18 +0000 (20:37 +0000)]
daniel really wants this in the testsuite.

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

14 years agoteach getCorrespondingUnsignedType how to handle vectors of integers,
Chris Lattner [Sat, 17 Oct 2009 20:33:28 +0000 (20:33 +0000)]
teach getCorrespondingUnsignedType how to handle vectors of integers,
fixing PR4838.

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

14 years agoIn some dependent contexts, incomplete array types persist into FinalizeDeclaratorGro...
Sebastian Redl [Sat, 17 Oct 2009 19:37:06 +0000 (19:37 +0000)]
In some dependent contexts, incomplete array types persist into FinalizeDeclaratorGroup. Don't require them to have a complete type. This allows us to compile Hello World with the Apache stdcxx library. If you don't use endl, it even links and runs.

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

14 years agoFix for PR5190, Credit to Zhanyong Wan.
Edward O'Callaghan [Sat, 17 Oct 2009 19:32:54 +0000 (19:32 +0000)]
Fix for PR5190, Credit to Zhanyong Wan.

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

14 years agoAdd a DR437 testcase, but disable it for now, since it fails.
Sebastian Redl [Sat, 17 Oct 2009 18:31:05 +0000 (18:31 +0000)]
Add a DR437 testcase, but disable it for now, since it fails.

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

14 years agoAvoid std::string thrashing in MultiKeywordSelector::getName(), and simplify.
Daniel Dunbar [Sat, 17 Oct 2009 18:13:02 +0000 (18:13 +0000)]
Avoid std::string thrashing in MultiKeywordSelector::getName(), and simplify.

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

14 years agoSimplify more.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:53 +0000 (18:12 +0000)]
Simplify more.

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

14 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:45 +0000 (18:12 +0000)]
Simplify.

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

14 years agoUse raw_ostream instead of C stdio.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:37 +0000 (18:12 +0000)]
Use raw_ostream instead of C stdio.

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

14 years agoRewrite AttributeList::getKind to use StringRef API.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:29 +0000 (18:12 +0000)]
Rewrite AttributeList::getKind to use StringRef API.

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

14 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 18:12:21 +0000 (18:12 +0000)]
Simplify.

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

14 years agoUse raw_ostream for formatting integers, and use IdentifierInfo::getNameStr
Daniel Dunbar [Sat, 17 Oct 2009 18:12:14 +0000 (18:12 +0000)]
Use raw_ostream for formatting integers, and use IdentifierInfo::getNameStr
instead of getName.
 - -2 FIXMEs.

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

14 years agoMinor cleanup: move typedef out of anonymous namespace (which now contains nothing...
Ted Kremenek [Sat, 17 Oct 2009 17:45:11 +0000 (17:45 +0000)]
Minor cleanup: move typedef out of anonymous namespace (which now contains nothing) and into RemoveDeadBindings.  No functionality change.

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

14 years agoWrite the preprocessor block after we write out types + declarations,
Douglas Gregor [Sat, 17 Oct 2009 17:25:45 +0000 (17:25 +0000)]
Write the preprocessor block after we write out types + declarations,
so that we catch any macros used within the declarations and types.

Also, properly store a NULL selector.

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

14 years agoSuppress -Asserts warning.
Daniel Dunbar [Sat, 17 Oct 2009 09:39:30 +0000 (09:39 +0000)]
Suppress -Asserts warning.

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

14 years agoRemove a FIXME that doesn't belong, there are numerous other places that use
Daniel Dunbar [Sat, 17 Oct 2009 09:38:57 +0000 (09:38 +0000)]
Remove a FIXME that doesn't belong, there are numerous other places that use
alignment in bits in clang. If we really want to fix this, it should be a bugzilla.

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

14 years agoSimplify (move guard to caller instead of callee).
Daniel Dunbar [Sat, 17 Oct 2009 09:04:56 +0000 (09:04 +0000)]
Simplify (move guard to caller instead of callee).

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

14 years agoPer discussion with Ted, the 'FromSuper'/'FromSub' logic is invalid. Simplify
Zhongxing Xu [Sat, 17 Oct 2009 08:39:24 +0000 (08:39 +0000)]
Per discussion with Ted, the 'FromSuper'/'FromSub' logic is invalid. Simplify
the code to standard worklist algorithm. Always add both sub and super
regions of live regions.

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

14 years agoFix another static analyzer crash due to a corner case in "folding" symbolic values...
Ted Kremenek [Sat, 17 Oct 2009 07:39:35 +0000 (07:39 +0000)]
Fix another static analyzer crash due to a corner case in "folding" symbolic values that are constrained to be a constant.

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

14 years agoActually all regions whose super region is not MemSpaceRegion are of these 3
Zhongxing Xu [Sat, 17 Oct 2009 07:32:08 +0000 (07:32 +0000)]
Actually all regions whose super region is not MemSpaceRegion are of these 3
kinds. This means we are visiting all regions 'from super region'.

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

14 years agoFix compiler warning: "ISO C90 forbids mixed declarations and code"
Ted Kremenek [Sat, 17 Oct 2009 06:42:15 +0000 (06:42 +0000)]
Fix compiler warning: "ISO C90 forbids mixed declarations and code"

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

14 years agoFix warning: 'warning: C++ style comments are not allowed in ISO C90'
Ted Kremenek [Sat, 17 Oct 2009 06:37:16 +0000 (06:37 +0000)]
Fix warning: 'warning: C++ style comments are not allowed in ISO C90'

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

14 years agoResolve FIXME: delete the 'Program' object in the destructor of CIndexer.
Ted Kremenek [Sat, 17 Oct 2009 06:21:47 +0000 (06:21 +0000)]
Resolve FIXME: delete the 'Program' object in the destructor of CIndexer.

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

14 years agoDon't crash when dumping pretty stack traces, if the current tok is an
Daniel Dunbar [Sat, 17 Oct 2009 06:13:04 +0000 (06:13 +0000)]
Don't crash when dumping pretty stack traces, if the current tok is an
annotation token.
 - I'm not sure what the best thing to print is, for now we just print the token
   location and 'at annotation token'.

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

14 years agoFix PR5211: codegen shouldn't assume that the result of ||/&& is int
Chris Lattner [Sat, 17 Oct 2009 04:24:20 +0000 (04:24 +0000)]
Fix PR5211: codegen shouldn't assume that the result of ||/&& is int
anymore.  In C++ it is bool.

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

14 years agoSimplify.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:56 +0000 (03:28 +0000)]
Simplify.

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

14 years agoAdd IdentiferInfo::getNameStr() -> StringRef.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:48 +0000 (03:28 +0000)]
Add IdentiferInfo::getNameStr() -> StringRef.

Also, add getNameStart as a synonym for getName(). getName() is now deprecated,
when all clients are updated then getNameStr() should be renamed to
getName(). PR5218.

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

14 years agoFix sentence-o.
Daniel Dunbar [Sat, 17 Oct 2009 03:28:37 +0000 (03:28 +0000)]
Fix sentence-o.

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

14 years agoAdd Ubuntu 9.04 C++ search path.
Daniel Dunbar [Sat, 17 Oct 2009 03:19:56 +0000 (03:19 +0000)]
Add Ubuntu 9.04 C++ search path.

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

14 years agoAdd 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created...
Ted Kremenek [Sat, 17 Oct 2009 00:34:24 +0000 (00:34 +0000)]
Add 'UseBumpPtrAllocator' flag to ASTUnit::LoadFromPCHFile() to cause the created ASTContext to use
its own BumpPtrAllocator to allocate ASTs.

Change clang_createTranslationUnit (CIndex) to pass 'UseBumpPtrAllocator = true' to
ASTUnit::LoadFromPCHFile().

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

14 years agoMerge the "types" and "declarations" blocks in the precompiled header
Douglas Gregor [Sat, 17 Oct 2009 00:13:19 +0000 (00:13 +0000)]
Merge the "types" and "declarations" blocks in the precompiled header
format, so that we don't end up with multiple declaration and types
blocks. Also, fix a few obscure bugs with PCH loading and generation:

  - If the DeclIDs DenseMap reallocates while we are writing a
    declaration (due to recursively writing other declarations), we
    could end up writing a bad ID to ExternalDefinitions.
  - When loading an ArrayLoc (part of DeclaratorInfo), we need to set
    the size expression to NULL if no size expression was provided.

PCH -> AST rewriting is still partly broken, unfortunately.

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

14 years agoPatch to clean up and improve visual display of
Fariborz Jahanian [Fri, 16 Oct 2009 23:25:02 +0000 (23:25 +0000)]
Patch to clean up and improve visual display of
builtin function ambiguity.

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

14 years agoWhile writing source-location entries to a PCH file, go through an
Douglas Gregor [Fri, 16 Oct 2009 22:46:09 +0000 (22:46 +0000)]
While writing source-location entries to a PCH file, go through an
interface that can load those source-location entries on demand (from
another PCH file).

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

14 years agoAllow TypeLocs to be fully initialized with a single SourceLocation. This
John McCall [Fri, 16 Oct 2009 22:31:57 +0000 (22:31 +0000)]
Allow TypeLocs to be fully initialized with a single SourceLocation.  This
will be the keystone of converting existing rewrites to be rewrites on TypeLocs.

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

14 years agoUse VisibleQuals to control setting of Volatile/Restrict qualifiers on
Fariborz Jahanian [Fri, 16 Oct 2009 22:08:05 +0000 (22:08 +0000)]
Use VisibleQuals to control setting of Volatile/Restrict qualifiers on
candidate types in BuiltinCandidateTypeSet::AddPointerWithMoreQualifiedTypeVariants
further trimming the overload candidate set.

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

14 years agoFactor out routines to encode/decode DeclaratorInfos and move them into the
John McCall [Fri, 16 Oct 2009 21:56:05 +0000 (21:56 +0000)]
Factor out routines to encode/decode DeclaratorInfos and move them into the
core PCH reader/writer implementation files.

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

14 years agoAdd an accessor to extra the type directly from a DeclaratorInfo
John McCall [Fri, 16 Oct 2009 21:42:04 +0000 (21:42 +0000)]
Add an accessor to extra the type directly from a DeclaratorInfo
without an opaque call.

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

14 years agoMake CIndex and c-index-test a little bit more robust. The only
Douglas Gregor [Fri, 16 Oct 2009 21:24:31 +0000 (21:24 +0000)]
Make CIndex and c-index-test a little bit more robust. The only
substantive change is that clang_getCursorSource() now returns the
file in which a macro was instantiated when the cursor points into a
macro instantiation, rather than crashing.

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

14 years agoFix static analyzer crash due to recently add symbolic-value constant folding. The...
Ted Kremenek [Fri, 16 Oct 2009 20:46:24 +0000 (20:46 +0000)]
Fix static analyzer crash due to recently add symbolic-value constant folding. The issue was falsely
converting the constant value of the LHS of a '<<'/'>>' operation to the same APSInt value of the
RHS.

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

14 years agoProvide 'static' version of BinaryOperator::isShiftOp().
Ted Kremenek [Fri, 16 Oct 2009 20:45:04 +0000 (20:45 +0000)]
Provide 'static' version of BinaryOperator::isShiftOp().

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

14 years agoKeep track of whether declararions were loaded from a precompiled
Douglas Gregor [Fri, 16 Oct 2009 20:01:17 +0000 (20:01 +0000)]
Keep track of whether declararions were loaded from a precompiled
header or not via a new "PCHLevel" field in Decl. We currently use
this information to help CIndex filter out declarations that came from
a precompiled header (rather than from an AST file). Further down the
road, it can be used to help implement multi-level precompiled
headers.

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

14 years agodynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld synta...
Edward O'Callaghan [Fri, 16 Oct 2009 19:44:18 +0000 (19:44 +0000)]
dynamic linker arg is incorrectly invoking gnu ld arg syntax instead of svr4 ld syntax in AuroraUX toolchain.

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

14 years agoImplement derived-to-base AST/code gen. There is a
Fariborz Jahanian [Fri, 16 Oct 2009 19:20:59 +0000 (19:20 +0000)]
Implement derived-to-base AST/code gen. There is a
FIXME in CGCXX.cpp that I would like Anders to
take a look at.

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

14 years agoAdd support for a chain of stat caches in the FileManager, rather than
Douglas Gregor [Fri, 16 Oct 2009 18:18:30 +0000 (18:18 +0000)]
Add support for a chain of stat caches in the FileManager, rather than
only supporting a single stat cache. The immediate benefit of this
change is that we can now generate a PCH/AST file when including
another PCH file; in the future, the chain of stat caches will likely
be useful with multiple levels of PCH files.

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

14 years agoImplement PR4407 - missing warnings on case value overflow,
Chris Lattner [Fri, 16 Oct 2009 16:45:22 +0000 (16:45 +0000)]
Implement PR4407 - missing warnings on case value overflow,
patch by Zhanyong Wan!

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