search for: semadeclattr

Displaying 10 results from an estimated 10 matches for "semadeclattr".

2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
.... >> >> I’ve added a new attribute to clang in tools/clang/include/clang/Basic/Attr.td: >> >> def NoFLA : Attr { >> let Spellings = [GNU<"nofla">, CXX11<"gnu", "nofla">]; >> } >> >> In tools/clang/lib/Sema/SemaDeclAttr.cpp I added my new attribute to the switch that handle it and created my own handler function. >> I’m trying to simply pass my attribute to the IR attribute list, but, sadly, I have absolutely no idea how to do that. I looked at others handler but none seems to do that. I also tried to use ha...
2018 May 25
1
MSP430: interrupt vector number out of bounds error in v6/trunk (with patch)
...headers distributed with TI MSP GCC, interrupt service routine interrupt(vector_number) attribute is rejected: __attribute__ ((interrupt(USCI_A0_VECTOR))) void ISR(void) { } error: 'interrupt' attribute parameter 48 is out of bounds This is due to the check in tools/clang/lib/Sema/SemaDeclAttr.cpp:5104 unsigned Num = NumParams.getLimitedValue(255); if ((Num & 1) || Num > 30) { S.Diag(AL.getLoc(), diag::err_attribute_argument_out_of_bounds) << AL.getName() << (int)NumParams.getSExtValue() << NumParamsExpr->getSourceRange...
2015 Mar 24
2
[LLVMdev] Propagate clang attribute to IR
...le to *flag* my functions I’m trying to add a *real* attribute to clang. I’ve added a new attribute to clang in tools/clang/include/clang/Basic/Attr.td: def NoFLA : Attr { let Spellings = [GNU<"nofla">, CXX11<"gnu", "nofla">]; } In tools/clang/lib/Sema/SemaDeclAttr.cpp I added my new attribute to the switch that handle it and created my own handler function. I’m trying to simply pass my attribute to the IR attribute list, but, sadly, I have absolutely no idea how to do that. I looked at others handler but none seems to do that. I also tried to use handleSimpl...
2020 Oct 30
3
Questions about ctor/dtor attribute related diagnostics
Hi, I noticed that there are some diagnostics discrepancies between clang and gcc related to `__attribute__((constructor(n)))` and `__attribute__((destructor(n)))`. *[clang]* It seems priorities >65535 and <0 on ctor/dtor functions are ignored and are set back to default 65535 in clang and Clang only gives an error when > 32-bit unsigned value specified. *[g++]* g++ gives an error for
2016 Nov 25
2
Translation of custom attribute (defined for variables) from clang to llvm
...ang), for example in following snippet. #define NEWATTR __attribute__((moviAttr(1))) int main() { NEWATTR volatile unsigned int a = 5; volatile unsigned int *p; p = &a; return (a+*p); } and actually when I Dump the declaration, after adding the attribute in handleMoviAttr() function in SemaDeclAttr.cpp as shown in following snippet D->addAttr(::new (S.Context)moviAttrAttr(Attr.getRange(), S.Context, Val, Attr.getAttributeSpellingListIndex())); D->dump(); It is dumped by clang with following output VarDecl 0x440c698 <file.c:6:17, line:10:32> col:32 a 'volatile unsigned in...
2016 Nov 25
3
Translation of custom attribute (defined for variables) from clang to llvm
...; >> int main() >> { >> NEWATTR volatile unsigned int a = 5; >> volatile unsigned int *p; >> p = &a; >> return (a+*p); >> } >> >> and actually when I Dump the declaration, after adding the attribute >> in handleMoviAttr() function in SemaDeclAttr.cpp as shown in >> following snippet >> >> D->addAttr(::new (S.Context)moviAttrAttr(Attr.getRange(), S.Context, >> Val, Attr.getAttributeSpellingListIndex())); >> D->dump(); >> >> It is dumped by clang with following output >> >> VarDec...
2020 Nov 05
0
Questions about ctor/dtor attribute related diagnostics
...igned value specified. > > [g++] > g++ gives an error for any values <0 and >65535. > > I am wondering should we let Clang's diagnostics match g++ to make things clearer to the user? Or why Clang emits an error for >32-bit unsigned value only? The code for this lives in SemaDeclAttr.cpp in `handleConstructorAttr()` and `handleDestructorAttr()`, both of which are defined similarly as trying to read the attribute argument as an unsigned 32-bit value. If the value is outside of the range of a 32-bit unsigned number, the `checkUInt32Argument()` helper function will diagnose it as...
2016 Nov 28
2
Translation of custom attribute (defined for variables) from clang to llvm
...signed int a = 5; >> >> volatile unsigned int *p; >> >> p = &a; >> >> return (a+*p); >> >> } >> >> >> >> and actually when I Dump the declaration, after adding the attribute >> >> in handleMoviAttr() function in SemaDeclAttr.cpp as shown in >> >> following snippet >> >> >> >> D->addAttr(::new (S.Context)moviAttrAttr(Attr.getRange(), S.Context, >> >> Val, Attr.getAttributeSpellingListIndex())); >> >> D->dump(); >> >> >> >> It is du...
2014 Apr 03
5
[LLVMdev] comparing .o files from different build trees
...../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/AttributeList.o differ: byte 94793, line 191 ./tools/clang/lib/Sema/Release+Asserts/SemaDecl.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/SemaDecl.o differ: byte 538096, line 952 ./tools/clang/lib/Sema/Release+Asserts/SemaDeclAttr.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/SemaDeclAttr.o differ: byte 239545, line 405 ./tools/clang/lib/Sema/Release+Asserts/SemaTemplateInstantiateDecl.o ../../recurse2be/build/./tools/clang/lib/Sema/Release+Asserts/SemaTemplateInstantiateDecl.o differ: byte 172615, line 245...
2014 Nov 03
8
[LLVMdev] [PATCH] Protection against stack-based memory corruption errors using SafeStack
...if (LangOpts.getStackProtector() == LangOptions::SSPSafeStack) + Builder.defineMacro("__SAFESTACK__", "4"); if (FEOpts.ProgramAction == frontend::RewriteObjC) Builder.defineMacro("__weak", "__attribute__((objc_gc(weak)))"); diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 1b04e52..e8656ec 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -4593,6 +4593,9 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, case AttributeList::AT_ScopedLockable: handleSimpleAttribute<ScopedLock...