Chris Lattner | 16 Sep 2007 21:24
Picon
Favicon

Re: Warnings patch for gcc 4.2.x


On Sep 15, 2007, at 3:34 PM, Justin Handville wrote:

> This patch fixes all of the warnings currently generated in trunk with
> -Wall -Werror.
>
> Mostly, this stubs out missing enums in switch statements.  Also, note
> the fix for InvalidDecl below.

Applied, thanks!

> --- AST/Decl.cpp	(revision 41989)
> +++ AST/Decl.cpp	(working copy)
>  <at>  <at>  -105,6 +105,21  <at>  <at> 
>      case ObjcInterface:
>        nInterfaceDecls++;
>        break;
> +    case ObjcClass:
> +      //FIXME add functionality here.
> +      break;

For chunks like this, please change these to assert on the  
unimplemented case so we can find them easily if executed.

Thanks Justin,

-Chris
Chris Lattner | 16 Sep 2007 21:25
Picon
Favicon

Re: Small patch for internals manual documentation

On Sep 15, 2007, at 9:02 PM, Justin Handville wrote:
> Escaping a '<' fixes the error I'm getting when reading it.

Applied.  FYI, the patch wrapped, which made it not apply.  Please  
attach patches as attachments to the email instead of including them  
inline.  This is obviously not a big deal with this small patch, but  
just mentioning it for the future. :)

Thanks!

-Chris

> Index: InternalsManual.html
> ===================================================================
> --- InternalsManual.html        (revision 41997)
> +++ InternalsManual.html        (working copy)
>  <at>  <at>  -233,7 +233,7  <at>  <at> 
>      support the -C preprocessor mode, which passes comments  
> through, and is
>      used by the diagnostic checker to identifier expect-error  
> annotations.</li>
>  <li>The lexer can be in ParsingFilename mode, which happens when  
> preprocessing
> -    after reading a #include directive.  This mode changes the  
> parsing of '<'
> +    after reading a #include directive.  This mode changes the
> parsing of '&lt;'
>      to return an "angled string" instead of a bunch of tokens for  
> each thing
>      within the filename.</li>
(Continue reading)

Cédric Venet | 18 Sep 2007 10:51
Picon
Picon

Bug Patch for MSVC


      Hi,

   There is a small bug in the actual clang code when compiling with  
visual studio 8.0 . For VS, the enum are signed so when an enum is  
used in a bit field just the right size, it get sign exteded when you  
read it and this cause problems (here it perturb isa<> so clang can't  
compile a function definition...)

here is the patch (not a true patch since I don't have svn acces from  
where I am)

file: /include/clang/AST/Type.h
lines: 199 to 216

  class Type {
  public:
-   enum TypeClass {
+   enum TypeClass : unsigned int {
      Builtin, Complex, Pointer, Reference,
      ConstantArray, VariableArray,
      Vector, OCUVector,
      FunctionNoProto, FunctionProto,
      TypeName, Tagged,
      ObjcInterface,
      TypeOfExp, TypeOfTyp // GNU typeof extension.
    };
  private:
    QualType CanonicalType;

(Continue reading)

Michael Marcin | 18 Sep 2007 22:08

Newsreader access available through Gmane.

The Clang development mailing list can now be accessed via Gmane.

nntp://news.gmane.org/gmane.comp.compilers.clang.devel

- Michael Marcin
Chris Lattner | 18 Sep 2007 22:59
Picon
Favicon

Re: Newsreader access available through Gmane.


On Sep 18, 2007, at 1:08 PM, Michael Marcin wrote:

> The Clang development mailing list can now be accessed via Gmane.
>
> nntp://news.gmane.org/gmane.comp.compilers.clang.devel
>
> - Michael Marcin

nice!

-Chris
Chris Lattner | 19 Sep 2007 19:16
Picon
Favicon

Re: Bug Patch for MSVC


On Sep 18, 2007, at 1:51 AM, Cédric Venet wrote:

>
>       Hi,
>
>    There is a small bug in the actual clang code when compiling with
> visual studio 8.0 . For VS, the enum are signed so when an enum is
> used in a bit field just the right size, it get sign exteded when you
> read it and this cause problems (here it perturb isa<> so clang can't
> compile a function definition...)

Ok.

> here is the patch (not a true patch since I don't have svn acces from
> where I am)
>
> file: /include/clang/AST/Type.h
> lines: 199 to 216
>
>   class Type {
>   public:
> -   enum TypeClass {
> +   enum TypeClass : unsigned int {

This isn't valid C++ Syntax.

>     QualType CanonicalType;
>
>    /// TypeClass bitfield - Enum that specifies what subclass this  
(Continue reading)

Hartmut Kaiser | 19 Sep 2007 20:38
Picon
Gravatar

Re: Bug Patch for MSVC

Chris, 

> >     QualType CanonicalType;
> >
> >    /// TypeClass bitfield - Enum that specifies what subclass this 
> > belongs to.
> >    /// Note that this should stay at the end of the ivars 
> for Type so 
> > that
> >    /// subclasses can pack their bitfields into the same word.
> >    TypeClass TC : 4;
> >
> > another alternative is to make the TC bit field 5 bits 
> wide. This is 
> > the choice llvm made in one of is class.
> 
> I'd suggest changing getTypeClass() to do the appropriate masking.

FWIW, that's exactly what I did a couple of days ago. 
Are there other places in clang where bitmasks are used?

Regards Hartmut
Chris Lattner | 19 Sep 2007 20:49
Picon
Favicon

Re: Bug Patch for MSVC


On Sep 19, 2007, at 11:38 AM, Hartmut Kaiser wrote:

> Chris,
>
>>>     QualType CanonicalType;
>>>
>>>    /// TypeClass bitfield - Enum that specifies what subclass this
>>> belongs to.
>>>    /// Note that this should stay at the end of the ivars
>> for Type so
>>> that
>>>    /// subclasses can pack their bitfields into the same word.
>>>    TypeClass TC : 4;
>>>
>>> another alternative is to make the TC bit field 5 bits
>> wide. This is
>>> the choice llvm made in one of is class.
>>
>> I'd suggest changing getTypeClass() to do the appropriate masking.
>
> FWIW, that's exactly what I did a couple of days ago.
> Are there other places in clang where bitmasks are used?

The specific sticking issue seems to be enum bitfields.  The other  
solution would be to declare TC as:

  unsigned TC : 4;

and then return (TypeClass)TC;  in getTypeClass().  This is probably  
(Continue reading)

Ted Kremenek | 19 Sep 2007 23:32
Picon
Favicon
Gravatar

revision 42152 requires updated with llvm main tree

My latest patch:

http://llvm.org/viewvc/llvm-project?view=rev&revision=42152

requires an update with the main LLVM tree in order to compile clang.   
This is due to a patch I made to GraphWriter.h in order to support  
visualization of ASTs.

Ted
Chris Lattner | 20 Sep 2007 02:24
Picon
Favicon

-parse-ast-view

FYI, with Ted's latest changes, we can now use -parse-ast-view to  
look at ASTs.  If you have graphviz set up right, you should see  
something like this:


for

void foo(int *P, int N) {
   for (int i = 0; i != N; ++i)
     P[i] = N;
}

nifty!

Over time, more info will be added to the nodes.

-Chris
_______________________________________________
cfe-dev mailing list
cfe-dev@...
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

Gmane