Re: r303322 - [modules] Switch from inferring owning modules based on source location to

2017-06-22 Thread Michael Gottesman via cfe-commits

> On Jun 21, 2017, at 4:56 PM, Richard Smith via cfe-commits 
>  wrote:
> 
> On 21 June 2017 at 16:55, Bruno Cardoso Lopes  > wrote:
> On Wed, Jun 21, 2017 at 4:44 PM, Richard Smith  > wrote:
> > On 21 June 2017 at 14:51, Bruno Cardoso Lopes  > >
> > wrote:
> >>
> >> Hi Richard,
> >>
> >> Somehow this commit caused some methods in ObjC to do not become
> >> visible in an interface when compiling with modules on. I filed
> >> https://bugs.llvm.org/show_bug.cgi?id=33552 
> >> , any idea what could have
> >> gone wrong here? `hasVisibleDeclarationImpl` doesn't seem to have
> >> changed the logic.
> >
> >
> > DeclObjC.cpp is making some incorrect assumptions about what the isHidden()
> > flag on Decls means. Looks like we're going to need to move all of the ObjC
> > lookup machinery out of DeclObjC into Sema to allow it to perform correct
> > visibility checks. (For what it's worth, this would already have been broken
> > for Objective-C++ and local submodule visibility mode prior to this change,
> > as those modes both have situations where the "Hidden" flag is not the
> > complete story with regard to whether a declaration is visible in a
> > particular lookup context.)
> 
> Oh, that's bad.
> 
> Is there any workaround we can do on top of this change for now in
> order to have the previous behavior for non-LSV and ObjC? This is
> keeping Swift from building against upstream right now.
> 
> Yes, I'm working on what should (hopefully) be a fairly quick short-term fix.

Thanks Richard!

Do you have an eta on this?

This is blocking swift from compiling against ToT LLVM. As you know these 
changes come in fast so the longer we wait, the more likely other breakage 
sneaks in. I imagine we are going to probably build against the newer 
llvm/clang in the next bit, so this is the worst time to have a long period of 
time of breakage.

+CC Jordan Rose since I think he ran into this.

Thanks in advance = ),
Michael

>  
> >> Thanks,
> >>
> >> On Wed, May 17, 2017 at 7:29 PM, Richard Smith via cfe-commits
> >> mailto:cfe-commits@lists.llvm.org>> wrote:
> >> > Author: rsmith
> >> > Date: Wed May 17 21:29:20 2017
> >> > New Revision: 303322
> >> >
> >> > URL: http://llvm.org/viewvc/llvm-project?rev=303322&view=rev 
> >> > 
> >> > Log:
> >> > [modules] Switch from inferring owning modules based on source location
> >> > to
> >> > inferring based on the current module at the point of creation.
> >> >
> >> > This should result in no functional change except when building a
> >> > preprocessed
> >> > module (or more generally when using #pragma clang module begin/end to
> >> > switch
> >> > module in the middle of a file), in which case it allows us to correctly
> >> > track
> >> > the owning module for declarations. We can't map from FileID to module
> >> > in the
> >> > preprocessed module case, since all modules would have the same FileID.
> >> >
> >> > There are still a couple of remaining places that try to infer a module
> >> > from a
> >> > source location; I'll clean those up in follow-up changes.
> >> >
> >> > Modified:
> >> > cfe/trunk/include/clang/AST/ASTContext.h
> >> > cfe/trunk/include/clang/AST/DeclBase.h
> >> > cfe/trunk/include/clang/Basic/LangOptions.h
> >> > cfe/trunk/include/clang/Sema/Sema.h
> >> > cfe/trunk/include/clang/Serialization/ASTWriter.h
> >> > cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> >> > cfe/trunk/lib/Sema/SemaDecl.cpp
> >> > cfe/trunk/lib/Sema/SemaLookup.cpp
> >> > cfe/trunk/lib/Sema/SemaTemplate.cpp
> >> > cfe/trunk/lib/Serialization/ASTWriter.cpp
> >> > cfe/trunk/lib/Serialization/ASTWriterDecl.cpp
> >> > cfe/trunk/test/Modules/preprocess-module.cpp
> >> > cfe/trunk/test/SemaCXX/modules-ts.cppm
> >> >
> >> > Modified: cfe/trunk/include/clang/AST/ASTContext.h
> >> > URL:
> >> > http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ASTContext.h?rev=303322&r1=303321&r2=303322&view=diff
> >> >  
> >> > 
> >> >
> >> > ==
> >> > --- cfe/trunk/include/clang/AST/ASTContext.h (original)
> >> > +++ cfe/trunk/include/clang/AST/ASTContext.h Wed May 17 21:29:20 2017
> >> > @@ -935,7 +935,7 @@ public:
> >> >
> >> >/// \brief Get the additional modules in which the definition \p Def
> >> > has
> >> >/// been merged.
> >> > -  ArrayRef getModulesWithMergedDefinition(NamedDecl *Def) {
> >> > +  ArrayRef getModulesWithMergedDefinition(const NamedDecl
> >> > *Def) {
> >> >  auto MergedIt = MergedDefModules.find(Def);
> >> >  if (MergedIt == MergedDefModules.end())
> >> >return None;
> >> >
> >> > Modified: cfe/trunk/include/clang/AST/DeclB

r284658 - [cmake] Follow LLVM's lead in creating exported tool targets for clang tools.

2016-10-19 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Oct 19 17:46:06 2016
New Revision: 284658

URL: http://llvm.org/viewvc/llvm-project?rev=284658&view=rev
Log:
[cmake] Follow LLVM's lead in creating exported tool targets for clang tools.

This is needed by downstream projects such as swift to get proper cmake
dependency information for LLVM/Clang targets.

A few months ago I added support for exporting this information for Clang
libraries. In order to be incremental, I did not add support for exporting clang
tools as well at that time. Now such support is needed, so I am committing this
incremental code.

Modified:
cfe/trunk/cmake/modules/AddClang.cmake

Modified: cfe/trunk/cmake/modules/AddClang.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/AddClang.cmake?rev=284658&r1=284657&r2=284658&view=diff
==
--- cfe/trunk/cmake/modules/AddClang.cmake (original)
+++ cfe/trunk/cmake/modules/AddClang.cmake Wed Oct 19 17:46:06 2016
@@ -139,6 +139,7 @@ macro(add_clang_tool name)
 -DCMAKE_INSTALL_COMPONENT=${name}
 -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
 endif()
+set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
   endif()
 endmacro()
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: r250418 - [CodeGen] Remove dead code. NFC.

2015-10-19 Thread Michael Gottesman via cfe-commits

> On Oct 15, 2015, at 8:29 AM, Benjamin Kramer via cfe-commits 
>  wrote:
> 
> Author: d0k
> Date: Thu Oct 15 10:29:40 2015
> New Revision: 250418
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=250418&view=rev
> Log:
> [CodeGen] Remove dead code. NFC.
> 
> Modified:
>cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>cfe/trunk/lib/CodeGen/CGCall.cpp
>cfe/trunk/lib/CodeGen/CGCleanup.cpp
>cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>cfe/trunk/lib/CodeGen/CGDebugInfo.h
>cfe/trunk/lib/CodeGen/CGObjC.cpp
>cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>cfe/trunk/lib/CodeGen/CGVTables.h
>cfe/trunk/lib/CodeGen/CodeGenABITypes.cpp
>cfe/trunk/lib/CodeGen/CodeGenFunction.h
>cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>cfe/trunk/lib/CodeGen/CodeGenModule.h
>cfe/trunk/lib/CodeGen/CodeGenPGO.h
>cfe/trunk/lib/CodeGen/EHScopeStack.h
>cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
> 
> Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=250418&r1=250417&r2=250418&view=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Oct 15 10:29:40 2015
> @@ -4106,15 +4106,6 @@ Value *CodeGenFunction::vectorWrapScalar
>   return Op;
> }
> 
> -Value *CodeGenFunction::vectorWrapScalar8(Value *Op) {
> -  llvm::Type *VTy = llvm::VectorType::get(Int8Ty, 8);
> -  Op = Builder.CreateBitCast(Op, Int8Ty);
> -  Value *V = UndefValue::get(VTy);
> -  llvm::Constant *CI = ConstantInt::get(SizeTy, 0);
> -  Op = Builder.CreateInsertElement(V, Op, CI);
> -  return Op;
> -}
> -
> Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
>const CallExpr *E) {
>   unsigned HintID = static_cast(-1);
> 
> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=250418&r1=250417&r2=250418&view=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Oct 15 10:29:40 2015
> @@ -3038,12 +3038,6 @@ CodeGenFunction::EmitRuntimeCallOrInvoke
>   return callSite;
> }
> 
> -llvm::CallSite
> -CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
> -  const Twine &Name) {
> -  return EmitCallOrInvoke(Callee, None, Name);
> -}
> -
> /// Emits a call or invoke instruction to the given function, depending
> /// on the current state of the EH stack.
> llvm::CallSite
> 
> Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=250418&r1=250417&r2=250418&view=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Thu Oct 15 10:29:40 2015
> @@ -167,23 +167,6 @@ EHScopeStack::getInnermostActiveNormalCl
>   return stable_end();
> }
> 
> -EHScopeStack::stable_iterator EHScopeStack::getInnermostActiveEHScope() 
> const {
> -  for (stable_iterator si = getInnermostEHScope(), se = stable_end();
> - si != se; ) {
> -// Skip over inactive cleanups.
> -EHCleanupScope *cleanup = dyn_cast(&*find(si));
> -if (cleanup && !cleanup->isActive()) {
> -  si = cleanup->getEnclosingEHScope();
> -  continue;
> -}
> -
> -// All other scopes are always active.
> -return si;
> -  }
> -
> -  return stable_end();
> -}
> -
> 
> void *EHScopeStack::pushCleanup(CleanupKind Kind, size_t Size) {
>   char *Buffer = allocate(EHCleanupScope::getSizeForCleanupSize(Size));
> 
> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=250418&r1=250417&r2=250418&view=diff
> ==
> --- cfe/trunk/lib/CodeGen/CGDebugInfo.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGDebugInfo.cpp Thu Oct 15 10:29:40 2015
> @@ -2159,30 +2159,6 @@ llvm::DIType *CGDebugInfo::getOrCreateTy
>   return Res;
> }
> 
> -unsigned CGDebugInfo::Checksum(const ObjCInterfaceDecl *ID) {
> -  // The assumption is that the number of ivars can only increase
> -  // monotonically, so it is safe to just use their current number as
> -  // a checksum.
> -  unsigned Sum = 0;
> -  for (const ObjCIvarDecl *Ivar = ID->all_declared_ivar_begin();
> -   Ivar != nullptr; Ivar = Ivar->getNextIvar())
> -++Sum;
> -
> -  return Sum;
> -}
> -
> -ObjCInterfaceDecl *CGDebugInfo::getObjCInterfaceDecl(QualType Ty) {
> -  switch (Ty->getTypeClass()) {
> -  case Type::ObjCObjectPointer:
> -return getObjCInterfaceDecl(
> -cast(Ty)->getPointeeType());
> -  case Type::ObjCInterface:
> -return cast(Ty)->getDecl();
> -  default:
> -return nullptr;
> -  }

Re: r250418 - [CodeGen] Remove dead code. NFC.

2015-10-20 Thread Michael Gottesman via cfe-commits

> On Oct 19, 2015, at 4:40 PM, Michael Gottesman via cfe-commits 
>  wrote:
> 
>> 
>> On Oct 15, 2015, at 8:29 AM, Benjamin Kramer via cfe-commits 
>>  wrote:
>> 
>> Author: d0k
>> Date: Thu Oct 15 10:29:40 2015
>> New Revision: 250418
>> 
>> URL: http://llvm.org/viewvc/llvm-project?rev=250418&view=rev
>> Log:
>> [CodeGen] Remove dead code. NFC.
>> 
>> Modified:
>>   cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>>   cfe/trunk/lib/CodeGen/CGCall.cpp
>>   cfe/trunk/lib/CodeGen/CGCleanup.cpp
>>   cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>   cfe/trunk/lib/CodeGen/CGDebugInfo.h
>>   cfe/trunk/lib/CodeGen/CGObjC.cpp
>>   cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>>   cfe/trunk/lib/CodeGen/CGVTables.h
>>   cfe/trunk/lib/CodeGen/CodeGenABITypes.cpp
>>   cfe/trunk/lib/CodeGen/CodeGenFunction.h
>>   cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>>   cfe/trunk/lib/CodeGen/CodeGenModule.h
>>   cfe/trunk/lib/CodeGen/CodeGenPGO.h
>>   cfe/trunk/lib/CodeGen/EHScopeStack.h
>>   cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=250418&r1=250417&r2=250418&view=diff
>> ==
>> --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Oct 15 10:29:40 2015
>> @@ -4106,15 +4106,6 @@ Value *CodeGenFunction::vectorWrapScalar
>>  return Op;
>> }
>> 
>> -Value *CodeGenFunction::vectorWrapScalar8(Value *Op) {
>> -  llvm::Type *VTy = llvm::VectorType::get(Int8Ty, 8);
>> -  Op = Builder.CreateBitCast(Op, Int8Ty);
>> -  Value *V = UndefValue::get(VTy);
>> -  llvm::Constant *CI = ConstantInt::get(SizeTy, 0);
>> -  Op = Builder.CreateInsertElement(V, Op, CI);
>> -  return Op;
>> -}
>> -
>> Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
>>   const CallExpr *E) {
>>  unsigned HintID = static_cast(-1);
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=250418&r1=250417&r2=250418&view=diff
>> ==
>> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Oct 15 10:29:40 2015
>> @@ -3038,12 +3038,6 @@ CodeGenFunction::EmitRuntimeCallOrInvoke
>>  return callSite;
>> }
>> 
>> -llvm::CallSite
>> -CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
>> -  const Twine &Name) {
>> -  return EmitCallOrInvoke(Callee, None, Name);
>> -}
>> -
>> /// Emits a call or invoke instruction to the given function, depending
>> /// on the current state of the EH stack.
>> llvm::CallSite
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=250418&r1=250417&r2=250418&view=diff
>> ==
>> --- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
>> +++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Thu Oct 15 10:29:40 2015
>> @@ -167,23 +167,6 @@ EHScopeStack::getInnermostActiveNormalCl
>>  return stable_end();
>> }
>> 
>> -EHScopeStack::stable_iterator EHScopeStack::getInnermostActiveEHScope() 
>> const {
>> -  for (stable_iterator si = getInnermostEHScope(), se = stable_end();
>> - si != se; ) {
>> -// Skip over inactive cleanups.
>> -EHCleanupScope *cleanup = dyn_cast(&*find(si));
>> -if (cleanup && !cleanup->isActive()) {
>> -  si = cleanup->getEnclosingEHScope();
>> -  continue;
>> -}
>> -
>> -// All other scopes are always active.
>> -return si;
>> -  }
>> -
>> -  return stable_end();
>> -}
>> -
>> 
>> void *EHScopeStack::pushCleanup(CleanupKind Kind, size_t Size) {
>>  char *Buffer = allocate(EHCleanupScope::getSizeForCleanupSize(Size));
>> 
>> Modified: cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>> URL: 
>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?rev=250418&r1=250417&r2=250418&view=diff
>> ==
>> --- cfe/trunk/lib/CodeGen/CGDe

Re: r250418 - [CodeGen] Remove dead code. NFC.

2015-10-20 Thread Michael Gottesman via cfe-commits
Let me play with it a bit (I did not read the code, I just was tracking down 
the linkage error).

Michael

> On Oct 20, 2015, at 12:07 AM, Chandler Carruth  wrote:
> 
> Is it possible to add a unittest that exercises this extension point in-tree? 
> For example the way I did for AA extension hooks?
> 
> On Mon, Oct 19, 2015 at 9:00 PM Michael Gottesman via cfe-commits 
> mailto:cfe-commits@lists.llvm.org>> wrote:
>> On Oct 19, 2015, at 4:40 PM, Michael Gottesman via cfe-commits 
>> mailto:cfe-commits@lists.llvm.org>> wrote:
>> 
>>> 
>>> On Oct 15, 2015, at 8:29 AM, Benjamin Kramer via cfe-commits 
>>> mailto:cfe-commits@lists.llvm.org>> wrote:
>>> 
>>> Author: d0k
>>> Date: Thu Oct 15 10:29:40 2015
>>> New Revision: 250418
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=250418&view=rev 
>>> <http://llvm.org/viewvc/llvm-project?rev=250418&view=rev>
>>> Log:
>>> [CodeGen] Remove dead code. NFC.
>>> 
>>> Modified:
>>>   cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>>>   cfe/trunk/lib/CodeGen/CGCall.cpp
>>>   cfe/trunk/lib/CodeGen/CGCleanup.cpp
>>>   cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>>   cfe/trunk/lib/CodeGen/CGDebugInfo.h
>>>   cfe/trunk/lib/CodeGen/CGObjC.cpp
>>>   cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>>>   cfe/trunk/lib/CodeGen/CGVTables.h
>>>   cfe/trunk/lib/CodeGen/CodeGenABITypes.cpp
>>>   cfe/trunk/lib/CodeGen/CodeGenFunction.h
>>>   cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>>>   cfe/trunk/lib/CodeGen/CodeGenModule.h
>>>   cfe/trunk/lib/CodeGen/CodeGenPGO.h
>>>   cfe/trunk/lib/CodeGen/EHScopeStack.h
>>>   cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=250418&r1=250417&r2=250418&view=diff
>>>  
>>> <http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=250418&r1=250417&r2=250418&view=diff>
>>> ==
>>> --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
>>> +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Oct 15 10:29:40 2015
>>> @@ -4106,15 +4106,6 @@ Value *CodeGenFunction::vectorWrapScalar
>>>  return Op;
>>> }
>>> 
>>> -Value *CodeGenFunction::vectorWrapScalar8(Value *Op) {
>>> -  llvm::Type *VTy = llvm::VectorType::get(Int8Ty, 8);
>>> -  Op = Builder.CreateBitCast(Op, Int8Ty);
>>> -  Value *V = UndefValue::get(VTy);
>>> -  llvm::Constant *CI = ConstantInt::get(SizeTy, 0);
>>> -  Op = Builder.CreateInsertElement(V, Op, CI);
>>> -  return Op;
>>> -}
>>> -
>>> Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
>>>   const CallExpr *E) {
>>>  unsigned HintID = static_cast(-1);
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=250418&r1=250417&r2=250418&view=diff
>>>  
>>> <http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=250418&r1=250417&r2=250418&view=diff>
>>> ==
>>> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
>>> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Oct 15 10:29:40 2015
>>> @@ -3038,12 +3038,6 @@ CodeGenFunction::EmitRuntimeCallOrInvoke
>>>  return callSite;
>>> }
>>> 
>>> -llvm::CallSite
>>> -CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
>>> -  const Twine &Name) {
>>> -  return EmitCallOrInvoke(Callee, None, Name);
>>> -}
>>> -
>>> /// Emits a call or invoke instruction to the given function, depending
>>> /// on the current state of the EH stack.
>>> llvm::CallSite
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
>>> URL: 
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=250418&r1=250417&r2=250418&view=diff
>>>  
>>> <http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=250418&r1=250417&r2=250418&view=diff>
>>> ==
>>> --- cfe/trunk/lib/Code

Re: [ALERT:Possible Phishing] r250418 - [CodeGen] Remove dead code. NFC.

2015-10-20 Thread Michael Gottesman via cfe-commits
Thanks!

Michael

> On Oct 20, 2015, at 12:55 AM, Benjamin Kramer  wrote:
> 
> Put it back in r250803. Tests very welcome ;)
> 
> - Benjamin
> 
> On Tue, Oct 20, 2015 at 9:14 AM, Michael Gottesman via cfe-commits
>  wrote:
>> Let me play with it a bit (I did not read the code, I just was tracking down
>> the linkage error).
>> 
>> Michael
>> 
>> On Oct 20, 2015, at 12:07 AM, Chandler Carruth  wrote:
>> 
>> Is it possible to add a unittest that exercises this extension point
>> in-tree? For example the way I did for AA extension hooks?
>> 
>> On Mon, Oct 19, 2015 at 9:00 PM Michael Gottesman via cfe-commits
>>  wrote:
>>> 
>>> On Oct 19, 2015, at 4:40 PM, Michael Gottesman via cfe-commits
>>>  wrote:
>>> 
>>> 
>>> On Oct 15, 2015, at 8:29 AM, Benjamin Kramer via cfe-commits
>>>  wrote:
>>> 
>>> Author: d0k
>>> Date: Thu Oct 15 10:29:40 2015
>>> New Revision: 250418
>>> 
>>> URL: http://llvm.org/viewvc/llvm-project?rev=250418&view=rev
>>> Log:
>>> [CodeGen] Remove dead code. NFC.
>>> 
>>> Modified:
>>>  cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>>>  cfe/trunk/lib/CodeGen/CGCall.cpp
>>>  cfe/trunk/lib/CodeGen/CGCleanup.cpp
>>>  cfe/trunk/lib/CodeGen/CGDebugInfo.cpp
>>>  cfe/trunk/lib/CodeGen/CGDebugInfo.h
>>>  cfe/trunk/lib/CodeGen/CGObjC.cpp
>>>  cfe/trunk/lib/CodeGen/CGObjCMac.cpp
>>>  cfe/trunk/lib/CodeGen/CGVTables.h
>>>  cfe/trunk/lib/CodeGen/CodeGenABITypes.cpp
>>>  cfe/trunk/lib/CodeGen/CodeGenFunction.h
>>>  cfe/trunk/lib/CodeGen/CodeGenModule.cpp
>>>  cfe/trunk/lib/CodeGen/CodeGenModule.h
>>>  cfe/trunk/lib/CodeGen/CodeGenPGO.h
>>>  cfe/trunk/lib/CodeGen/EHScopeStack.h
>>>  cfe/trunk/lib/CodeGen/MicrosoftCXXABI.cpp
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=250418&r1=250417&r2=250418&view=diff
>>> 
>>> ==
>>> --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
>>> +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Thu Oct 15 10:29:40 2015
>>> @@ -4106,15 +4106,6 @@ Value *CodeGenFunction::vectorWrapScalar
>>> return Op;
>>> }
>>> 
>>> -Value *CodeGenFunction::vectorWrapScalar8(Value *Op) {
>>> -  llvm::Type *VTy = llvm::VectorType::get(Int8Ty, 8);
>>> -  Op = Builder.CreateBitCast(Op, Int8Ty);
>>> -  Value *V = UndefValue::get(VTy);
>>> -  llvm::Constant *CI = ConstantInt::get(SizeTy, 0);
>>> -  Op = Builder.CreateInsertElement(V, Op, CI);
>>> -  return Op;
>>> -}
>>> -
>>> Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
>>>  const CallExpr *E) {
>>> unsigned HintID = static_cast(-1);
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGCall.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCall.cpp?rev=250418&r1=250417&r2=250418&view=diff
>>> 
>>> ==
>>> --- cfe/trunk/lib/CodeGen/CGCall.cpp (original)
>>> +++ cfe/trunk/lib/CodeGen/CGCall.cpp Thu Oct 15 10:29:40 2015
>>> @@ -3038,12 +3038,6 @@ CodeGenFunction::EmitRuntimeCallOrInvoke
>>> return callSite;
>>> }
>>> 
>>> -llvm::CallSite
>>> -CodeGenFunction::EmitCallOrInvoke(llvm::Value *Callee,
>>> -  const Twine &Name) {
>>> -  return EmitCallOrInvoke(Callee, None, Name);
>>> -}
>>> -
>>> /// Emits a call or invoke instruction to the given function, depending
>>> /// on the current state of the EH stack.
>>> llvm::CallSite
>>> 
>>> Modified: cfe/trunk/lib/CodeGen/CGCleanup.cpp
>>> URL:
>>> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGCleanup.cpp?rev=250418&r1=250417&r2=250418&view=diff
>>> 
>>> ==
>>> --- cfe/trunk/lib/CodeGen/CGCleanup.cpp (original)
>>> +++ cfe/trunk/lib/CodeGen/CGCleanup.cpp Thu Oct 15 10:29:40 2015
>>> @@ -167,23 +167,6 @@ EHScopeStack::getInnermostActiveNormalCl
>>> return stable_end();
>>> }
>>> 
>>> -EHScopeStack::stable_iterator EHScopeStack::getInnermostAct

r274157 - [cmake] Move creation of ClangTargets and installation of ClangConfig.cmake from ./CMakeLists.txt -> ./cmake/modules/CMakeLists.txt.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 15:22:44 2016
New Revision: 274157

URL: http://llvm.org/viewvc/llvm-project?rev=274157&view=rev
Log:
[cmake] Move creation of ClangTargets and installation of ClangConfig.cmake 
from ./CMakeLists.txt -> ./cmake/modules/CMakeLists.txt.

This matches LLVM.

Added:
cfe/trunk/cmake/modules/CMakeLists.txt
Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=274157&r1=274156&r2=274157&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Wed Jun 29 15:22:44 2016
@@ -596,28 +596,7 @@ if(APPLE)
   endif()
 endif()
 
-# Generate a list of CMake library targets so that other CMake projects can
-# link against them. LLVM calls its version of this file LLVMExports.cmake, but
-# the usual CMake convention seems to be ${Project}Targets.cmake.
-set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
-set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
-get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
-export(TARGETS ${CLANG_EXPORTS} FILE 
${clang_cmake_builddir}/ClangTargets.cmake)
-
-# Install a /lib/cmake/clang/ClangConfig.cmake file so that
-# find_package(Clang) works. Install the target list with it.
-install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
-
-install(FILES
-  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
-
-# Also copy ClangConfig.cmake to the build directory so that dependent projects
-# can build against a build directory of Clang more easily.
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/ClangConfig.cmake
-  ${CLANG_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake
-  COPYONLY)
+add_subdirectory(cmake/modules)
 
 if (CLANG_ENABLE_BOOTSTRAP)
   include(ExternalProject)

Added: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274157&view=auto
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (added)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 15:22:44 2016
@@ -0,0 +1,22 @@
+# Generate a list of CMake library targets so that other CMake projects can
+# link against them. LLVM calls its version of this file LLVMExports.cmake, but
+# the usual CMake convention seems to be ${Project}Targets.cmake.
+set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
+set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
+get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
+export(TARGETS ${CLANG_EXPORTS} FILE 
${clang_cmake_builddir}/ClangTargets.cmake)
+
+# Install a /lib/cmake/clang/ClangConfig.cmake file so that
+# find_package(Clang) works. Install the target list with it.
+install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+
+install(FILES
+  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
+  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
+
+# Also copy ClangConfig.cmake to the build directory so that dependent projects
+# can build against a build directory of Clang more easily.
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
+  ${CLANG_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake
+  COPYONLY)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274158 - [ClangConfig] Replace paths with the same value as CLANG_INSTALL_PACKAGE_DIR with a deref of the variable.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 15:22:46 2016
New Revision: 274158

URL: http://llvm.org/viewvc/llvm-project?rev=274158&view=rev
Log:
[ClangConfig] Replace paths with the same value as CLANG_INSTALL_PACKAGE_DIR 
with a deref of the variable.

Modified:
cfe/trunk/cmake/modules/CMakeLists.txt

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274158&r1=274157&r2=274158&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 15:22:46 2016
@@ -12,11 +12,11 @@ install(EXPORT ClangTargets DESTINATION
 
 install(FILES
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
-  DESTINATION lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
+  DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
 
 # Also copy ClangConfig.cmake to the build directory so that dependent projects
 # can build against a build directory of Clang more easily.
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
-  ${CLANG_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/cmake/clang/ClangConfig.cmake
+  ${CLANG_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}/ClangConfig.cmake
   COPYONLY)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274168 - [ClangConfig] Copy ClangConfig.cmake to ${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR} instead of to ${CLANG_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 16:12:38 2016
New Revision: 274168

URL: http://llvm.org/viewvc/llvm-project?rev=274168&view=rev
Log:
[ClangConfig] Copy ClangConfig.cmake to 
${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR} instead of to 
${CLANG_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}.

This is an obvious bug since ClangConfig.cmake looks for ClangTargets.cmake in
${CMAKE_CURRENT_LIST_DIR}. But ClangTargets.cmake is in
${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}, so it will always fail with an
in tree build.

In the case where clang is built out of tree, this is still correct since
CMAKE_BINARY_DIR and CLANG_BINARY_DIR will be the same.

Modified:
cfe/trunk/cmake/modules/CMakeLists.txt

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274168&r1=274167&r2=274168&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 16:12:38 2016
@@ -18,5 +18,5 @@ install(FILES
 # can build against a build directory of Clang more easily.
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
-  ${CLANG_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}/ClangConfig.cmake
+  ${clang_cmake_builddir}/ClangConfig.cmake
   COPYONLY)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274180 - [ClangConfig] Store all of the targets exported in the variable CLANG_EXPORTED_TARGETS.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 16:59:23 2016
New Revision: 274180

URL: http://llvm.org/viewvc/llvm-project?rev=274180&view=rev
Log:
[ClangConfig] Store all of the targets exported in the variable 
CLANG_EXPORTED_TARGETS.

Modified:
cfe/trunk/cmake/modules/CMakeLists.txt
cfe/trunk/cmake/modules/ClangConfig.cmake.in

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274180&r1=274179&r2=274180&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 16:59:23 2016
@@ -28,7 +28,7 @@ foreach(p ${_count})
   set(CLANG_CONFIG_CODE "${CLANG_CONFIG_CODE}
 get_filename_component(CLANG_INSTALL_PREFIX \"\${CLANG_INSTALL_PREFIX}\" 
PATH)")
 endforeach(p)
-set(CLANG_CONFIG_CMAKE_DIR 
"\${CLANG_INSTALL_PREFIX}/\${CLANG_INSTALL_PACKAGE_DIR}")
+set(CLANG_CONFIG_CMAKE_DIR 
"\${CLANG_INSTALL_PREFIX}/${CLANG_INSTALL_PACKAGE_DIR}")
 set(CLANG_CONFIG_EXPORTS_FILE "\${CLANG_CMAKE_DIR}/ClangTargets.cmake")
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in

Modified: cfe/trunk/cmake/modules/ClangConfig.cmake.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/ClangConfig.cmake.in?rev=274180&r1=274179&r2=274180&view=diff
==
--- cfe/trunk/cmake/modules/ClangConfig.cmake.in (original)
+++ cfe/trunk/cmake/modules/ClangConfig.cmake.in Wed Jun 29 16:59:23 2016
@@ -8,6 +8,7 @@ find_package(LLVM REQUIRED CONFIG)
 
 @CLANG_CONFIG_CODE@
 
+set(CLANG_EXPORTED_TARGETS "@CLANG_EXPORTS@")
 set(CLANG_CMAKE_DIR "@CLANG_CONFIG_CMAKE_DIR@")
 
 # Provide all our library targets to users.


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274177 - [ClangConfig] Follow LLVM's example and only install Clang{Config, Target}.cmake when LLVM_INSTALL_TOOLCHAIN_ONLY is disabled.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 16:59:15 2016
New Revision: 274177

URL: http://llvm.org/viewvc/llvm-project?rev=274177&view=rev
Log:
[ClangConfig] Follow LLVM's example and only install Clang{Config,Target}.cmake 
when LLVM_INSTALL_TOOLCHAIN_ONLY is disabled.

Modified:
cfe/trunk/cmake/modules/CMakeLists.txt

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274177&r1=274176&r2=274177&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 16:59:15 2016
@@ -19,8 +19,10 @@ configure_file(
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
   @ONLY)
 
-install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
+  install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
 
-install(FILES
-  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
-  DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+  install(FILES
+${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
+DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
+endif()


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274178 - [ClangConfig] Instead of hard coding the ClangTargets location to /ClangTargets.cmake, follow LLVM's example and use a pre-computed cmake variable @CLANG_CONFIG_EXPORTS_FILE@.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 16:59:19 2016
New Revision: 274178

URL: http://llvm.org/viewvc/llvm-project?rev=274178&view=rev
Log:
[ClangConfig] Instead of hard coding the ClangTargets location to 
/ClangTargets.cmake, follow LLVM's example and use a pre-computed cmake 
variable @CLANG_CONFIG_EXPORTS_FILE@.

This just makes ClangConfig more consistent with LLVMConfig.

Modified:
cfe/trunk/cmake/modules/CMakeLists.txt
cfe/trunk/cmake/modules/ClangConfig.cmake.in

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274178&r1=274177&r2=274178&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 16:59:19 2016
@@ -8,12 +8,26 @@ get_property(CLANG_EXPORTS GLOBAL PROPER
 export(TARGETS ${CLANG_EXPORTS} FILE 
${clang_cmake_builddir}/ClangTargets.cmake)
 
 # Generate ClangConfig.cmake for the build tree.
+set(CLANG_CONFIG_CMAKE_DIR "${clang_cmake_builddir}")
+set(CLANG_CONFIG_EXPORTS_FILE "${clang_cmake_builddir}/ClangTargets.cmake")
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
   ${clang_cmake_builddir}/ClangConfig.cmake
   @ONLY)
 
 # Generate ClangConfig.cmake for the install tree.
+set(CLANG_CONFIG_CODE "
+# Compute the installation prefix from this LLVMConfig.cmake file location.
+get_filename_component(CLANG_INSTALL_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" 
PATH)")
+# Construct the proper number of get_filename_component(... PATH)
+# calls to compute the installation prefix.
+string(REGEX REPLACE "/" ";" _count "${CLANG_INSTALL_PACKAGE_DIR}")
+foreach(p ${_count})
+  set(CLANG_CONFIG_CODE "${CLANG_CONFIG_CODE}
+get_filename_component(CLANG_INSTALL_PREFIX \"\${CLANG_INSTALL_PREFIX}\" 
PATH)")
+endforeach(p)
+set(CLANG_CONFIG_CMAKE_DIR 
"\${CLANG_INSTALL_PREFIX}/\${CLANG_INSTALL_PACKAGE_DIR}")
+set(CLANG_CONFIG_EXPORTS_FILE "\${CLANG_CMAKE_DIR}/ClangTargets.cmake")
 configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake

Modified: cfe/trunk/cmake/modules/ClangConfig.cmake.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/ClangConfig.cmake.in?rev=274178&r1=274177&r2=274178&view=diff
==
--- cfe/trunk/cmake/modules/ClangConfig.cmake.in (original)
+++ cfe/trunk/cmake/modules/ClangConfig.cmake.in Wed Jun 29 16:59:19 2016
@@ -6,5 +6,9 @@
 
 find_package(LLVM REQUIRED CONFIG)
 
+@CLANG_CONFIG_CODE@
+
+set(CLANG_CMAKE_DIR "@CLANG_CONFIG_CMAKE_DIR@")
+
 # Provide all our library targets to users.
-include("${CMAKE_CURRENT_LIST_DIR}/ClangTargets.cmake")
+include("@CLANG_CONFIG_EXPORTS_FILE@")


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274179 - [ClangConfig] Unset some variables after we are done using them to configure ClangConfig.cmake.in files.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 16:59:20 2016
New Revision: 274179

URL: http://llvm.org/viewvc/llvm-project?rev=274179&view=rev
Log:
[ClangConfig] Unset some variables after we are done using them to configure 
ClangConfig.cmake.in files.

This ensures that the values do not bleed over in between computations. It may
make sense in the future to just refactor this code into functions to provide
"true scoping".

Modified:
cfe/trunk/cmake/modules/CMakeLists.txt

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274179&r1=274178&r2=274179&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 16:59:20 2016
@@ -14,6 +14,8 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
   ${clang_cmake_builddir}/ClangConfig.cmake
   @ONLY)
+set(CLANG_CONFIG_CMAKE_DIR)
+set(CLANG_CONFIG_EXPORTS_FILE)
 
 # Generate ClangConfig.cmake for the install tree.
 set(CLANG_CONFIG_CODE "
@@ -32,6 +34,9 @@ configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
   ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
   @ONLY)
+set(CLANG_CONFIG_CODE)
+set(CLANG_CONFIG_CMAKE_DIR)
+set(CLANG_CONFIG_EXPORTS_FILE)
 
 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
   install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274176 - [cmake] Instead of just copying ClangConfig.cmake, configure it using ClangConfig.cmake.in.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Wed Jun 29 16:59:14 2016
New Revision: 274176

URL: http://llvm.org/viewvc/llvm-project?rev=274176&view=rev
Log:
[cmake] Instead of just copying ClangConfig.cmake, configure it using 
ClangConfig.cmake.in.

This will allow for cmake to expand variables in ClangConfig.cmake for
downstream users.

Added:
cfe/trunk/cmake/modules/ClangConfig.cmake.in
  - copied, changed from r274169, cfe/trunk/cmake/modules/ClangConfig.cmake
Removed:
cfe/trunk/cmake/modules/ClangConfig.cmake
Modified:
cfe/trunk/cmake/modules/CMakeLists.txt

Modified: cfe/trunk/cmake/modules/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/CMakeLists.txt?rev=274176&r1=274175&r2=274176&view=diff
==
--- cfe/trunk/cmake/modules/CMakeLists.txt (original)
+++ cfe/trunk/cmake/modules/CMakeLists.txt Wed Jun 29 16:59:14 2016
@@ -3,20 +3,24 @@
 # the usual CMake convention seems to be ${Project}Targets.cmake.
 set(CLANG_INSTALL_PACKAGE_DIR lib${LLVM_LIBDIR_SUFFIX}/cmake/clang)
 set(clang_cmake_builddir "${CMAKE_BINARY_DIR}/${CLANG_INSTALL_PACKAGE_DIR}")
+
 get_property(CLANG_EXPORTS GLOBAL PROPERTY CLANG_EXPORTS)
 export(TARGETS ${CLANG_EXPORTS} FILE 
${clang_cmake_builddir}/ClangTargets.cmake)
 
-# Install a /lib/cmake/clang/ClangConfig.cmake file so that
-# find_package(Clang) works. Install the target list with it.
+# Generate ClangConfig.cmake for the build tree.
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
+  ${clang_cmake_builddir}/ClangConfig.cmake
+  @ONLY)
+
+# Generate ClangConfig.cmake for the install tree.
+configure_file(
+  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake.in
+  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
+  @ONLY)
+
 install(EXPORT ClangTargets DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
 
 install(FILES
-  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
+  ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/ClangConfig.cmake
   DESTINATION ${CLANG_INSTALL_PACKAGE_DIR})
-
-# Also copy ClangConfig.cmake to the build directory so that dependent projects
-# can build against a build directory of Clang more easily.
-configure_file(
-  ${CMAKE_CURRENT_SOURCE_DIR}/ClangConfig.cmake
-  ${clang_cmake_builddir}/ClangConfig.cmake
-  COPYONLY)

Removed: cfe/trunk/cmake/modules/ClangConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/ClangConfig.cmake?rev=274175&view=auto
==
--- cfe/trunk/cmake/modules/ClangConfig.cmake (original)
+++ cfe/trunk/cmake/modules/ClangConfig.cmake (removed)
@@ -1,10 +0,0 @@
-# This file allows users to call find_package(Clang) and pick up our targets.
-
-# Clang doesn't have any CMake configuration settings yet because it mostly
-# uses LLVM's. When it does, we should move this file to ClangConfig.cmake.in
-# and call configure_file() on it.
-
-find_package(LLVM REQUIRED CONFIG)
-
-# Provide all our library targets to users.
-include("${CMAKE_CURRENT_LIST_DIR}/ClangTargets.cmake")

Copied: cfe/trunk/cmake/modules/ClangConfig.cmake.in (from r274169, 
cfe/trunk/cmake/modules/ClangConfig.cmake)
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/ClangConfig.cmake.in?p2=cfe/trunk/cmake/modules/ClangConfig.cmake.in&p1=cfe/trunk/cmake/modules/ClangConfig.cmake&r1=274169&r2=274176&rev=274176&view=diff
==
(empty)


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274212 - [cmake] Remove stale comment. NFC.

2016-06-29 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Thu Jun 30 00:51:18 2016
New Revision: 274212

URL: http://llvm.org/viewvc/llvm-project?rev=274212&view=rev
Log:
[cmake] Remove stale comment. NFC.

Modified:
cfe/trunk/cmake/modules/ClangConfig.cmake.in

Modified: cfe/trunk/cmake/modules/ClangConfig.cmake.in
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/ClangConfig.cmake.in?rev=274212&r1=274211&r2=274212&view=diff
==
--- cfe/trunk/cmake/modules/ClangConfig.cmake.in (original)
+++ cfe/trunk/cmake/modules/ClangConfig.cmake.in Thu Jun 30 00:51:18 2016
@@ -1,9 +1,5 @@
 # This file allows users to call find_package(Clang) and pick up our targets.
 
-# Clang doesn't have any CMake configuration settings yet because it mostly
-# uses LLVM's. When it does, we should move this file to ClangConfig.cmake.in
-# and call configure_file() on it.
-
 find_package(LLVM REQUIRED CONFIG)
 
 @CLANG_CONFIG_CODE@


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


r274992 - Move add_clang_* entry points from the main clang CMakeLists.txt to cmake/modules/AddClang.cmake.

2016-07-09 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Sat Jul  9 16:58:40 2016
New Revision: 274992

URL: http://llvm.org/viewvc/llvm-project?rev=274992&view=rev
Log:
Move add_clang_* entry points from the main clang CMakeLists.txt to 
cmake/modules/AddClang.cmake.

This matches how LLVM has its cmake files organized and is cleaner than just
shoving this business logic into the main CMakeLists.txt.

Added:
cfe/trunk/cmake/modules/AddClang.cmake
Modified:
cfe/trunk/CMakeLists.txt

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=274992&r1=274991&r2=274992&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Sat Jul  9 16:58:40 2016
@@ -168,6 +168,10 @@ else()
   set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}")
 endif()
 
+# Make sure that our source directory is on the current cmake module path so 
that
+# we can include cmake files from this directory.
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules")
+
 find_package(LibXml2 2.5.3 QUIET)
 if (LIBXML2_FOUND)
   set(CLANG_HAVE_LIBXML 1)
@@ -308,149 +312,7 @@ configure_file(
   ${CLANG_BINARY_DIR}/include/clang/Config/config.h)
 
 include(CMakeParseArguments)
-
-function(clang_tablegen)
-  # Syntax:
-  # clang_tablegen output-file [tablegen-arg ...] SOURCE source-file
-  # [[TARGET cmake-target-name] [DEPENDS extra-dependency ...]]
-  #
-  # Generates a custom command for invoking tblgen as
-  #
-  # tblgen source-file -o=output-file tablegen-arg ...
-  #
-  # and, if cmake-target-name is provided, creates a custom target for
-  # executing the custom command depending on output-file. It is
-  # possible to list more files to depend after DEPENDS.
-
-  cmake_parse_arguments(CTG "" "SOURCE;TARGET" "" ${ARGN})
-
-  if( NOT CTG_SOURCE )
-message(FATAL_ERROR "SOURCE source-file required by clang_tablegen")
-  endif()
-
-  set( LLVM_TARGET_DEFINITIONS ${CTG_SOURCE} )
-  tablegen(CLANG ${CTG_UNPARSED_ARGUMENTS})
-
-  if(CTG_TARGET)
-add_public_tablegen_target(${CTG_TARGET})
-set_target_properties( ${CTG_TARGET} PROPERTIES FOLDER "Clang 
tablegenning")
-set_property(GLOBAL APPEND PROPERTY CLANG_TABLEGEN_TARGETS ${CTG_TARGET})
-  endif()
-endfunction(clang_tablegen)
-
-macro(set_clang_windows_version_resource_properties name)
-  if(DEFINED windows_resource_file)
-set_windows_version_resource_properties(${name} ${windows_resource_file}
-  VERSION_MAJOR ${CLANG_VERSION_MAJOR}
-  VERSION_MINOR ${CLANG_VERSION_MINOR}
-  VERSION_PATCHLEVEL ${CLANG_VERSION_PATCHLEVEL}
-  VERSION_STRING "${CLANG_VERSION} (${BACKEND_PACKAGE_STRING})"
-  PRODUCT_NAME "clang")
-  endif()
-endmacro()
-
-macro(add_clang_subdirectory name)
-  add_llvm_subdirectory(CLANG TOOL ${name})
-endmacro()
-
-macro(add_clang_library name)
-  cmake_parse_arguments(ARG
-"SHARED"
-""
-"ADDITIONAL_HEADERS"
-${ARGN})
-  set(srcs)
-  if(MSVC_IDE OR XCODE)
-# Add public headers
-file(RELATIVE_PATH lib_path
-  ${CLANG_SOURCE_DIR}/lib/
-  ${CMAKE_CURRENT_SOURCE_DIR}
-)
-if(NOT lib_path MATCHES "^[.][.]")
-  file( GLOB_RECURSE headers
-${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.h
-${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.def
-  )
-  set_source_files_properties(${headers} PROPERTIES HEADER_FILE_ONLY ON)
-
-  file( GLOB_RECURSE tds
-${CLANG_SOURCE_DIR}/include/clang/${lib_path}/*.td
-  )
-  source_group("TableGen descriptions" FILES ${tds})
-  set_source_files_properties(${tds}} PROPERTIES HEADER_FILE_ONLY ON)
-
-  if(headers OR tds)
-set(srcs ${headers} ${tds})
-  endif()
-endif()
-  endif(MSVC_IDE OR XCODE)
-  if(srcs OR ARG_ADDITIONAL_HEADERS)
-set(srcs
-  ADDITIONAL_HEADERS
-  ${srcs}
-  ${ARG_ADDITIONAL_HEADERS} # It may contain unparsed unknown args.
-  )
-  endif()
-  if(ARG_SHARED)
-set(ARG_ENABLE_SHARED SHARED)
-  endif()
-  llvm_add_library(${name} ${ARG_ENABLE_SHARED} ${ARG_UNPARSED_ARGUMENTS} 
${srcs})
-
-  if(TARGET ${name})
-target_link_libraries(${name} INTERFACE ${LLVM_COMMON_LIBS})
-
-if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY OR ${name} STREQUAL "libclang")
-  install(TARGETS ${name}
-COMPONENT ${name}
-EXPORT ClangTargets
-LIBRARY DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
-RUNTIME DESTINATION bin)
-
-  if (${ARG_SHARED} AND NOT CMAKE_CONFIGURATION_TYPES)
-add_custom_target(install-${name}
-  DEPENDS ${name}
-  COMMAND "${CMAKE_COMMAND}"
-  -DCMAKE_INSTALL_COMPONENT=${name}
-  -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
-  endif()
-endif()
-set_property(GLOBAL APPEND PROPERTY CLANG_EXPORTS ${name})
-  else()
-# Add empty "phony" t

r275006 - Add CLANG_BUILD_TOOLS as a clang counterpart for LLVM_BUILD_TOOLS

2016-07-09 Thread Michael Gottesman via cfe-commits
Author: mgottesman
Date: Sat Jul  9 20:44:00 2016
New Revision: 275006

URL: http://llvm.org/viewvc/llvm-project?rev=275006&view=rev
Log:
Add CLANG_BUILD_TOOLS as a clang counterpart for LLVM_BUILD_TOOLS

LLVM_BUILD_TOOLS is a boolean variable that controls whether or not generated
targets for llvm tools are built by the "all" target. CLANG_BUILD_TOOLS is an
analogous variable for clang targets.

This is useful functionality for selectively disabling the building of clang
targets by default to speed up builds.

In terms of implementation, I just followed the model of LLVM's implementation
of this functionality.

Modified:
cfe/trunk/CMakeLists.txt
cfe/trunk/cmake/modules/AddClang.cmake

Modified: cfe/trunk/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/CMakeLists.txt?rev=275006&r1=275005&r2=275006&view=diff
==
--- cfe/trunk/CMakeLists.txt (original)
+++ cfe/trunk/CMakeLists.txt Sat Jul  9 20:44:00 2016
@@ -342,6 +342,9 @@ endif()
 
 add_definitions( -D_GNU_SOURCE )
 
+option(CLANG_BUILD_TOOLS
+  "Build the Clang tools. If OFF, just generate build targets." ON)
+
 option(CLANG_ENABLE_ARCMT "Build ARCMT." ON)
 if (CLANG_ENABLE_ARCMT)
   set(ENABLE_CLANG_ARCMT "1")

Modified: cfe/trunk/cmake/modules/AddClang.cmake
URL: 
http://llvm.org/viewvc/llvm-project/cfe/trunk/cmake/modules/AddClang.cmake?rev=275006&r1=275005&r2=275006&view=diff
==
--- cfe/trunk/cmake/modules/AddClang.cmake (original)
+++ cfe/trunk/cmake/modules/AddClang.cmake Sat Jul  9 20:44:00 2016
@@ -121,17 +121,24 @@ macro(add_clang_executable name)
 endmacro(add_clang_executable)
 
 macro(add_clang_tool name)
+  if (NOT CLANG_BUILD_TOOLS)
+set(EXCLUDE_FROM_ALL ON)
+  endif()
+
   add_clang_executable(${name} ${ARGN})
-  install(TARGETS ${name}
-RUNTIME DESTINATION bin
-COMPONENT ${name})
 
-  if(NOT CMAKE_CONFIGURATION_TYPES)
-add_custom_target(install-${name}
-  DEPENDS ${name}
-  COMMAND "${CMAKE_COMMAND}"
-  -DCMAKE_INSTALL_COMPONENT=${name}
-  -P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+  if (CLANG_BUILD_TOOLS)
+install(TARGETS ${name}
+  RUNTIME DESTINATION bin
+  COMPONENT ${name})
+
+if(NOT CMAKE_CONFIGURATION_TYPES)
+  add_custom_target(install-${name}
+DEPENDS ${name}
+COMMAND "${CMAKE_COMMAND}"
+-DCMAKE_INSTALL_COMPONENT=${name}
+-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
+endif()
   endif()
 endmacro()
 


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D16708: Add a new attribute CFNoRelease.

2016-01-28 Thread Michael Gottesman via cfe-commits
gottesmm updated this revision to Diff 46354.
gottesmm added a comment.

Added documentation.


http://reviews.llvm.org/D16708

Files:
  include/clang/Basic/Attr.td
  lib/Sema/SemaDeclAttr.cpp
  test/SemaObjC/attr-cf_no_release.m

Index: test/SemaObjC/attr-cf_no_release.m
===
--- /dev/null
+++ test/SemaObjC/attr-cf_no_release.m
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -fobjc-arc -verify -fsyntax-only %s
+// Make sure we accept the cf_no_release attribute in all of the appropriate 
places.
+
+#define CF_NO_RELEASE __attribute__((cf_no_release))
+
+int x CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only 
applies to functions}}
+
+typedef struct __CFFoo *CFFooRef;
+
+int valid1() CF_NO_RELEASE;
+void valid2() CF_NO_RELEASE;
+CFFooRef valid3() CF_NO_RELEASE;
+id valid4() CF_NO_RELEASE;
+
+@interface Test
+- (int)invalid1 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute 
only applies to functions}}
+- (void)invalid2 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute 
only applies to functions}}
+- (CFFooRef)invalid3 CF_NO_RELEASE; // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+- (id)invalid4 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute 
only applies to functions}}
+
+@property int invalidProp1 CF_NO_RELEASE; // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+@property void invalidProp2 CF_NO_RELEASE; // 
expected-warning{{'cf_no_release' attribute only applies to functions}}
+@property CFFooRef invalidProp3 CF_NO_RELEASE; // 
expected-warning{{'cf_no_release' attribute only applies to functions}}
+@property id invalidProp4 CF_NO_RELEASE; // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+@end
+
+void invalidParam(int a CF_NO_RELEASE, // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+  int *b CF_NO_RELEASE, // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+  id c CF_NO_RELEASE, // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+  void *d CF_NO_RELEASE, // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+  CFFooRef e CF_NO_RELEASE); // 
expected-warning{{'cf_no_release' attribute only applies to functions}}
Index: lib/Sema/SemaDeclAttr.cpp
===
--- lib/Sema/SemaDeclAttr.cpp
+++ lib/Sema/SemaDeclAttr.cpp
@@ -5279,7 +5279,9 @@
   case AttributeList::AT_NSConsumesSelf:
 handleSimpleAttribute(S, D, Attr);
 break;
-
+  case AttributeList::AT_CFNoRelease:
+handleSimpleAttribute(S, D, Attr);
+break;
   case AttributeList::AT_NSReturnsAutoreleased:
   case AttributeList::AT_NSReturnsNotRetained:
   case AttributeList::AT_CFReturnsNotRetained:
Index: include/clang/Basic/Attr.td
===
--- include/clang/Basic/Attr.td
+++ include/clang/Basic/Attr.td
@@ -531,6 +531,15 @@
   let Documentation = [Undocumented];
 }
 
+// cf_no_release indicates that the call graph reachable from the given 
function
+// does not decrement reference counts in a manner that is visible to the
+// compiler.
+def CFNoRelease : InheritableAttr {
+  let Spellings = [GNU<"cf_no_release">];
+  let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
+}
+
 def Cleanup : InheritableAttr {
   let Spellings = [GCC<"cleanup">];
   let Args = [FunctionArgument<"FunctionDecl">];


Index: test/SemaObjC/attr-cf_no_release.m
===
--- /dev/null
+++ test/SemaObjC/attr-cf_no_release.m
@@ -0,0 +1,31 @@
+// RUN: %clang_cc1 -fobjc-arc -verify -fsyntax-only %s
+// Make sure we accept the cf_no_release attribute in all of the appropriate places.
+
+#define CF_NO_RELEASE __attribute__((cf_no_release))
+
+int x CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+
+typedef struct __CFFoo *CFFooRef;
+
+int valid1() CF_NO_RELEASE;
+void valid2() CF_NO_RELEASE;
+CFFooRef valid3() CF_NO_RELEASE;
+id valid4() CF_NO_RELEASE;
+
+@interface Test
+- (int)invalid1 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+- (void)invalid2 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+- (CFFooRef)invalid3 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+- (id)invalid4 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+
+@property int invalidProp1 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+@property void invalidProp2 CF_NO_RELEASE; // expected-warning{{'cf_no_release' attribute only applies to functions}}
+@property CFFooRef invalidProp3 CF_NO_RELEASE; // expecte

Re: [PATCH] D16708: Add a new attribute CFNoRelease.

2016-01-31 Thread Michael Gottesman via cfe-commits

> On Jan 29, 2016, at 6:02 AM, Aaron Ballman  wrote:
> 
> aaron.ballman added a subscriber: aaron.ballman.
> aaron.ballman added a reviewer: aaron.ballman.
> aaron.ballman added a comment.
> 
> It's a bit strange to add an attribute that has absolutely no semantic effect 
> whatsoever. Where is this attribute intended to be queried within the 
> compiler? Are there additional functionality patches coming for this?

Yes there is a forthcoming patch for CodeGen which will place an attribute on 
the relevant functions. The attribute will be queried in the middle end 
optimizer. The reason why there has been a bit of a delay is I realized I 
wanted to talk to a few more people about this attribute internally.

We may want to expand its use to essentially mean "no-arc", i.e. this is a c 
function that uses pure c-code.

There are other possibilities as well.

> 
> 
> 
> Comment at: include/clang/Basic/Attr.td:540
> @@ +539,3 @@
> +  let Subjects = SubjectList<[Function]>;
> +  let Documentation = [Undocumented];
> +}
> 
> Please, no undocumented new attributes. You should modify AttrDocs.td and 
> include that reference here.

I was just following the model of the code that was already there and 
documented the attribute in a comment above the attribute.

I am fine with adding specific documentation for the attribute.

> 
> 
> Comment at: test/SemaObjC/attr-cf_no_release.m:31
> @@ +30,2 @@
> +  void *d CF_NO_RELEASE, // 
> expected-warning{{'cf_no_release' attribute only applies to functions}}
> +  CFFooRef e CF_NO_RELEASE); // 
> expected-warning{{'cf_no_release' attribute only applies to functions}}
> 
> Not that lots of test are bad, but a lot of these tests are duplicates and 
> can be removed. For instance, really only need one test for ObjC methods, one 
> for properties, one for params, etc. It would be good to add a test ensuring 
> that the attribute accepts no arguments.

Ok.

Michael

> 
> 
> http://reviews.llvm.org/D16708
> 
> 
> 

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D16708: Add a new attribute CFNoRelease.

2016-01-31 Thread Michael Gottesman via cfe-commits
gottesmm added a comment.

I think that my response via email did not hit phabriactor. So sorry for the 
delay.

Yes there is a forthcoming patch for CodeGen which will place an attribute on 
the relevant functions. The attribute will be queried in the middle end 
optimizer. The reason why there has been a bit of a delay is I realized I 
wanted to talk to a few more people about this attribute internally.

We may want to expand its use to essentially mean "no-arc", i.e. this is a c 
function that uses pure c-code.

There are other possibilities as well so stay tuned.


http://reviews.llvm.org/D16708



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


Re: [PATCH] D16708: Add a new attribute CFNoRelease.

2016-01-31 Thread Michael Gottesman via cfe-commits
gottesmm added inline comments.


Comment at: include/clang/Basic/Attr.td:540
@@ +539,3 @@
+  let Subjects = SubjectList<[Function]>;
+  let Documentation = [Undocumented];
+}

aaron.ballman wrote:
> Please, no undocumented new attributes. You should modify AttrDocs.td and 
> include that reference here.
Ok. I was just following what was done in the surrounding code. I am fine with 
adding something to AttrDocs.td once we pin down exactly what we want.



Comment at: test/SemaObjC/attr-cf_no_release.m:31
@@ +30,2 @@
+  void *d CF_NO_RELEASE, // expected-warning{{'cf_no_release' 
attribute only applies to functions}}
+  CFFooRef e CF_NO_RELEASE); // 
expected-warning{{'cf_no_release' attribute only applies to functions}}

aaron.ballman wrote:
> Not that lots of test are bad, but a lot of these tests are duplicates and 
> can be removed. For instance, really only need one test for ObjC methods, one 
> for properties, one for params, etc. It would be good to add a test ensuring 
> that the attribute accepts no arguments.
Ok.


http://reviews.llvm.org/D16708



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits