MCPcopy Create free account
hub / github.com/beefytech/Beef / HandleCustomAttributes

Method HandleCustomAttributes

IDEHelper/Compiler/BfMangler.cpp:2417–2445  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2415}
2416
2417void BfMangler::HandleCustomAttributes(BfCustomAttributes* customAttributes, BfIRConstHolder* constHolder, BfModule* module, StringImpl& name, bool& isCMangle, bool& isCPPMangle)
2418{
2419 if (customAttributes == NULL)
2420 return;
2421
2422 auto linkNameAttr = customAttributes->Get(module->mCompiler->mLinkNameAttributeTypeDef);
2423 if (linkNameAttr != NULL)
2424 {
2425 if (linkNameAttr->mCtorArgs.size() == 1)
2426 {
2427 if (module->TryGetConstString(constHolder, linkNameAttr->mCtorArgs[0], name))
2428 if (!name.IsWhitespace())
2429 return;
2430
2431 auto constant = constHolder->GetConstant(linkNameAttr->mCtorArgs[0]);
2432 if (constant != NULL)
2433 {
2434 if (constant->mInt32 == 1) // C
2435 {
2436 isCMangle = true;
2437 }
2438 else if (constant->mInt32 == 2) // CPP
2439 {
2440 isCPPMangle = true;
2441 }
2442 }
2443 }
2444 }
2445}
2446
2447void BfMangler::HandleParamCustomAttributes(BfAttributeDirective* attributes, bool isReturn, bool& isConst)
2448{

Callers

nothing calls this directly

Calls 5

TryGetConstStringMethod · 0.80
IsWhitespaceMethod · 0.80
GetMethod · 0.45
sizeMethod · 0.45
GetConstantMethod · 0.45

Tested by

no test coverage detected